Пример #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            string sErr = "";

            BUS.LIST_QD_SCHEMAControl ctr = new BUS.LIST_QD_SCHEMAControl();
            DTO.LIST_QD_SCHEMAInfo    inf = new DTO.LIST_QD_SCHEMAInfo();

            if (_processStatus == "C")
            {
                if (!ctr.IsExist(_db, txtCode.Text))
                {
                    ctr.Add(GetDataFromForm(inf), ref sErr);
                }
                else
                {
                    sErr = txtCode.Text.Trim() + " is exist!";
                }
            }
            else if (_processStatus == "A")
            {
                sErr = ctr.InsertUpdate(GetDataFromForm(inf));
            }
            if (sErr == "")
            {
                _processStatus = "V";
                EnableForm(false);
            }
            else
            {
                MessageBox.Show(sErr);
            }
        }
Пример #2
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     BUS.LIST_QD_SCHEMAControl ctr = new BUS.LIST_QD_SCHEMAControl();
     if (ctr.IsExist(_db, txtCode.Text))
     {
         EnableForm(true);
         //ddlQD.Enabled = false;
         txtCode.Enabled = false;
         _processStatus  = "A";
     }
 }
Пример #3
0
 private void btnCopy_Click(object sender, EventArgs e)
 {
     BUS.LIST_QD_SCHEMAControl ctr = new BUS.LIST_QD_SCHEMAControl();
     if (ctr.IsExist(_db, txtCode.Text))
     {
         EnableForm(true);
         txtCode.Focus();
         txtCode.SelectAll();
         //txtCode.Text = "";
         //_code = "";
         _processStatus = "C";
     }
 }
Пример #4
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     BUS.LIST_QD_SCHEMAControl ctr = new BUS.LIST_QD_SCHEMAControl();
     if (ctr.IsExist(_db, txtCode.Text))
     {
         if (MessageBox.Show("Do you want to delete " + txtCode.Text + " schema?", "Message", MessageBoxButtons.OKCancel) == DialogResult.OK)
         {
             string sErr = ctr.Delete(_db, txtCode.Text);
             RefreshForm("");
             EnableForm(false);
         }
     }
 }