public void InsertInfoData(int orderid) { OrderInformationData OdIfData = new OrderInformationData(); OdIfData.DealDate = DateTime.Now.ToString("dd-MM-yyyy"); OdIfData.OrderID = orderid; OdIfData.JobNo = Jobno_textBox.Text; OdIfData.CustomerPONo = Cust_No_textBox.Text; OdIfData.JobName = JobName_textBox.Text; OdIfData.CustomerNo = CustNo_textBox.Text; OdIfData.AAonCont = AAONContact_comboBox.Text; OdIfData.ShopOrderNo = shopOrderNo_textBox.Text; OdIfData.CustCont = CustContact_comboBox.Text; OdIfData.rep1 = rep1_comboBox.Text; OdIfData.rep2 = rep2_comboBox.Text; OdIfData.rep3 = rep3_comboBox.Text; OdIfData.rep4 = rep4_comboBox.Text; OdIfData.MarketCode = market_textBox.Text; OdIfData.SiteAltitude = site_numericUpDown.Value; OdIfData.RepCont = repContact_comboBox.Text; OdIfData.OrderBy = OrderBy_comboBox.Text; OdIfData.SoldName = Name_comboBox.Text; OdIfData.SoldAddress1 = Address1_textBox.Text; OdIfData.SoldAddress2 = Address2_textBox.Text; OdIfData.SoldCity = city_textBox.Text; OdIfData.SoldCountry = country_textBox.Text; OdIfData.SoldState = state_comboBox.Text; OdIfData.SoldZipCode = zipCode_textBox.Text; OdIfData.RepShipDate = shipdate_dateTimePicker.Text; OdIfData.ShipZone = shipZone_textBox.Text; if (HFA_radioButton.Checked == true) { OdIfData.Action = HFA_radioButton.Text; } else { OdIfData.Action = RTP_radioButton.Text; } OdIfData.ShipVia = ShipVIA_comboBox.Text; if (allow_radioButton.Checked == true) { OdIfData.Ship = allow_radioButton.Text; } else if (PPD_radioButton.Checked == true) { OdIfData.Ship = PPD_radioButton.Text; } else { OdIfData.Ship = collect_radioButton.Text; } OdIfData.Notify = notify_textBox.Text; OdIfData.Hours = hours_comboBox.Text; OdIfData.NotifyTel = tel_textBox.Text; OdIfData.ManualEntry = ManEnter_textBox.Text; OdIfData.ShipName = comboBox2.Text; OdIfData.ShipAddress1 = textBox5.Text; OdIfData.ShipAddress2 = textBox4.Text; OdIfData.ShipCity = textBox3.Text; OdIfData.ShipState = comboBox1.Text; OdIfData.ShipCountry = textBox2.Text; OdIfData.ShipZipCode = textBox1.Text; OdIfData.JobDescription = jobDes_textBox.Text; OdIfData.CustNotes = custNote_textBox.Text; OdIfData.RepMult = repMul_textBox.Text; OdIfData.CommissionRep1 = rep1_textBox.Text; OdIfData.CommissionRep2 = rep2_textBox.Text; OdIfData.CommissionRep3 = rep3_textBox.Text; OdIfData.CommissionRep4 = rep4_textBox.Text; OdIfData.MarkUp = markup_textBox.Text; OdIfData.Commission = commission_textBox.Text; OdIfData.OrderTotal = orderTotal_textBox.Text; if (nonTax_radioButton.Checked == true) { OdIfData.IsTaxable = tax_radioButton.Text; } else { OdIfData.IsTaxable = nonTax_radioButton.Text + ID_textBox.Text; } OdIfData.Des1 = Des1_textBox.Text; OdIfData.Des2 = Des2_textBox.Text; OdIfData.Des3 = Des3_textBox.Text; OdIfData.Des4 = Des4_textBox.Text; OdIfData.Amount1 = Amount1_textBox.Text; OdIfData.Amount2 = Amount2_textBox.Text; OdIfData.Amount3 = Amount3_textBox.Text; OdIfData.Amount4 = Amount4_textBox.Text; OrderInformationBLL.InsertInformationData(OdIfData); }
/// <summary> /// 插入订单信息表,根据新的订单ID /// </summary> /// <param name="orderId"></param> /// <param name="orderInformationData"></param> /// <returns></returns> public static int ImportOrderInformation(int orderId,OrderInformationData orderInformationData) { using (var context = new AnnonContext()) { try { var orderInformation = orderInformationData; orderInformation.OrderID = orderId; context.OrderInformationDatas.Add(orderInformation); return context.SaveChanges(); } catch (Exception e) { return -1; } } }
public static int InsertInformationData(OrderInformationData odif) { using (var context = new AnnonContext()) { try { OrderInformationData OdIfData = new OrderInformationData(); OdIfData.OrderID = odif.OrderID; OdIfData.JobNo = odif.JobNo; OdIfData.JobName = odif.JobName; OdIfData.DealDate = odif.DealDate; OdIfData.TotalPrice = odif.TotalPrice; OdIfData.CustomerPONo = odif.CustomerPONo; OdIfData.CustomerNo = odif.CustomerNo; OdIfData.AAonCont = odif.AAonCont; OdIfData.ShopOrderNo = odif.ShopOrderNo; OdIfData.CustCont = odif.CustCont; OdIfData.rep1 = odif.rep1; OdIfData.rep2 = odif.rep2; OdIfData.rep3 = odif.rep3; OdIfData.rep4 = odif.rep4; OdIfData.MarketCode = odif.MarketCode; OdIfData.SiteAltitude = odif.SiteAltitude; OdIfData.RepCont = odif.RepCont; OdIfData.OrderBy = odif.OrderBy; OdIfData.SoldName = odif.SoldName; OdIfData.SoldAddress1 = odif.SoldAddress1; OdIfData.SoldAddress2 = odif.SoldAddress2; OdIfData.SoldCity = odif.SoldCity; OdIfData.SoldCountry = odif.SoldCountry; OdIfData.SoldState = odif.SoldState; OdIfData.SoldZipCode = odif.SoldZipCode; OdIfData.ShipName = odif.ShipName; OdIfData.ShipState = odif.ShipState; OdIfData.ShipVia = odif.ShipVia; OdIfData.ShipZipCode = odif.ShipZipCode; OdIfData.ShipZone = odif.ShipZone; OdIfData.ShopOrderNo = odif.ShopOrderNo; OdIfData.RepShipDate = odif.RepShipDate; OdIfData.ShipZone = odif.ShipZone; OdIfData.Action = odif.Action; OdIfData.Ship = odif.Ship; OdIfData.ShipVia = odif.ShipVia; OdIfData.Notify = odif.Notify; OdIfData.Hours = odif.Hours; OdIfData.NotifyTel = odif.NotifyTel; OdIfData.ManualEntry = odif.ManualEntry; OdIfData.ShipName = odif.ShipName; OdIfData.ShipAddress1 = odif.ShipAddress1; OdIfData.ShipAddress2 = odif.ShipAddress2; OdIfData.ShipCity = odif.ShipCity; OdIfData.ShipCountry = odif.ShipCountry; OdIfData.ShipZipCode = odif.ShipZipCode; OdIfData.JobDescription = odif.JobDescription; OdIfData.CustNotes = odif.CustNotes; OdIfData.RepMult = odif.RepMult; OdIfData.CommissionRep1 = odif.CommissionRep1; OdIfData.CommissionRep2 = odif.CommissionRep2; OdIfData.CommissionRep3 = odif.CommissionRep3; OdIfData.CommissionRep4 = odif.CommissionRep4; OdIfData.MarkUp = odif.MarkUp; OdIfData.Commission = odif.Commission; OdIfData.OrderTotal = odif.OrderTotal; OdIfData.IsTaxable = odif.IsTaxable; OdIfData.IDNo = odif.IDNo; OdIfData.Des1 = odif.Des1; OdIfData.Des2 = odif.Des2; OdIfData.Des3 = odif.Des3; OdIfData.Des4 = odif.Des4; OdIfData.Amount1 = odif.Amount1; OdIfData.Amount2 = odif.Amount2; OdIfData.Amount3 = odif.Amount3; OdIfData.Amount4 = odif.Amount4; context.OrderInformationDatas.Add(OdIfData); return context.SaveChanges(); } catch (Exception e) { return -1; } } }