Beispiel #1
0
 private void SC_Order_CodeKeyDownEvent(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (!string.IsNullOrWhiteSpace(SC_Order.TxtCode.Text))
         {
             dje.JuchuuNO = SC_Order.TxtCode.Text;
             DataTable dtJuChuu = new DataTable();
             dtJuChuu = skskbl.D_Juchuu_DataSelect_ForShukkaShoukai(dje);
             if (dtJuChuu.Rows.Count == 0)
             {
                 skskbl.ShowMessage("E138");
                 SC_Order.Focus();
             }
             else
             {
                 if (!string.IsNullOrWhiteSpace(dtJuChuu.Rows[0]["DeleteDateTime"].ToString()))
                 {
                     skskbl.ShowMessage("E140");
                     SC_Order.Focus();
                 }
                 else
                 {
                     msae.StoreCD = dtJuChuu.Rows[0]["StoreCD"].ToString();
                     msae.StoreAuthorizationsCD = StoreAuthorizationsCD;
                     msae.ChangeDate            = StoreAuthorizationsChangeDate;
                     //msae.ProgramID = "0";
                     DataTable dtAuthorization = new DataTable();
                     dtAuthorization = skskbl.M_StoreAuthorizations_Select(msae);
                     if (dtAuthorization.Rows.Count == 0)
                     {
                         skskbl.ShowMessage("E139");
                         SC_Order.Focus();
                     }
                 }
             }
         }
         cboDestinationWarehouse.Focus();
     }
 }
Beispiel #2
0
        public bool ErrorCheck()
        {
            if (cboWarehouse.SelectedValue.ToString() == "-1")
            {
                skskbl.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(txtShippingEndDate.Text))
            {
                int result = txtShippingStartDate.Text.CompareTo(txtShippingEndDate.Text);
                if (result > 0)
                {
                    skskbl.ShowMessage("E104");
                    txtShippingEndDate.Focus();
                    return(false);
                }
            }

            if (!chkShipmentOfSale.Checked && !chkShipmentOfTransfer.Checked)
            {
                skskbl.ShowMessage("E111");
                chkShipmentOfSale.Focus();
                return(false);
            }

            if (!string.IsNullOrWhiteSpace(SC_Order.TxtCode.Text))
            {
                dje.JuchuuNO = SC_Order.TxtCode.Text;
                DataTable dtJuChuu = new DataTable();
                dtJuChuu = skskbl.D_Juchuu_DataSelect_ForShukkaShoukai(dje);
                if (dtJuChuu.Rows.Count == 0)
                {
                    skskbl.ShowMessage("E138");
                    SC_Order.Focus();
                    return(false);
                }
                else
                {
                    if (!string.IsNullOrWhiteSpace(dtJuChuu.Rows[0]["DeleteDateTime"].ToString()))
                    {
                        skskbl.ShowMessage("E140");
                        SC_Order.Focus();
                        return(false);
                    }
                    else
                    {
                        msae.StoreCD = dtJuChuu.Rows[0]["StoreCD"].ToString();
                        msae.StoreAuthorizationsCD = StoreAuthorizationsCD;
                        msae.ChangeDate            = StoreAuthorizationsChangeDate;
                        //msae.ProgramID = "0";
                        DataTable dtAuthorization = new DataTable();
                        dtAuthorization = skskbl.M_StoreAuthorizations_Select(msae);
                        if (dtAuthorization.Rows.Count == 0)
                        {
                            skskbl.ShowMessage("E139");
                            SC_Order.Focus();
                            return(false);
                        }
                    }
                }
            }


            if (!chkAlready.Checked && !chkNot.Checked)
            {
                skskbl.ShowMessage("E111");
                chkAlready.Focus();
                return(false);
            }

            if (!string.IsNullOrWhiteSpace(Sc_Item.TxtCode.Text))
            {
                if (Sc_Item.TxtCode.Text.Contains(","))
                {
                    string   a   = Sc_Item.TxtCode.Text;
                    string[] arr = a.Split(',');
                    if (arr.Length >= 10)
                    {
                        skskbl.ShowMessage("E187");
                        Sc_Item.SetFocus(1);
                        return(false);
                    }
                }
            }

            if (!string.IsNullOrWhiteSpace(Sc_SKUCD.TxtCode.Text))
            {
                if (Sc_SKUCD.TxtCode.Text.Contains(","))
                {
                    string   a   = Sc_SKUCD.TxtCode.Text;
                    string[] arr = a.Split(',');
                    if (arr.Length >= 10)
                    {
                        skskbl.ShowMessage("E187");
                        Sc_SKUCD.SetFocus(1);
                        return(false);
                    }
                }
            }

            if (!string.IsNullOrWhiteSpace(SC_JanCD.TxtCode.Text))
            {
                if (SC_JanCD.TxtCode.Text.Contains(","))
                {
                    string   a   = SC_JanCD.TxtCode.Text;
                    string[] arr = a.Split(',');
                    if (arr.Length >= 10)
                    {
                        skskbl.ShowMessage("E187");
                        SC_JanCD.SetFocus(1);
                        return(false);
                    }
                }
            }
            return(true);
        }