コード例 #1
0
 private void grdVehicleCheck_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     //check permission
     if (_userInfo.UserPermission.Contains(ConstantInfo.PERMISSON_CAP_NHAT_KET_QUA_KIEM_TRA) == false)
     {
         return;
     }
     try
     {
         if (e.RowIndex >= 0 && grdVehicleCheck.SelectedRows.Count == 1) // Only select one row
         {
             var vehicleCheckID = grdVehicleCheck.SelectedRows[0].Cells["VehicleCheckID"].Value;
             var vehicleID = grdVehicleCheck.SelectedRows[0].Cells["VehicleID"].Value;
             var check = new FrmCheck(_userInfo, Convert.ToInt64(vehicleID), 1, Convert.ToInt32(vehicleCheckID), 0);
             check.Show(this);
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex.ToString());
         if (GlobalInfo.IsDebug) MessageBox.Show(ex.ToString());
     }
 }
コード例 #2
0
 private void bntUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         if (grdVehicleCheck.SelectedRows.Count != 0)
         {
             var vehicleCheckID = grdVehicleCheck.SelectedRows[0].Cells["VehicleCheckID"].Value;
             var vehicleID = grdVehicleCheck.SelectedRows[0].Cells["VehicleID"].Value;
             var check = new FrmCheck(_userInfo, Convert.ToInt64(vehicleID), 1, Convert.ToInt32(vehicleCheckID), 0);
             check.Show(this);
         }
         else
         {
             MessageBox.Show("Bạn cần chọn 1 tờ khai cần cập nhật.");
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex.ToString());
         if (GlobalInfo.IsDebug) MessageBox.Show(ex.ToString());
     }
 }
コード例 #3
0
    //private void btnConfirm_Click(object sender, EventArgs e)
    //{
    //  try
    //  {
    //    // Get check information
    //    var check = CheckFactory.SelectByID(_checkID);

    //    var vehicleCheck = new tblVehicleCheck();
    //    vehicleCheck.VehicleID = _vehicleID;
    //    vehicleCheck.InputBy = _userInfo.UserID;
    //    if(check != null)
    //    {
    //      vehicleCheck.CheckFrom = check.CheckFrom;
    //      vehicleCheck.CheckTo = check.CheckTo;
    //    }
    //    // Insert new 
    //    VehicleCheckFactory.Insert(vehicleCheck);
    //    MessageBox.Show("Xác nhận cảnh báo thành công");
    //    this.Close();
    //  } catch (Exception ex)
    //    {
    //      logger.Error(ex.ToString());
    //      if (GlobalInfo.IsDebug) MessageBox.Show(ex.ToString());
    //    }
    //}

    private void btnInput_Click(object sender, EventArgs e)
    {
      var frmCheck = new FrmCheck(_userInfo, _vehicleID, _checkID, _checkType);
      frmCheck.Show(this);
    }