Exemple #1
0
 private void ScSKUCD_CodeKeyDownEvent(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (!string.IsNullOrWhiteSpace(ScSKUCD.TxtCode.Text))
         {
             if (!ScSKUCD.SelectData())
             {
                 tnlbl.ShowMessage("E101");
                 ScSKUCD.SetFocus(1);
             }
         }
     }
 }
Exemple #2
0
        private bool ErrorCheck()
        {
            if (!string.IsNullOrWhiteSpace(txtStartDate.Text))
            {
                DateTime dt1 = Convert.ToDateTime(txtStartDate.Text);
                DateTime dt2 = Convert.ToDateTime(txtEndDate.Text);

                if (dt1 > dt2)
                {
                    tnlbl.ShowMessage("E104");
                    txtEndDate.Focus();
                    return(false);
                }
            }
            if (!RequireCheck(new Control[] { txtEndDate, cboSouko }))
            {
                return(false);
            }
            if (!cboSouko.IsExists(cboSouko.SelectedValue.ToString(), "Souko"))
            {
                tnlbl.ShowMessage("E128");
                txtStartDate.Focus();
                return(false);
            }
            if (chkRegistered.Checked == false && chkUnregistered.Checked == false)
            {
                tnlbl.ShowMessage("E111");
                txtStartDate.Focus();
                return(false);
            }
            if (!string.IsNullOrWhiteSpace(ScSKUCD.Code) && !ScSKUCD.IsExists(2))
            {
                tnlbl.ShowMessage("E101");
                ScSKUCD.SetFocus(1);
                return(false);
            }
            return(true);
        }
Exemple #3
0
        private bool ErrorCheck()
        {
            if (cboWarehouse.SelectedValue.ToString() == "-1")
            {
                nkskbl.ShowMessage("E102");
                cboWarehouse.Focus();
                return(false);
            }
            else
            {
                mse.DeleteFlg = "0";
                DataTable dtsouko = new DataTable();
                dtsouko = nkskbl.D_Souko_Select(mse);
                if (dtsouko.Rows.Count == 0)
                {
                    nkskbl.ShowMessage("E128");
                    cboWarehouse.Focus();
                    return(false);
                }
            }

            if (!string.IsNullOrWhiteSpace(txtArrivalDay2.Text))
            {
                int result = txtArrivalDay1.Text.CompareTo(txtArrivalDay2.Text);
                if (result > 0)
                {
                    nkskbl.ShowMessage("E104");
                    txtArrivalDay2.Focus();
                    return(false);
                }
            }

            if (!string.IsNullOrWhiteSpace(txtStockDate2.Text))
            {
                int stock = txtStockDate1.Text.CompareTo(txtStockDate2.Text);
                if (stock > 0)
                {
                    nkskbl.ShowMessage("E104");
                    txtArrivalDay2.Focus();
                    return(false);
                }
            }

            if (!statusChk1.Checked && !statusChk2.Checked)
            {
                nkskbl.ShowMessage("E111");
                statusChk1.Focus();
                return(false);
            }


            if (!string.IsNullOrWhiteSpace(txtPurchaseDate2.Text))
            {
                int purchase = txtPurchaseDate1.Text.CompareTo(txtPurchaseDate2.Text);
                if (purchase > 0)
                {
                    nkskbl.ShowMessage("E104");
                    txtPurchaseDate2.Focus();
                    return(false);
                }
            }

            if (string.IsNullOrWhiteSpace(txtArrivalDay1.Text) || (string.IsNullOrWhiteSpace(txtArrivalDay2.Text)))
            {
                if (string.IsNullOrWhiteSpace(txtStockDate1.Text) || (string.IsNullOrWhiteSpace(txtStockDate2.Text)))
                {
                    if (string.IsNullOrWhiteSpace(txtPurchaseDate1.Text) || (string.IsNullOrWhiteSpace(txtPurchaseDate2.Text)))
                    {
                        nkskbl.ShowMessage("E188");
                        txtPurchaseDate2.Focus();
                        return(false);
                    }
                }
            }

            if (!chkDelivery.Checked && !ChkArrival.Checked)
            {
                nkskbl.ShowMessage("E111");
                chkDelivery.Focus();
                return(false);
            }

            if (!string.IsNullOrEmpty(ScSupplier.TxtCode.Text))
            {
                mve.VendorCD = ScSupplier.TxtCode.Text;
                if (string.IsNullOrWhiteSpace(txtArrivalDay2.Text))
                {
                    mve.ChangeDate = DateTime.Today.ToShortDateString();
                }
                else
                {
                    mve.ChangeDate = txtArrivalDay2.Text;
                }
                DataTable dtsupplier = new DataTable();
                dtsupplier = nkskbl.M_Vendor_DataSelect(mve);
                if (dtsupplier.Rows.Count > 0)
                {
                    ScSupplier.LabelText = dtsupplier.Rows[0]["VendorName"].ToString();
                }
                else
                {
                    nkskbl.ShowMessage("E101");
                    ScSupplier.SetFocus(1);
                    return(false);
                }
            }

            if (!string.IsNullOrWhiteSpace(ScItem.TxtCode.Text))
            {
                if (ScItem.TxtCode.Text.Contains(","))
                {
                    string   a   = ScItem.TxtCode.Text;
                    string[] arr = a.Split(',');
                    for (int i = 1; i < arr.Length; i++)
                    {
                        if (i >= 7)
                        {
                            nkskbl.ShowMessage("E187");
                            ScItem.SetFocus(1);
                            return(false);
                        }
                    }
                }
            }

            if (!string.IsNullOrWhiteSpace(ScSKUCD.TxtCode.Text))
            {
                if (ScSKUCD.TxtCode.Text.Contains(","))
                {
                    string   a   = ScSKUCD.TxtCode.Text;
                    string[] arr = a.Split(',');
                    for (int i = 1; i < arr.Length; i++)
                    {
                        if (i >= 7)
                        {
                            nkskbl.ShowMessage("E187");
                            ScSKUCD.SetFocus(1);
                            return(false);
                        }
                        //else
                        //{
                        //    ScSKUCD.TxtCode.Text = "'";
                        //}
                    }
                }
            }

            if (!string.IsNullOrWhiteSpace(ScJanCD.TxtCode.Text))
            {
                if (ScJanCD.TxtCode.Text.Contains(","))
                {
                    string   a   = ScJanCD.TxtCode.Text;
                    string[] arr = a.Split(',');
                    for (int i = 1; i < arr.Length; i++)
                    {
                        if (i >= 13)
                        {
                            nkskbl.ShowMessage("E187");
                            ScJanCD.SetFocus(1);
                            return(false);
                        }
                    }
                }
            }

            //if(cboSourceWH.SelectedValue.ToString () == "-1")
            //{
            //    cboSourceWH.SelectedValue = string.Empty;
            //}

            return(true);
        }