コード例 #1
0
ファイル: OfferItems.cs プロジェクト: windygu/ERP-1
        public bool CheckItems()
        {
            if (!ItemsCheck.CheckTextBoxEmpty(tbMpn))
            {
                MessageBox.Show("Please input the MPN.");
                return(false);
            }

            if (ItemsCheck.CheckTextBoxEmpty(tbMfg) == false)
            {
                MessageBox.Show("Please input the MFG.");
                return(false);
            }

            if (ItemsCheck.CheckTextBoxEmpty(tbVendorName) == false)
            {
                MessageBox.Show("Please input the Vendor Name.");
                return(false);
            }
            if (ItemsCheck.CheckTextBoxEmpty(tbContact) == false)
            {
                MessageBox.Show("Please input the Contact name.");
                return(false);
            }
            if (ItemsCheck.CheckTextBoxEmpty(tbPhone) == false)
            {
                MessageBox.Show("Please input the Phone number.");
                return(false);
            }
            if (ItemsCheck.CheckTextBoxEmpty(tbQuantity) == false)
            {
                MessageBox.Show("Please input the Quantity.");
                return(false);
            }
            else
            {
                if (false == ItemsCheck.CheckIntNumber(tbQuantity))
                {
                    MessageBox.Show("The Quantity should be an integer value");
                    return(false);
                }
            }

            if (ItemsCheck.CheckTextBoxEmpty(tbPrice) == false)
            {
                MessageBox.Show("Please input the Price.");
                return(false);
            }
            else
            {
                if (false == ItemsCheck.CheckFloatNumber(tbPrice))
                {
                    MessageBox.Show("The Price should be a float value");
                    return(false);
                }
            }
            return(true);
        }
コード例 #2
0
        public bool CheckValues()
        {
            if (ItemsCheck.CheckTextBoxEmpty(tbPartNo) == false)
            {
                MessageBox.Show("Please input the Part number.");
                return(false);
            }
            if (ItemsCheck.CheckTextBoxEmpty(tbMfg) == false)
            {
                MessageBox.Show("Please input the MFG.");
                return(false);
            }
            if (ItemsCheck.CheckTextBoxEmpty(tbDc) == false)
            {
                MessageBox.Show("Please input the D/C.");
                return(false);
            }

            if (!ItemsCheck.CheckTextBoxEmpty(tbQty))
            {
                MessageBox.Show("Please input the Qty value.");
                tbQty.Focus();
                return(false);
            }


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


            if (ItemsCheck.CheckTextBoxEmpty(tbQtyShipped) && !ItemsCheck.CheckIntNumber(tbQtyShipped))
            {
                MessageBox.Show("The Qty Shipped should be an integer value.");
                tbQtyShipped.Focus();
                return(false);
            }

            if (!ItemsCheck.CheckTextBoxEmpty(tbUnitPrice))
            {
                MessageBox.Show("Please input the Unit Price.");
                tbUnitPrice.Focus();
                return(false);
            }


            if (!ItemsCheck.CheckFloatNumber(tbUnitPrice))
            {
                MessageBox.Show("The Unit Price should be a float value.");
                tbUnitPrice.Focus();
                return(false);
            }

            return(true);
        }
コード例 #3
0
ファイル: BomOfferNew.cs プロジェクト: windygu/ERP-1
        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();
        }
コード例 #4
0
 private bool CheckValues()
 {
     if (ItemsCheck.CheckTextBoxEmpty(tbVendor) == false)
     {
         MessageBox.Show("Please input the Vendor name");
         return(false);
     }
     if (ItemsCheck.CheckTextBoxEmpty(tbContact) == false)
     {
         MessageBox.Show("Please input the Contact name");
         return(false);
     }
     return(true);
 }
コード例 #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!ItemsCheck.CheckTextBoxEmpty(tbCustomer))
            {
                MessageBox.Show("Please input the Customer Name");
                return;
            }

            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;
                }
            }

            string sql = string.Format("insert into matchBom(customer,mfg,mpn,qty,price,cpn,buyer,bomOwner,bomdate) values('{0}','{1}','{2}',{3},{4},'{5}','{6}',{7},'{8}')", tbCustomer.Text.Trim(),
                                       tbMfg.Text.Trim(), tbMpn.Text.Trim(), tbQty.Text.Trim(), tbPrice.Text.Trim(), tbCpn.Text.Trim(), tbBuyer.Text.Trim(), UserInfo.UserId, DateTime.Now.ToString());

            db.ExecDataBySql(sql);

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
コード例 #6
0
        public bool ValidateValues()
        {
            if (!ItemsCheck.CheckTextBoxEmpty(tbName))
            {
                if (cvtype == 0)
                {
                    MessageBox.Show("Please input the Customer Name");
                }
                if (cvtype == 1)
                {
                    MessageBox.Show("Please input the Vendor Name");
                }
                return(false);
            }
            if (ItemsCheck.CheckTextBoxEmpty(tbRating))
            {
                if (!ItemsCheck.CheckIntNumber(tbRating))
                {
                    MessageBox.Show("The Rating Should be an Integer Value (0-100).");
                    tbRating.Focus();
                    return(false);
                }
                if (Convert.ToInt32(tbRating.Text.Trim()) > 100 || Convert.ToInt32(tbRating.Text.Trim()) < 0)
                {
                    MessageBox.Show("The Rating should be 0-100");
                    tbRating.Focus();
                    return(false);
                }
            }
            if (ItemsCheck.CheckTextBoxEmpty(tbAmount) && (!ItemsCheck.CheckIntNumber(tbAmount)))
            {
                MessageBox.Show("The Amount should be an Integer Value.");
                tbAmount.Focus();
                return(false);
            }

            return(true);
        }
コード例 #7
0
        private void btOK_Click(object sender, EventArgs e)
        {
            if (!ItemsCheck.CheckTextBoxEmpty(tbMpn))
            {
                MessageBox.Show("Please input the MPN");
                return;
            }

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

            if (ItemsCheck.CheckTextBoxEmpty(tbResale) && !ItemsCheck.CheckFloatNumber(tbResale))
            {
                MessageBox.Show("The Resale should be a float number");
                tbResale.Focus();
                return;
            }
            if (ItemsCheck.CheckTextBoxEmpty(tbCost) && !ItemsCheck.CheckFloatNumber(tbCost))
            {
                MessageBox.Show("The Cost should be a float number");
                tbCost.Focus();
                return;
            }
            string sql;

            if (isNewStockItem)
            {
                sql = string.Format("insert into ambleStock(mpn,mfg,dc,qty,resale,cost,packing,contact,statu,notes,stockDate) values ('{0}','{1}','{2}',{3},{4},{5},'{6}','{7}','{8}','{9}','{10}')",
                                    tbMpn.Text.Trim(), tbMfg.Text.Trim(), tbDc.Text.Trim(),
                                    string.IsNullOrWhiteSpace(tbQty.Text.Trim()) ? "null" : tbQty.Text.Trim(),
                                    string.IsNullOrWhiteSpace(tbResale.Text.Trim()) ? "null" : tbResale.Text.Trim(),
                                    string.IsNullOrWhiteSpace(tbCost.Text.Trim()) ? "null" : tbCost.Text.Trim(),
                                    tbPacking.Text.Trim(),
                                    tbContact.Text.Trim(),
                                    cbStatus.Text.Trim(),
                                    tbNotes.Text.Trim(),
                                    tbDate.Text.Trim()
                                    );
            }
            else
            {
                sql = string.Format("update amblestock set mpn='{0}',mfg='{1}',dc='{2}',qty={3},resale={4},cost={5},packing='{6}',contact='{7}',statu='{8}',notes='{9}',stockDate='{10}' where stockId={11}",
                                    tbMpn.Text.Trim(), tbMfg.Text.Trim(), tbDc.Text.Trim(),
                                    string.IsNullOrWhiteSpace(tbQty.Text.Trim()) ? "null" : tbQty.Text.Trim(),
                                    string.IsNullOrWhiteSpace(tbResale.Text.Trim()) ? "null" : tbResale.Text.Trim(),
                                    string.IsNullOrWhiteSpace(tbCost.Text.Trim()) ? "null" : tbCost.Text.Trim(),
                                    tbPacking.Text.Trim(),
                                    tbContact.Text.Trim(),
                                    cbStatus.Text.Trim(),
                                    tbNotes.Text.Trim(),
                                    tbDate.Text.Trim(),
                                    this.stockId
                                    );
            }

            db.ExecDataBySql(sql);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
コード例 #8
0
ファイル: PoItemsControl.cs プロジェクト: hnjm/AmbleSystem
        public bool CheckValues()
        {
            if (ItemsCheck.CheckTextBoxEmpty(tbPartNo) == false)
            {
                MessageBox.Show("Please input the Part Number.");
                return(false);
            }

            if (!ItemsCheck.CheckTextBoxEmpty(tbMfg))
            {
                MessageBox.Show("Please input the MFG.");
                return(false);
            }

            if (!ItemsCheck.CheckTextBoxEmpty(tbDc))
            {
                MessageBox.Show("Please input the D/C.");
                return(false);
            }

            if (!ItemsCheck.CheckTextBoxEmpty(tbQty))
            {
                MessageBox.Show("Please input the Qty.");
                return(false);
            }
            else
            {
                if (!ItemsCheck.CheckIntNumber(tbQty))
                {
                    MessageBox.Show("The Qty should be an integer value.");
                    tbQty.Focus();
                    return(false);
                }
            }

            if (ItemsCheck.CheckIntNumber(tbQtyRevd) && (!ItemsCheck.CheckIntNumber(tbQtyRevd)))
            {
                MessageBox.Show("The Qty Recv should be an integer value.");
                tbQtyRevd.Focus();
                return(false);
            }
            if (ItemsCheck.CheckIntNumber(tbQtyCorrected) && (!ItemsCheck.CheckIntNumber(tbQtyCorrected)))
            {
                MessageBox.Show("The Qty Corrected should be an integer value.");
                tbQtyCorrected.Focus();
                return(false);
            }
            if (ItemsCheck.CheckIntNumber(tbQtyAccept) && (!ItemsCheck.CheckIntNumber(tbQtyAccept)))
            {
                MessageBox.Show("The Qty Accept should be an integer value.");
                tbQtyAccept.Focus();
                return(false);
            }
            if (ItemsCheck.CheckIntNumber(tbQtyRejected) && (!ItemsCheck.CheckIntNumber(tbQtyRejected)))
            {
                MessageBox.Show("The Qty Rejected should be an integer value.");
                tbQtyRejected.Focus();
                return(false);
            }
            if (ItemsCheck.CheckIntNumber(tbQtyRtv) && (!ItemsCheck.CheckIntNumber(tbQtyRtv)))
            {
                MessageBox.Show("The Qty RTV should be an integer value.");
                tbQtyRtv.Focus();
                return(false);
            }
            if (ItemsCheck.CheckIntNumber(tbQcPending) && (!ItemsCheck.CheckIntNumber(tbQcPending)))
            {
                MessageBox.Show("The QC/Pending should be an integer value.");
                tbQcPending.Focus();
                return(false);
            }

            if (!ItemsCheck.CheckTextBoxEmpty(tbUnitPrice))
            {
                MessageBox.Show("Please input the Unit Price.");
                tbUnitPrice.Focus();
                return(false);
            }

            if (!ItemsCheck.CheckFloatNumber(tbUnitPrice))
            {
                MessageBox.Show("The Unit Price should be a float value.");
                tbUnitPrice.Focus();
                return(false);
            }

            return(true);
        }