protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["TenDangNhap"]) == "") { Response.Redirect("~/dangnhap.aspx"); } choilbangDAL = new clsCauHoi_LoaiBang_DAL(); choilbangDTO = new clsCauHoi_LoaiBang_DTO(); lbangDAL = new clsLoaiBanglai_DAL(); lbangDTO = new clsLoaiBanglai_DTO(); choiDAL = new clsCauHoi_DAL(); choiDTO = new clsCauHoi_DTO(); cmn = new clsCommon(); if (!IsPostBack || !IsCallback) { } if (!Page.IsPostBack) { } loadMasterData(); if (cboLoaiBang.Value != null) { gvCauHoiLoaiBang.DataSource = loadDataToUI(); gvCauHoiLoaiBang.DataBind(); } }
public int Delete(clsCauHoi_LoaiBang_DTO ch_lbDTO) { try { ListDictionary _list = new ListDictionary(); _list.Add("STT", ch_lbDTO.STT); int iReturn = obj.ExcSql("Delete_CauHoi_LoaiBang", _list, CommandType.StoredProcedure); return iReturn; } catch (Exception) { //return ex.Message; return -1111; } }
protected void gvCauHoiLoaiBang_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) { if (e.Parameters == "Update") { gvCauHoiLoaiBang.DataSource = loadDataToUI(); gvCauHoiLoaiBang.Selection.UnselectAll(); } else { choilbangDTO = new clsCauHoi_LoaiBang_DTO(); choilbangDTO.MaLoaiBang = e.Parameters; DataTable dt = choilbangDAL.getCauHoi_LoaiBang(choilbangDTO); gvCauHoiLoaiBang.DataSource = dt; gvCauHoiLoaiBang.DataBind(); } }
protected void gvCauHoiLoaiBang_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) { if (e.Parameters == "Update") { gvCauHoiLoaiBang.DataSource = loadDataToUI(); gvCauHoiLoaiBang.Selection.UnselectAll(); } else { choilbangDTO = new clsCauHoi_LoaiBang_DTO(); choilbangDTO.MaLoaiBang = e.Parameters; DataTable dt = choilbangDAL.getCauHoi_LoaiBang(choilbangDTO); gvCauHoiLoaiBang.DataSource = dt; gvCauHoiLoaiBang.DataBind(); } }
public int Delete(clsCauHoi_LoaiBang_DTO ch_lbDTO) { try { ListDictionary _list = new ListDictionary(); _list.Add("STT", ch_lbDTO.STT); int iReturn = obj.ExcSql("Delete_CauHoi_LoaiBang", _list, CommandType.StoredProcedure); return(iReturn); } catch (Exception) { //return ex.Message; return(-1111); } }
public DataTable getCauHoi_LoaiBang(clsCauHoi_LoaiBang_DTO ch_lbDTO) { ListDictionary _list = new ListDictionary(); _list.Add("STT", ch_lbDTO.STT); _list.Add("MaLoaiBang", ch_lbDTO.MaLoaiBang); _list.Add("MaCauHoi", ch_lbDTO.MaCauHoi); DataTable dt = new DataTable(); try { dt = obj.GetDataTable("Select_CauHoi_LoaiBang", CommandType.StoredProcedure); } catch { dt = null; } return dt; }
public int InsertUpdate(clsCauHoi_LoaiBang_DTO ch_lbDTO) { try { ListDictionary _list = new ListDictionary(); _list.Add("old_id", ch_lbDTO.OldID); _list.Add("STT", ch_lbDTO.STT); _list.Add("MaLoaiBang", ch_lbDTO.MaLoaiBang); _list.Add("MaCauHoi", ch_lbDTO.MaCauHoi); int iReturn = obj.ExcSql("Insert_Update_CauHoi_LoaiBang", _list, CommandType.StoredProcedure); return iReturn; } catch (Exception) { //return ex.Message; return -1111; // Đặt số này làm ngoại lệ ko lường trước được. ở StoredProcedure không được return có số này tránh trường hợp trùng } }
public int InsertUpdate(clsCauHoi_LoaiBang_DTO ch_lbDTO) { try { ListDictionary _list = new ListDictionary(); _list.Add("old_id", ch_lbDTO.OldID); _list.Add("STT", ch_lbDTO.STT); _list.Add("MaLoaiBang", ch_lbDTO.MaLoaiBang); _list.Add("MaCauHoi", ch_lbDTO.MaCauHoi); int iReturn = obj.ExcSql("Insert_Update_CauHoi_LoaiBang", _list, CommandType.StoredProcedure); return(iReturn); } catch (Exception) { //return ex.Message; return(-1111); // Đặt số này làm ngoại lệ ko lường trước được. ở StoredProcedure không được return có số này tránh trường hợp trùng } }
public DataTable getCauHoi_LoaiBang(clsCauHoi_LoaiBang_DTO ch_lbDTO) { ListDictionary _list = new ListDictionary(); _list.Add("STT", ch_lbDTO.STT); _list.Add("MaLoaiBang", ch_lbDTO.MaLoaiBang); _list.Add("MaCauHoi", ch_lbDTO.MaCauHoi); DataTable dt = new DataTable(); try { dt = obj.GetDataTable("Select_CauHoi_LoaiBang", CommandType.StoredProcedure); } catch { dt = null; } return(dt); }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["TenDangNhap"]) == "") Response.Redirect("~/dangnhap.aspx"); choilbangDAL = new clsCauHoi_LoaiBang_DAL(); choilbangDTO = new clsCauHoi_LoaiBang_DTO(); lbangDAL = new clsLoaiBanglai_DAL(); lbangDTO = new clsLoaiBanglai_DTO(); choiDAL = new clsCauHoi_DAL(); choiDTO = new clsCauHoi_DTO(); cmn = new clsCommon(); if (!IsPostBack || !IsCallback) { } if (!Page.IsPostBack) { } loadMasterData(); if (cboLoaiBang.Value != null) { gvCauHoiLoaiBang.DataSource = loadDataToUI(); gvCauHoiLoaiBang.DataBind(); } }