本文整理汇总了C#中Receipt.Update方法的典型用法代码示例。如果您正苦于以下问题:C# Receipt.Update方法的具体用法?C# Receipt.Update怎么用?C# Receipt.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Receipt
的用法示例。
在下文中一共展示了Receipt.Update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetNewRcv
/// <summary>
/// ******************Important!*****************
/// </summary>
/// <param name="model"></param>
/// <param name="epiSession"></param>
/// <param name="IsSucces"></param>
/// <param name="msgError"></param>
/// <returns></returns>
public bool GetNewRcv(RecieptHeadModel head, List<ReceiptDetailModel> model, Epicor.Mfg.Core.Session epiSession, out bool IsSucces, out string msgError)
{
msgError = "";
ReceiptDataSet dsReceipt = new ReceiptDataSet();
try
{
Receipt myReceipt = new Receipt(epiSession.ConnectionPool);
myReceipt.ValidateMRPONum(head.PONum, head.VendorNum, out msgError);
#region PO no error.
if (string.IsNullOrEmpty(msgError))
{
/*This OK*/
myReceipt.GetNewRcvHead(dsReceipt, head.VendorNum, "");
/*Fix for testing
myReceipt.GetNewRcvHead(dsReceipt, 5, "");
*/
DataRow drReceipt = dsReceipt.Tables[0].Rows[0];
drReceipt.BeginEdit();
string PackSlip = head.StoreInNum + "-RCV";
/* This OK */
drReceipt["VendorNum"] = head.VendorNum;
drReceipt["PackSlip"] = PackSlip;
drReceipt["ReceiptDate"] = DateTime.Now;
drReceipt["ReceivePerson"] = epiSession.UserID;
drReceipt["ShipViaCode"] = "UC02";
drReceipt["PONum"] = head.PONum;
/*Fix for testing
drReceipt["VendorNum"] = 5;
drReceipt["PackSlip"] = "IN00002-5";
drReceipt["ReceiptDate"] = DateTime.Now;
drReceipt["ReceivePerson"] = "manager";
drReceipt["ShipViaCode"] = "UC02";
drReceipt["PONum"] = 272;
*/
drReceipt.EndEdit();
myReceipt.Update(dsReceipt);
//myReceipt.CreateMassReceipts(model.VendorNum, "", model.StoreInNum, 0, model.PONum.ToString(), dsReceipt);
myReceipt.CreateMassReceipts(head.VendorNum, "", PackSlip, 0, head.PONum.ToString(), dsReceipt);
myReceipt.ReceiveAll(dsReceipt);
int i = 0;
foreach (DataRow dr in dsReceipt.Tables["RcvDtl"].Rows)
{
//myReceipt.GetNewRcvDtl(dsReceipt, model.VendorNum, "", model.StoreInNum);
//DataRow drDtl = dsReceipt.Tables["RcvDtl"].Rows[i];
//myReceipt.GetDtlQtyInfo(dsReceipt, model.VendorNum, "", model.StoreInNum, dr["PackLine"].GetInt(), 1, "KG", "", out msgError);
ReceiptDetailModel result = model.Where<ReceiptDetailModel>(p => p.PONum.ToString().Equals(dr["PONum"].ToString())
&& p.POLine.ToString().Equals(dr["POLine"].ToString())).Single<ReceiptDetailModel>();
dr.BeginEdit();
dr["OurQty"] = result.Weight;
dr["OurUnitCost"] = 1;
//dr["VendorQty"] = result.Weight;
dr["ReceivedComplete"] = false;
dr["DocUnitCost"] = 20; //ถ้าเป็น PO Sample จะเป็น 0 (Else result.UnitPrice)
dr["POTransValue"] = 20;
dr["ExtTransValue"] = 20;
dr["InputOurQty"] = result.Weight;
dr["Number01"] = result.Weight; //Weight
dr["Received"] = true;
dr.EndEdit();
i++;
}
myReceipt.Update(dsReceipt);
myReceipt.ReceiveAllLines(true, dsReceipt);
//myReceipt.CommitRcvDtl(model.VendorNum, "", model.StoreInNum, dsReceipt);
IsSucces = true;
msgError = "";
return IsSucces;
}
#endregion PO no error.
IsSucces = false;
return IsSucces;
}
catch (Exception ex)
{
IsSucces = false;
msgError = ex.Message;
return IsSucces;
}
}
示例2: GetNewRcvDtl
public void GetNewRcvDtl(Epicor.Mfg.Core.Session epiSession, ReceiptDataSet dsReceipt)
{
try
{
Receipt myReceipt = new Receipt(epiSession.ConnectionPool);
//ReceiptDataSet dsReceipt = new ReceiptDataSet();
//myReceipt.GetNewRcvDtl(dsReceipt, model.VendorNum, "", model.StoreInNum);
myReceipt.GetNewRcvDtl(dsReceipt, 5, "", "IN00002-3");
DataRow drReceipt = dsReceipt.Tables[0].Rows[0];
drReceipt.BeginEdit();
drReceipt["VendorNum"] = 5; // model.VendorNum;
drReceipt["PackSlip"] = "IN00002-3";//model.StoreInNum + "-2";
//drReceipt["PackLine"] = 1;
//drReceipt["PartNum"] = DateTime.Now;
drReceipt["WareHouseCode"] = "600";
drReceipt["OurQty"] = 10; // model.Quantity;
drReceipt["PONum"] = 272; // model.PONum;
drReceipt["POLine"] = 1; // model.POLine;
drReceipt["PORelNum"] = 1; // model.POLine;
drReceipt.EndEdit();
myReceipt.Update(dsReceipt);
//IsSucces = true;
//msgError = "";
}
catch (Exception ex)
{
//IsSucces = false;
//msgError = ex.Message;
}
}