private void button1_Click(object sender, EventArgs e) { if (tbCustVenName.Text.Length == 0) { MessageBox.Show("Please input the Customer/Vendor Name"); } var publicCustVen = new publiccustven { custVenName=tbCustVenName.Text.Trim(), custVendorType=(sbyte)(bomOfferType), contact=tbContact.Text.Trim(), tel=tbTel.Text.Trim(), email=tbEmail.Text.Trim(), userID=(short)UserInfo.UserId, enterDay=DateTime.Now }; using (BomOfferEntities entity = new BomOfferEntities()) { entity.publiccustven.AddObject(publicCustVen); entity.SaveChanges(); } this.DialogResult = DialogResult.OK; this.Close(); }
private void button1_Click(object sender, EventArgs e) { if (tbCustVenName.Text.Length == 0) { MessageBox.Show("Please input the Customer/Vendor Name"); } var publicCustVen = new publiccustven { custVenName = tbCustVenName.Text.Trim(), custVendorType = (sbyte)(isOffer?1:0), contact = tbContact.Text.Trim(), tel = tbTel.Text.Trim(), email = tbEmail.Text.Trim(), userID = (short)UserInfo.UserId, enterDay = DateTime.Now }; using (BomOfferEntities entity = new BomOfferEntities()) { entity.publiccustven.AddObject(publicCustVen); entity.SaveChanges(); } this.DialogResult = DialogResult.OK; this.Close(); }
/// <summary> /// 创建新的 publiccustven 对象。 /// </summary> /// <param name="custVenId">custVenId 属性的初始值。</param> /// <param name="custVenName">custVenName 属性的初始值。</param> /// <param name="userID">userID 属性的初始值。</param> public static publiccustven Createpubliccustven(global::System.Int32 custVenId, global::System.String custVenName, global::System.Int16 userID) { publiccustven publiccustven = new publiccustven(); publiccustven.custVenId = custVenId; publiccustven.custVenName = custVenName; publiccustven.userID = userID; return(publiccustven); }
/// <summary> /// 用于向 publiccustven EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet<T> 属性的 .Add 方法。 /// </summary> public void AddTopubliccustven(publiccustven publiccustven) { base.AddObject("publiccustven", publiccustven); }
/// <summary> /// 创建新的 publiccustven 对象。 /// </summary> /// <param name="custVenId">custVenId 属性的初始值。</param> /// <param name="custVenName">custVenName 属性的初始值。</param> /// <param name="userID">userID 属性的初始值。</param> public static publiccustven Createpubliccustven(global::System.Int32 custVenId, global::System.String custVenName, global::System.Int16 userID) { publiccustven publiccustven = new publiccustven(); publiccustven.custVenId = custVenId; publiccustven.custVenName = custVenName; publiccustven.userID = userID; return publiccustven; }