当前位置: 首页>>代码示例>>C#>>正文


C# Receipt.CreateMassReceipts方法代码示例

本文整理汇总了C#中Receipt.CreateMassReceipts方法的典型用法代码示例。如果您正苦于以下问题:C# Receipt.CreateMassReceipts方法的具体用法?C# Receipt.CreateMassReceipts怎么用?C# Receipt.CreateMassReceipts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Receipt的用法示例。


在下文中一共展示了Receipt.CreateMassReceipts方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
            }
        }
开发者ID:swankham,项目名称:Epicoil,代码行数:100,代码来源:StoreInRepo.cs


注:本文中的Receipt.CreateMassReceipts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。