コード例 #1
0
 public string Create(Edi_SalesItem instance)
 {
     if (instance == null)
     {
         throw new ArgumentNullException();
     }
     return(this._repository.Create(instance));
 }
コード例 #2
0
 public void Update(Edi_SalesItem instance)
 {
     if (instance == null)
     {
         throw new ArgumentNullException();
     }
     this._repository.Update(instance);
 }
コード例 #3
0
        /// <summary>
        /// insert 850 table
        /// Edi_SalesHeader/Edi_SalesItem/Edi_SalesPartner/Edi_SalesSchedule
        /// Is_Proc:V success F fail
        /// CreateBy:Edi/Web
        /// </summary>
        /// <param name="sapSalesOrder"></param>
        /// <param name="orderNumber"></param>
        public void InsertSapSalesOrder(SapSalesOrder sapSalesOrder, string orderNumber)
        {
            Edi_SalesHeader _Edi_SalesHeader = new Edi_SalesHeader();

            _Edi_SalesHeader.DOC_TYPE    = sapSalesOrder.Header.DOC_TYPE;
            _Edi_SalesHeader.SALES_ORG   = sapSalesOrder.Header.SALES_ORG;
            _Edi_SalesHeader.DISTR_CHAN  = sapSalesOrder.Header.DISTR_CHAN;
            _Edi_SalesHeader.DIVISION    = sapSalesOrder.Header.DIVISION;
            _Edi_SalesHeader.PURCH_NO_C  = sapSalesOrder.Header.PURCH_NO_C;
            _Edi_SalesHeader.PURCH_DATE  = sapSalesOrder.Header.PURCH_DATE;
            _Edi_SalesHeader.Is_Proc     = orderNumber != "" ? "V" : "F";
            _Edi_SalesHeader.DateTime    = DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss:");
            _Edi_SalesHeader.OrderNumber = orderNumber;
            _Edi_SalesHeader.CreateBy    = sapSalesOrder.CreateBy;
            this._edi_SalesHeaderService.Create(_Edi_SalesHeader);
            foreach (SalesItem si in sapSalesOrder.ItemList)
            {
                Edi_SalesItem _Edi_SalesItem = new Edi_SalesItem();
                _Edi_SalesItem.OrderNumber         = orderNumber;
                _Edi_SalesItem.ITM_NUMBER          = si.ITM_NUMBER;
                _Edi_SalesItem.MATERIAL            = si.MATERIAL;
                _Edi_SalesItem.CUST_MAT35          = si.CUST_MAT35;
                _Edi_SalesItem.CustomerItemNumber  = si.CustomerItemNumber;
                _Edi_SalesItem.CustomerUnit        = si.CustomerUnit;
                _Edi_SalesItem.CustomerPrice       = si.CustomerPrice;
                _Edi_SalesItem.DateTime            = DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss");
                _Edi_SalesItem.CustomerUnitOfPrice = si.CustomerUnitOfPrice;
                this._edi_SalesItemService.Create(_Edi_SalesItem);
            }
            foreach (SalesSchedule ss in sapSalesOrder.ScheduleList)
            {
                Edi_SalesSchedule _Edi_SalesSchedule = new Edi_SalesSchedule();
                _Edi_SalesSchedule.OrderNumber = orderNumber;
                _Edi_SalesSchedule.ITM_NUMBER  = ss.ITM_NUMBER;
                _Edi_SalesSchedule.REQ_DATE    = ss.REQ_DATE;
                _Edi_SalesSchedule.SCHED_LINE  = ss.SCHED_LINE;
                _Edi_SalesSchedule.DateTime    = DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss");
                _Edi_SalesSchedule.REQ_QTY     = ss.REQ_QTY;
                this._edi_SalesScheduleService.Create(_Edi_SalesSchedule);
            }
            foreach (SalesPartner sp in sapSalesOrder.PartnerList)
            {
                Edi_SalesPartner _Edi_SalesPartner = new Edi_SalesPartner();
                _Edi_SalesPartner.OrderNumber = orderNumber;
                _Edi_SalesPartner.PARTN_ROLE  = sp.PARTN_ROLE;
                _Edi_SalesPartner.PARTN_NUMB  = sp.PARTN_NUMB;
                _Edi_SalesPartner.STREET      = sp.STREET;
                _Edi_SalesPartner.CITY        = sp.CITY;
                _Edi_SalesPartner.REGION      = sp.REGION;
                _Edi_SalesPartner.POSTL_CODE  = sp.POSTL_CODE;
                _Edi_SalesPartner.COUNTRY     = sp.COUNTRY;
                _Edi_SalesPartner.NAME        = sp.NAME;
                _Edi_SalesPartner.DateTime    = DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss");
                _Edi_SalesPartner.TELEPHONE   = sp.TELEPHONE;
                this._edi_SalesPartnerService.Create(_Edi_SalesPartner);
            }
        }