コード例 #1
0
 private void txtJanCD_KeyDown(object sender, KeyEventArgs e)
 {
     zaikobl = new TempoRegiZaikoKakunin_BL();
     if (e.KeyCode == Keys.Enter)
     {
         if (!string.IsNullOrWhiteSpace(txtJanCD.Text))
         {
             DataTable dtSKU = SelectSKUData(txtJanCD.Text);
             if (dtSKU.Rows.Count > 0)
             {
                 if (dtSKU.Rows.Count == 1)
                 {
                     txtJanCD.Text        = dtSKU.Rows[0]["JanCD"].ToString();
                     lblItemName.Text     = dtSKU.Rows[0]["SKUName"].ToString();
                     lblColorSize.Text    = dtSKU.Rows[0]["ColorName"].ToString() + " . " + dtSKU.Rows[0]["SizeName"].ToString();
                     lblColorSize.Visible = true;
                     lblItemName.Visible  = true;
                 }
                 else
                 {
                     frmSearch_SKU frmsku = new frmSearch_SKU(txtJanCD.Text, dtSKU);
                     frmsku.ShowDialog();
                     if (!frmsku.flgCancel)
                     {
                         lblItemName.Text     = frmsku.SKUName;
                         lblColorSize.Text    = frmsku.SizeColorName;
                         lblColorSize.Visible = true;
                         lblItemName.Visible  = true;
                     }
                 }
                 SelectData();
             }
             else
             {
                 zaikobl.ShowMessage("E101");
                 txtJanCD.Focus();
             }
         }
         else
         {
             zaikobl.ShowMessage("E102");
             lblItemName.Text  = string.Empty;
             lblColorSize.Text = string.Empty;
             txtJanCD.Focus();
         }
     }
 }
コード例 #2
0
        public bool ErrorCheck()
        {
            if (string.IsNullOrWhiteSpace(txtJanCD.Text))
            {
                zaikobl.ShowMessage("E102");
                txtJanCD.Focus();
                return(false);
            }
            //else
            //{
            //    kne.JanCD = txtJanCD.Text;
            //    DataTable dtname = new DataTable();

            //}

            return(true);
        }