Esempio n. 1
0
 public String getChargeWithMaCV(CChargeDTO _ChargeObject)
 {
     m_cmd             = new SqlCommand();
     m_cmd.CommandType = CommandType.StoredProcedure;
     m_cmd.Parameters.Add("MaCV", SqlDbType.NVarChar).Value = _ChargeObject.maChucVu;
     m_cmd.CommandText = "GetChargeWithMaCV";
     return(m_ChargeExecute.getStringExecuter(m_cmd));
 }
Esempio n. 2
0
 public frmCharge()
 {
     InitializeComponent();
     m_Charge                = new CChargeDTO();
     m_ChargeBus             = new CChargeBUS();
     m_ChargeData            = new DataTable();
     m_ChargeMultiSelectItem = new GridCheckMarksSelection(grdvListCharge);
 }
Esempio n. 3
0
 public bool DeleteChargeToDatabase(CChargeDTO _ChargeObject)
 {
     m_cmd             = new SqlCommand();
     m_cmd.CommandType = CommandType.StoredProcedure;
     m_cmd.CommandText = "DeleteChargeDataToDatabase";
     m_cmd.Parameters.Add("MaCV", SqlDbType.NVarChar).Value = _ChargeObject.maChucVu;
     return(m_ChargeExecute.updateData(m_cmd) > 0);
 }
Esempio n. 4
0
 private void InitEmployeeObj()
 {
     m_EmployeeExecute     = new CEmployeeBUS();
     m_ChargeData          = new DataTable();
     m_ChargeExecute       = new CChargeBUS();
     m_ChargeObj           = new CChargeDTO();
     m_ChargeObj.maChucVu  = ucLogin.m_EmployeeObject.maChucVu;
     m_ChargeObj.tenChucVu = m_ChargeExecute.getChargeWithMaCV(m_ChargeObj);
 }
Esempio n. 5
0
 public frmEmployee()
 {
     InitializeComponent();
     m_ChargeData             = new DataTable();
     m_ChargeExecute          = new CChargeBUS();
     m_ChargeObject           = new CChargeDTO();
     m_EmployeeData           = new DataTable();
     m_EmployeeExecute        = new CEmployeeBUS();
     m_EmployeeObject         = new CEmployeeDTO();
     m_EmployeeMultiSelect    = new GridCheckMarksSelection(grdvListEmployee);
     EmployeeSno.VisibleIndex = 1;
 }
Esempio n. 6
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         m_Charge = new CChargeDTO(txtChargeId.Text, txtChargeName.Text);
         m_ChargeBus.AddChargeToDatabase(m_Charge);
         m_ChargeData                    = m_ChargeBus.getChargeDataFromDatabase();
         grdListCharge.DataSource        = m_ChargeData;
         grdvListCharge.FocusedRowHandle = grdvListCharge.DataRowCount - 1;
     }
     catch (System.Exception ex)
     {
         XtraMessageBox.Show(ex.ToString(), "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
     }
 }
Esempio n. 7
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (!CheckInformationEntered.checkDataInput(txtChargeName, "Không thể để trống dữ liệu!", ref dxErrorProvider))
     {
         return;
     }
     try
     {
         if (m_IsAdd)
         {
             m_Charge = new CChargeDTO("CV0000000", txtChargeName.Text);
             if (m_ChargeBus.AddChargeToDatabase(m_Charge))
             {
                 XtraCustomMessageBox.Show("Thêm dữ liệu thành công!", "Thông báo", true);
             }
             else
             {
                 XtraCustomMessageBox.Show("Thêm dữ liệu thất bại!", "Lỗi", true);
             }
         }
         else
         {
             m_Charge          = new CChargeDTO(txtChargeId.Text, txtChargeName.Text);
             m_Charge.maChucVu = txtChargeId.Text;
             if (m_ChargeBus.UpdateChargeToDatabase(m_Charge))
             {
                 XtraCustomMessageBox.Show("Cập nhật dữ liệu thành công!", "Thông báo", true);
             }
             else
             {
                 XtraCustomMessageBox.Show("Cập nhật dữ liệu thất bại!", "Lỗi", true);
             }
         }
     }
     catch (System.Exception)
     {
         XtraCustomMessageBox.Show("Lưu thất bại", "Lỗi", true);
     }
     finally
     {
         updateEnableButtonAndResetValueOfControl(ref btnSave);
     }
 }
Esempio n. 8
0
 //Xóa thông tin của thể loại
 private void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         foreach (object _rowObjectItem in m_ChargeMultiSelectItem.Selection)
         {
             grdvListCharge.FocusedRowHandle -= 1;
             DataRowView _rowObjectDetail = _rowObjectItem as DataRowView;
             m_Charge = new CChargeDTO(_rowObjectDetail.Row["MaCV"].ToString(), _rowObjectDetail.Row["TenCV"].ToString());
             m_ChargeBus.DeleteChargeToDatabase(m_Charge);
             m_ChargeData                    = new DataTable();
             m_ChargeData                    = m_ChargeBus.getChargeDataFromDatabase();
             grdListCharge.DataSource        = m_ChargeData;
             grdvListCharge.FocusedRowHandle = grdvListCharge.DataRowCount - 1;
         }
     }
     catch (System.Exception ex)
     {
         XtraMessageBox.Show(ex.ToString(), "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
     }
 }
Esempio n. 9
0
 //Xóa thông tin của thể loại
 private void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         ArrayList _litsAuthorID = new ArrayList();
         foreach (object _rowObjectItem in m_ChargeMultiSelectItem.Selection)
         {
             grdvListCharge.FocusedRowHandle -= 1;
             DataRowView _rowObjectDetail = _rowObjectItem as DataRowView;
             m_Charge = new CChargeDTO(_rowObjectDetail.Row["MaCV"].ToString(), _rowObjectDetail.Row["TenCV"].ToString());
             if (!m_ChargeBus.DeleteChargeToDatabase(m_Charge))
             {
                 _litsAuthorID.Add(_rowObjectDetail.Row["MaCV"]);
             }
         }
         if (_litsAuthorID.Count != 0)
         {
             String _erroContent = "Không thể xóa các thể loại có mã: \n";
             foreach (var item in _litsAuthorID)
             {
                 _erroContent += item.ToString() + "\n";
             }
             XtraCustomMessageBox.Show(_erroContent, "Lỗi", true);
         }
         else
         {
             XtraCustomMessageBox.Show("Xóa dữ liệu thành công!", "Thông báo", true);
         }
     }
     catch (System.Exception)
     {
         XtraCustomMessageBox.Show("Xóa dữ liệu thất bại!", "Lỗi", true);
     }
     finally
     {
         updateEnableButtonAndResetValueOfControl(ref btnDelete);
     }
 }
Esempio n. 10
0
 public bool UpdateChargeToDatabase(CChargeDTO _ChargeObject)
 {
     return(m_ChargeDAL.UpdateChargeToDatabase(_ChargeObject));
 }
Esempio n. 11
0
 public bool DeleteChargeToDatabase(CChargeDTO _ChargeObject)
 {
     return(m_ChargeDAL.DeleteChargeToDatabase(_ChargeObject));
 }
Esempio n. 12
0
 public bool AddChargeToDatabase(CChargeDTO _ChargeObject)
 {
     return(m_ChargeDAL.AddChargeToDatabase(_ChargeObject));
 }
Esempio n. 13
0
 public CChargeDAL()
 {
     m_ChargeObject  = null;
     m_ChargeExecute = new CDataExecute();
     m_cmd           = new SqlCommand();
 }
Esempio n. 14
0
 public CChargeDAL(CChargeDTO _ChargeObject)
 {
     m_ChargeObject  = _ChargeObject;
     m_ChargeExecute = new CDataExecute();
     m_cmd           = new SqlCommand();
 }
Esempio n. 15
0
 public String getChargeWithMaCV(CChargeDTO _ChargeObject)
 {
     return(m_ChargeDAL.getChargeWithMaCV(_ChargeObject));
 }