private void cklWebDkh_Click(object sender, EventArgs e) { vDto = new WEB_DANGKIHOC(); vDto.DKW_Active = 1; vDto.DKW_Status = 3; vBo = new BO_WEB_DANGKIHOC(); vtbl = new DataTable(); object vIdChungChi = -1; if (cklWebDkh.SelectedIndex > -1) { vDto.DKW_CHCID = int.Parse(cklWebDkh.SelectedValue.ToString()); vtbl = vBo.vLoadListHocVienByChungChiID(vDto); grvWebListHocVien.Columns.Clear(); grdWebListHocVien.DataSource = vtbl.DefaultView; grvWebListHocVien.Columns["DKW_ID"].VisibleIndex = -1; grvWebListHocVien.Columns["DKW_Status"].VisibleIndex = -1; grvWebListHocVien.Columns["DKW_Code"].VisibleIndex = -1; grvWebListHocVien.Columns["DKW_TINID"].VisibleIndex = -1; grvWebListHocVien.Columns["DKW_DONID"].VisibleIndex = -1; grvWebListHocVien.Columns["DKW_CHUID"].VisibleIndex = -1; sselection = new GridCheckMarksSelection(grvWebListHocVien); sselection.CheckMarkColumn.VisibleIndex = 0; sselection.CheckMarkColumn.Width = 8; for (int i = 0; i < vtbl.Rows.Count; i++) { if (int.Parse(vtbl.Rows[i]["DKW_Status"].ToString()) == 2) { sselection.SelectRow(i, true); } } } }
private Boolean updateStatusCall() { vDto = new WEB_DANGKIHOC(); vBo = new BO_WEB_DANGKIHOC(); try { for (int i = 0; i < grvWebListHocVien.RowCount; i++) { DataRow dr = grvWebListHocVien.GetDataRow(i); vDto.DKW_ID = int.Parse(dr["DKW_ID"].ToString()); if (sselection.IsRowSelected(i)) { vDto.DKW_Status = 2; vBo.updateStatus(vDto); } //else //{ // vDto.DKW_Status = 1; // vBo.updateStatus(vDto); //} } return(true); } catch (Exception) { return(false); } }
private void vLoadListHocVien() { vDto = new WEB_DANGKIHOC(); vDto.DKW_Active = 1; vDto.DKW_Status = 3; vBo = new BO_WEB_DANGKIHOC(); vtbl = new DataTable(); vDto.DKW_CHCID = gChungChiID; vtbl = vBo.vLoadListHocVienByChungChiID(vDto); grvWebListHocVien.Columns.Clear(); grdWebListHocVien.DataSource = vtbl.DefaultView; grvWebListHocVien.Columns["DKW_ID"].VisibleIndex = -1; grvWebListHocVien.Columns["DKW_Status"].VisibleIndex = -1; grvWebListHocVien.Columns["DKW_Code"].VisibleIndex = -1; grvWebListHocVien.Columns["DKW_TINID"].VisibleIndex = -1; grvWebListHocVien.Columns["DKW_DONID"].VisibleIndex = -1; grvWebListHocVien.Columns["DKW_CHUID"].VisibleIndex = -1; sselection = new GridCheckMarksSelection(grvWebListHocVien); sselection.CheckMarkColumn.VisibleIndex = 0; sselection.CheckMarkColumn.Width = 8; //for (int i = 0; i < vtbl.Rows.Count; i++) //{ // if (int.Parse(vtbl.Rows[i]["DKW_Status"].ToString()) == 2) // { // sselection.SelectRow(i, true); // } //} }
public void updateStatus(WEB_DANGKIHOC vDto) { SqlParameter[] prams = { MakeInParam("@DKW_ID", SqlDbType.Int, 4, vDto.DKW_ID), MakeInParam("@DKW_Status", SqlDbType.Int, 4, vDto.DKW_Status) }; int errorcode = RunProc("WEB_DANGKIHOC_UpdateStatus", prams); if (errorcode > 0) { throw new Exception("Error"); } }
public DataTable vLoadData(WEB_DANGKIHOC vDto) { connect(); DataSet DS = new DataSet(); SqlParameter[] prams = { MakeInParam("@DKW_Status", SqlDbType.Int, 4, vDto.DKW_Status), MakeInParam("@DKW_Active", SqlDbType.Int, 4, vDto.DKW_Active) }; int errorcode = RunProcDS("WEB_DANGKIHOC_Select", prams, out DS); if (errorcode > 0) { throw new Exception("Error!"); } return(DS.Tables[0]); }
private void initCheckBoxList() { DataTable tbl = new DataTable(); vDto = new WEB_DANGKIHOC(); vDto.DKW_Active = 1; vDto.DKW_Status = 3; vBo = new BO_WEB_DANGKIHOC(); vtbl = new DataTable(); vtbl = vBo.vLoadData(vDto); if (vtbl.Rows.Count > 0) { DataTable table = new DataTable(); table.Columns.Add("ID", typeof(int)); table.Columns.Add("Name", typeof(string)); DataRow vRow; for (int i = 0; i < vtbl.Rows.Count; i++) { vDto.DKW_CHCID = int.Parse(vtbl.Rows[i]["DKW_CHCID"].ToString()); tbl = vBo.vLoadTotalHocVienDangKi(vDto); if (tbl.Rows.Count > 0) { vRow = table.NewRow(); vRow["ID"] = int.Parse(vtbl.Rows[i]["DKW_CHCID"].ToString()); vRow["Name"] = tbl.Rows[0]["CHC_Name"] + " (" + tbl.Rows.Count + ")"; table.Rows.Add(vRow); } } cklWebDkh.DataSource = table; cklWebDkh.ValueMember = "ID"; cklWebDkh.DisplayMember = "Name"; } }
public void updateStatus(WEB_DANGKIHOC vDto) { dal = new DAL_WEB_DANGKIHOC(); dal.updateStatus(vDto); }
public DataTable vLoadListHocVienByChungChiID(WEB_DANGKIHOC vDto) { vtb = new DataTable(); dal = new DAL_WEB_DANGKIHOC(); return(vtb = dal.vLoadListHocVienByChungChiID(vDto)); }
public DataTable vLoadTotalHocVienDangKi(WEB_DANGKIHOC vDto) { vtb = new DataTable(); dal = new DAL_WEB_DANGKIHOC(); return(vtb = dal.vLoadTotalHocVienDangKi(vDto)); }
public DataTable vLoadData(WEB_DANGKIHOC vDto) { vtb = new DataTable(); dal = new DAL_WEB_DANGKIHOC(); return(vtb = dal.vLoadData(vDto)); }