private void tsbUnLock_Click(object sender, EventArgs e)
        {
            ChungTuLockInfor lockInfor = (ChungTuLockInfor)grvChiTiet.GetFocusedRow();
            DateTime         sysDate   = CommonProvider.Instance.GetSysDate();

            if (lockInfor != null)
            {
                TimeSpan t = lockInfor.Last_Update_Date.AddHours(2) - sysDate;
                if (MessageBox.Show(
                        String.Format(
                            "Khóa sẽ tự động mở sau {0} phút nữa. Việc mở khóa ngay lúc này có thể gây lỗi cho hệ thống!!! Bạn có đồng ý mở không?",
                            Math.Round(t.TotalMinutes)), "Cảnh báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning,
                        MessageBoxDefaultButton.Button2) == DialogResult.No)
                {
                    return;
                }

                frmProgress.Instance.DoWork(
                    delegate()
                {
                    frmProgress.Instance.Text        = Text;
                    frmProgress.Instance.MaxValue    = 100;
                    frmProgress.Instance.Value       = 0;
                    frmProgress.Instance.Description = "Đang mở khóa ...";
                    if (ChungTuLockProvider.Instance.UnlockChungTu(lockInfor) == 0)
                    {
                        MessageBox.Show("Chứng từ đã tự mở khóa");
                    }
                    frmProgress.Instance.Value       = frmProgress.Instance.MaxValue;
                    frmProgress.Instance.Description = "Đã xong";
                    LoadDuLieu();
                });
            }
        }
 public int UnlockChungTu(ChungTuLockInfor infor)
 {
     return(ChungTuLockDAO.Instance.UnlockChungTu(infor));
 }
示例#3
0
 public int UnlockChungTu(ChungTuLockInfor infor)
 {
     return(ExecuteCommand(Declare.StoreProcedureNamespace.spChungTuBanHangLockEdit, infor.IdChungtu, 0, 0,
                           infor.ProcessId, infor.LockAccount, infor.LockMachine));
 }