Ejemplo n.º 1
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     try
     {
         int    isApproved  = TextUtils.ToInt(grvDetail.GetFocusedRowCellValue(colIsApproved));
         int    actionType  = TextUtils.ToInt(grvDetail.GetFocusedRowCellValue(colActionType));
         string actionTypes = TextUtils.ToString(grvDetail.GetFocusedRowCellValue(colActionTypes));
         if (isApproved == 1 && (actionType == 3 || actionType == 2))
         {
             MessageBox.Show("Mục kiểm tra đang chờ duyệt", "Không được sửa", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             return;
         }
         int id = TextUtils.ToInt(grvDetail.GetFocusedRowCellValue(colWorkingID));
         if (id == 0)
         {
             return;
         }
         ProductWorkingModel      model = (ProductWorkingModel)ProductWorkingBO.Instance.FindByPK(id);
         frmProductWorkingDetailH frm   = new frmProductWorkingDetailH();
         frm.ProductWorking = model;
         frm.ProductID      = this.ProductID;
         frm._isApproved    = isApproved;
         frm._actionType    = actionType;
         if (frm.ShowDialog() == DialogResult.OK)
         {
             loadWorking();
         }
     }
     catch (Exception ex)
     {
     }
 }
Ejemplo n.º 2
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            frmProductWorkingDetailH frm = new frmProductWorkingDetailH();

            frm.StepID    = TextUtils.ToInt(grvData.GetFocusedRowCellValue(colStepID));
            frm.ProductID = ProductID;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                loadWorking();
            }
        }