Пример #1
0
 private void btnSaveNew_Click(object sender, EventArgs e)
 {
     if (SaveData())
     {
         knifeSharpeningModel = new KnifeSharpeningDetailsModel();
         ClearFormData();
         LoadListKnifeList();
         LoadData();
     }
 }
Пример #2
0
        bool ValidateForm()
        {
            if (cWorker.EditValue == null)
            {
                MessageBox.Show("Vui lòng chọn người phụ trách!", TextUtils.Caption, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return(false);
            }


            if (string.IsNullOrEmpty(cKnifeList.Text))
            {
                MessageBox.Show("Vui lòng chọn loại dao!", TextUtils.Caption, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return(false);
            }

            DataRowView selectData = (DataRowView)cKnifeList.GetSelectedDataRow();
            int         std        = TextUtils.ToInt(selectData.Row.ItemArray[2]);
            int         atc        = TextUtils.ToInt(selectData.Row.ItemArray[3]);
            int         currentSTD = TextUtils.ToInt(selectData.Row.ItemArray[4]);
            int         currentATC = TextUtils.ToInt(selectData.Row.ItemArray[5]);

            if (currentATC == atc)
            {
                if (MessageBox.Show("Mã dao này không thể tiếp tục sử dụng! \n Bạn có muốn hủy mã dao này?", "Thông báo", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    // Huy dao
                    frmKnifeDisposed frm = new frmKnifeDisposed();
                    frm.knifeID = TextUtils.ToInt(cKnifeList.EditValue);
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        knifeSharpeningModel = new KnifeSharpeningDetailsModel();
                        ClearFormData();
                        LoadData();
                    }
                }
                return(false);
            }

            /*if (currentModel.CurrentSTD == currentModel.STD)
             * {
             *      if (MessageBox.Show("Mã dao này cần được mài trước khi sử dụng! \n Bạn có muốn mài mã dao này ngay bây giờ?", "Thông báo", MessageBoxButtons.OKCancel) == DialogResult.OK)
             *      {
             *              // Mai dao
             *              frmKnifeSharpen frm = new frmKnifeSharpen();
             *              frm.knifeID = TextUtils.ToInt(cKnifeList.EditValue);
             *              if (frm.ShowDialog() == DialogResult.OK)
             *              {
             *
             *              }
             *      }
             *      return false;
             *
             * }*/
            return(true);
        }
 protected KnifeSharpeningDetailsFacade(KnifeSharpeningDetailsModel model) : base(model)
 {
 }