Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!ItemsCheck.CheckTextBoxEmpty(tbMfg))
            {
                MessageBox.Show("Please input the MFG");
                return;
            }

            if (!ItemsCheck.CheckTextBoxEmpty(tbMpn))
            {
                MessageBox.Show("Please input the MPN");
                return;
            }

            if (!ItemsCheck.CheckIntNumber(tbQty))
            {
                MessageBox.Show("The QTY should be an integer value");
                tbQty.Focus();
                return;
            }

            if (!ItemsCheck.CheckTextBoxEmpty(tbPrice))
            {
                MessageBox.Show("Please input the Price");
                return;
            }
            else
            {
                if (!ItemsCheck.CheckFloatNumber(tbPrice))
                {
                    MessageBox.Show("The Price should be a float number");
                    tbPrice.Focus();
                    return;
                }
            }



            var publicBomOff = new publicbomoffer
            {
                mfg           = tbMfg.Text.Trim(),
                mpn           = tbMpn.Text.Trim(),
                qty           = int.Parse(tbQty.Text.Trim()),
                price         = float.Parse(tbPrice.Text.Trim()),
                cpn           = tbCpn.Text.Trim(),
                userID        = (short)UserInfo.UserId,
                BomCustVendId = this.custVenId,
                enerDay       = DateTime.Now
            };

            using (BomOfferEntities entity = new BomOfferEntities())
            {
                entity.publicbomoffer.AddObject(publicBomOff);
                entity.SaveChanges();
            }
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Example #2
0
        /// <summary>
        /// 创建新的 publicbomoffer 对象。
        /// </summary>
        /// <param name="bomOfferId">bomOfferId 属性的初始值。</param>
        /// <param name="bomCustVendId">BomCustVendId 属性的初始值。</param>
        /// <param name="userID">userID 属性的初始值。</param>
        public static publicbomoffer Createpublicbomoffer(global::System.Int32 bomOfferId, global::System.Int32 bomCustVendId, global::System.Int16 userID)
        {
            publicbomoffer publicbomoffer = new publicbomoffer();

            publicbomoffer.bomOfferId    = bomOfferId;
            publicbomoffer.BomCustVendId = bomCustVendId;
            publicbomoffer.userID        = userID;
            return(publicbomoffer);
        }
Example #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!ItemsCheck.CheckTextBoxEmpty(tbMfg))
            {
                MessageBox.Show("Please input the MFG");
                return;

            }

            if (!ItemsCheck.CheckTextBoxEmpty(tbMpn))
            {
                MessageBox.Show("Please input the MPN");
                return;
            }

            if (!ItemsCheck.CheckIntNumber(tbQty))
            {
                MessageBox.Show("The QTY should be an integer value");
                tbQty.Focus();
                return;
            }

            if (!ItemsCheck.CheckTextBoxEmpty(tbPrice))
            {
                MessageBox.Show("Please input the Price");
                return;

            }
            else
            {
                if (!ItemsCheck.CheckFloatNumber(tbPrice))
                {
                    MessageBox.Show("The Price should be a float number");
                    tbPrice.Focus();
                    return;

                }
            }

            var publicBomOff = new publicbomoffer
            {
                mfg = tbMfg.Text.Trim().ToUpper(),
                mpn = tbMpn.Text.Trim().ToUpper(), //upper
                qty = int.Parse(tbQty.Text.Trim()),
                price = float.Parse(tbPrice.Text.Trim()),
                cpn = tbCpn.Text.Trim().ToUpper(),
                userID = (short)UserInfo.UserId,
                BomCustVendId=this.custVenId,
                enerDay = DateTime.Now
            };
            using (BomOfferEntities entity = new BomOfferEntities())
            {
                entity.publicbomoffer.AddObject(publicBomOff);
                entity.SaveChanges();
            }
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Example #4
0
 /// <summary>
 /// 用于向 publicbomoffer EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddTopublicbomoffer(publicbomoffer publicbomoffer)
 {
     base.AddObject("publicbomoffer", publicbomoffer);
 }
Example #5
0
 /// <summary>
 /// 创建新的 publicbomoffer 对象。
 /// </summary>
 /// <param name="bomOfferId">bomOfferId 属性的初始值。</param>
 /// <param name="bomCustVendId">BomCustVendId 属性的初始值。</param>
 /// <param name="userID">userID 属性的初始值。</param>
 public static publicbomoffer Createpublicbomoffer(global::System.Int32 bomOfferId, global::System.Int32 bomCustVendId, global::System.Int16 userID)
 {
     publicbomoffer publicbomoffer = new publicbomoffer();
     publicbomoffer.bomOfferId = bomOfferId;
     publicbomoffer.BomCustVendId = bomCustVendId;
     publicbomoffer.userID = userID;
     return publicbomoffer;
 }
Example #6
0
 /// <summary>
 /// 用于向 publicbomoffer EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddTopublicbomoffer(publicbomoffer publicbomoffer)
 {
     base.AddObject("publicbomoffer", publicbomoffer);
 }