예제 #1
0
    private void loadMasterData()
    {
        cathiDTO = new clsCaThi_DTO();
        DataTable dt = new DataTable();

        dt = cathiDAL.getCaThi(cathiDTO);


        cboCaThi.ValueField = "MaCaThi";
        cboCaThi.TextField  = "MaCaThi";

        cboCaThi.DataSource = dt;
        cboCaThi.DataBind();


        //GridViewDataComboBoxColumn gclCathi = gvThiSinh.Columns["MaCaThi"] as GridViewDataComboBoxColumn;
        //gclCathi.PropertiesComboBox.DataSource = dt;
        //gclDiemThi.PropertiesComboBox.ValueField = "MaDienThi";
        //gclDiemThi.PropertiesComboBox.TextField = "TenDiemThi";
        pthiDTO = new clsPhongThi_DTO();
        dt      = pthiDAL.getPhongThi(pthiDTO);


        cboPhongThi.ValueField = "MaPhong";
        cboPhongThi.TextField  = "MaPhong";

        cboPhongThi.DataSource = dt;
        cboPhongThi.DataBind();

        //GridViewDataComboBoxColumn gclPhongthi = gvThiSinh.Columns["MaPhong"] as GridViewDataComboBoxColumn;
        //gclPhongthi.PropertiesComboBox.DataSource = dt;
    }
예제 #2
0
    private DataTable loadDataToUI(clsPhongThi_DTO pthiDTO)
    {
        DataTable dt = new DataTable();

        dt = pthiDAL.getPhongThi(pthiDTO);
        return(dt);
    }
예제 #3
0
    protected void gvPhongThi_CustomDataCallback(object sender, ASPxGridViewCustomDataCallbackEventArgs e)
    {
        pthiDTO = new clsPhongThi_DTO();
        string        strReturn = string.Empty;
        string        strMess   = string.Empty;
        int           iRow      = gvPhongThi.VisibleRowCount;
        List <object> keyValues = gvPhongThi.GetSelectedFieldValues("MaPhong");

        foreach (object key in keyValues)
        {
            pthiDTO.MaPhong = key.ToString();
            int iReturn = pthiDAL.Delete(pthiDTO);
            if (iReturn < 0)
            {
                strMess += " " + key.ToString();
            }
        }
        if (strMess != string.Empty)
        {
            e.Result = "Do ràng buộc dữ liệu, không thể xóa " + strMess;
        }
        else
        {
            e.Result = string.Empty;
        }
        pthiDTO.MaDiemThi     = cboDiemThi.Value.ToString();
        gvPhongThi.DataSource = loadDataToUI(pthiDTO);
        gvPhongThi.Selection.SelectAll();
    }
예제 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Convert.ToString(Session["TenDangNhap"]) == "")
        {
            Response.Redirect("~/dangnhap.aspx");
        }
        pthiDAL = new clsPhongThi_DAL();
        pthiDTO = new clsPhongThi_DTO();

        dthiDAL = new clsDiaDiemThi_DAL();
        //dthiDTO = new clsDiaDiemThi_DTO();

        cmn = new clsCommon();
        if (!IsPostBack || !IsCallback)
        {
        }
        if (!Page.IsPostBack)
        {
        }
        loadMasterData();
        if (cboDiemThi.Value != null)
        {
            pthiDTO.MaDiemThi     = cboDiemThi.Value.ToString();
            gvPhongThi.DataSource = loadDataToUI(pthiDTO);
            gvPhongThi.DataBind();
        }
    }
예제 #5
0
    protected void gvPhongThi_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
    {
        pthiDTO               = new clsPhongThi_DTO();
        e.Cancel              = true;
        pthiDTO.OldID         = e.OldValues["MaPhong"].ToString();
        pthiDTO.MaPhong       = e.NewValues["MaPhong"].ToString();
        pthiDTO.MoTa          = e.NewValues["MoTa"].ToString();;
        pthiDTO.SoThSinhToiDa = e.NewValues["SoThSinhToiDa"].ToString();
        pthiDTO.TrangThai     = e.NewValues["TrangThai"].ToString();
        pthiDTO.MaDiemThi     = cboDiemThi.Value.ToString();
        int iReturn = pthiDAL.InsertUpdate(pthiDTO);

        if (iReturn >= 0)
        {
            pthiDTO               = new clsPhongThi_DTO();
            pthiDTO.MaDiemThi     = cboDiemThi.Value.ToString();
            gvPhongThi.DataSource = loadDataToUI(pthiDTO);
            gvPhongThi.CancelEdit();
        }
        else if (iReturn == -2)
        {
            strMess = "Không tồn tại mã để cập nhật";
            gvPhongThi.DoRowValidation();
        }
        else
        {
            strMess = "Do ràng buộc dữ liệu. Không thể thực hiện cập nhật";
            gvPhongThi.DoRowValidation();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Convert.ToString(Session["TenDangNhap"]) == "")
        {
            Response.Redirect("~/dangnhap.aspx");
        }
        pcctDAL = new clsPhanCongCoithi_DAL();
        pcctDTO = new clsPhanCongCoiThi_DTO();

        pthiDAL = new clsPhongThi_DAL();
        pthiDTO = new clsPhongThi_DTO();

        cathiDAL = new clsCaThi_DAL();
        cathiDTO = new clsCaThi_DTO();

        //thisinhDAL = new clsThiSinh_DAL();
        //thisinhDTO = new clsThiSinh_DTO();

        cmn = new clsCommon();
        if (!IsPostBack || !IsCallback)
        {
        }
        if (!Page.IsPostBack)
        {
        }
        loadMasterData();
        gvPhanCongCT.DataSource = loadDataToUI();
        gvPhanCongCT.DataBind();
    }
예제 #7
0
 public int Delete(clsPhongThi_DTO phongthiDTO)
 {
     try
     {
         ListDictionary _list = new ListDictionary();
         _list.Add("MaPhong", phongthiDTO.MaPhong);
         int iReturn = obj.ExcSql("Delete_Phong_Thi", _list, CommandType.StoredProcedure);
         return(iReturn);
     }
     catch (Exception)
     {
         //return ex.Message;
         return(-1111);
     }
 }
예제 #8
0
 public int Delete(clsPhongThi_DTO phongthiDTO)
 {
     try
     {
         ListDictionary _list = new ListDictionary();
         _list.Add("MaPhong", phongthiDTO.MaPhong);
         int iReturn = obj.ExcSql("Delete_Phong_Thi", _list, CommandType.StoredProcedure);
         return iReturn;
     }
     catch (Exception)
     {
         //return ex.Message;
         return -1111;
     }
 }
예제 #9
0
 protected void gvPhongThi_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
 {
     pthiDTO = new clsPhongThi_DTO();
     if (e.Parameters == "Update")
     {
         pthiDTO.MaDiemThi     = cboDiemThi.Value.ToString();
         gvPhongThi.DataSource = loadDataToUI(pthiDTO);
         gvPhongThi.Selection.UnselectAll();
     }
     else
     {
         pthiDTO           = new clsPhongThi_DTO();
         pthiDTO.MaDiemThi = e.Parameters;
         DataTable dt = pthiDAL.getPhongThi(pthiDTO);
         gvPhongThi.DataSource = dt;
         gvPhongThi.DataBind();
     }
 }
예제 #10
0
 protected void gvPhongThi_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
 {
     pthiDTO = new clsPhongThi_DTO();
     if (e.Parameters == "Update")
     {
         pthiDTO.MaDiemThi = cboDiemThi.Value.ToString();
         gvPhongThi.DataSource = loadDataToUI(pthiDTO);
         gvPhongThi.Selection.UnselectAll();
     }
     else
     {
         pthiDTO = new clsPhongThi_DTO();
         pthiDTO.MaDiemThi = e.Parameters;
         DataTable dt = pthiDAL.getPhongThi(pthiDTO);
         gvPhongThi.DataSource = dt;
         gvPhongThi.DataBind();
     }
 }
예제 #11
0
 public DataTable getPhongThi(clsPhongThi_DTO phongthiDTO)
 {
     ListDictionary _list = new ListDictionary();
     _list.Add("MaPhong", phongthiDTO.MaPhong);
     _list.Add("MoTa", phongthiDTO.MoTa);
     _list.Add("SoThSinhToiDa", phongthiDTO.SoThSinhToiDa);
     _list.Add("TrangThai", phongthiDTO.TrangThai);
     _list.Add("MaDiemThi", phongthiDTO.MaDiemThi);
     DataTable dt = new DataTable();
     try
     {
         dt = obj.GetDataTable("Select_Phong_Thi", _list, CommandType.StoredProcedure);
     }
     catch
     {
         dt = null;
     }
     return dt;
 }
예제 #12
0
    public DataTable getPhongThi(clsPhongThi_DTO phongthiDTO)
    {
        ListDictionary _list = new ListDictionary();

        _list.Add("MaPhong", phongthiDTO.MaPhong);
        _list.Add("MoTa", phongthiDTO.MoTa);
        _list.Add("SoThSinhToiDa", phongthiDTO.SoThSinhToiDa);
        _list.Add("TrangThai", phongthiDTO.TrangThai);
        _list.Add("MaDiemThi", phongthiDTO.MaDiemThi);
        DataTable dt = new DataTable();

        try
        {
            dt = obj.GetDataTable("Select_Phong_Thi", _list, CommandType.StoredProcedure);
        }
        catch
        {
            dt = null;
        }
        return(dt);
    }
예제 #13
0
    public int InsertUpdate(clsPhongThi_DTO phongthiDTO)
    {
        try
        {
            ListDictionary _list = new ListDictionary();
            _list.Add("old_id", phongthiDTO.OldID);
            _list.Add("MaPhong", phongthiDTO.MaPhong);
            _list.Add("MoTa", phongthiDTO.MoTa);
            _list.Add("SoThSinhToiDa", phongthiDTO.SoThSinhToiDa);
            _list.Add("TrangThai", phongthiDTO.TrangThai);
            _list.Add("MaDiemThi", phongthiDTO.MaDiemThi);

            int iReturn = obj.ExcSql("Insert_Update_Phong_Thi", _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
        }
    }
예제 #14
0
    public int InsertUpdate(clsPhongThi_DTO phongthiDTO)
    {
        try
        {
            ListDictionary _list = new ListDictionary();
            _list.Add("old_id", phongthiDTO.OldID);
            _list.Add("MaPhong", phongthiDTO.MaPhong);
            _list.Add("MoTa", phongthiDTO.MoTa);
            _list.Add("SoThSinhToiDa", phongthiDTO.SoThSinhToiDa);
            _list.Add("TrangThai", phongthiDTO.TrangThai);
            _list.Add("MaDiemThi", phongthiDTO.MaDiemThi);

            int iReturn = obj.ExcSql("Insert_Update_Phong_Thi", _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
        }
    }
예제 #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Convert.ToString(Session["TenDangNhap"]) == "")
        {
            Response.Redirect("~/dangnhap.aspx");
        }
        thisinhDAL = new clsThiSinh_DAL();
        thisinhDTO = new clsThiSinh_DTO();

        cathiDAL = new clsCaThi_DAL();
        cathiDTO = new clsCaThi_DTO();

        pthiDAL = new clsPhongThi_DAL();
        pthiDTO = new clsPhongThi_DTO();


        cmn = new clsCommon();
        if (!IsPostBack || !IsCallback)
        {
        }
        if (!Page.IsPostBack)
        {
        }
        loadMasterData();
        if (cboCaThi.Value != null)
        {
            thisinhDTO           = new clsThiSinh_DTO();
            thisinhDTO.MaTS      = cboCaThi.Value.ToString();
            gvThiSinh.DataSource = loadDataToUI(thisinhDTO);
            gvThiSinh.DataBind();
        }
        if (cboPhongThi.Value != null)
        {
            thisinhDTO           = new clsThiSinh_DTO();
            thisinhDTO.MaTS      = cboPhongThi.Value.ToString();
            gvThiSinh.DataSource = loadDataToUI(thisinhDTO);
            gvThiSinh.DataBind();
        }
    }
예제 #16
0
 protected void gvPhongThi_CustomDataCallback(object sender, ASPxGridViewCustomDataCallbackEventArgs e)
 {
     pthiDTO = new clsPhongThi_DTO();
     string strReturn = string.Empty;
     string strMess = string.Empty;
     int iRow = gvPhongThi.VisibleRowCount;
     List<object> keyValues = gvPhongThi.GetSelectedFieldValues("MaPhong");
     foreach (object key in keyValues)
     {
         pthiDTO.MaPhong = key.ToString();
         int iReturn = pthiDAL.Delete(pthiDTO);
         if (iReturn < 0)
             strMess += " " + key.ToString();
     }
     if (strMess != string.Empty)
         e.Result = "Do ràng buộc dữ liệu, không thể xóa " + strMess;
     else
         e.Result = string.Empty;
     pthiDTO.MaDiemThi = cboDiemThi.Value.ToString();
     gvPhongThi.DataSource = loadDataToUI(pthiDTO);
     gvPhongThi.Selection.SelectAll();
 }
예제 #17
0
 protected void gvPhongThi_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
 {
     pthiDTO = new clsPhongThi_DTO();
     e.Cancel = true;
     pthiDTO.MaPhong = e.NewValues["MaPhong"].ToString();
     pthiDTO.MoTa = e.NewValues["MoTa"].ToString(); ;
     pthiDTO.SoThSinhToiDa = e.NewValues["SoThSinhToiDa"].ToString();
     pthiDTO.TrangThai = e.NewValues["TrangThai"].ToString();
     pthiDTO.MaDiemThi = cboDiemThi.Value.ToString();
     int iReturn = pthiDAL.InsertUpdate(pthiDTO);
     if (iReturn >= 0)
     {
         pthiDTO = new clsPhongThi_DTO();
         pthiDTO.MaDiemThi = cboDiemThi.Value.ToString();
         gvPhongThi.DataSource = loadDataToUI(pthiDTO);
         gvPhongThi.CancelEdit();
     }
     else
     {
         strMess = "Lưu Dữ Liệu Không Thành Công";
         gvPhongThi.DoRowValidation();
     }
 }
예제 #18
0
    protected void gvPhongThi_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
    {
        pthiDTO               = new clsPhongThi_DTO();
        e.Cancel              = true;
        pthiDTO.MaPhong       = e.NewValues["MaPhong"].ToString();
        pthiDTO.MoTa          = e.NewValues["MoTa"].ToString();;
        pthiDTO.SoThSinhToiDa = e.NewValues["SoThSinhToiDa"].ToString();
        pthiDTO.TrangThai     = e.NewValues["TrangThai"].ToString();
        pthiDTO.MaDiemThi     = cboDiemThi.Value.ToString();
        int iReturn = pthiDAL.InsertUpdate(pthiDTO);

        if (iReturn >= 0)
        {
            pthiDTO               = new clsPhongThi_DTO();
            pthiDTO.MaDiemThi     = cboDiemThi.Value.ToString();
            gvPhongThi.DataSource = loadDataToUI(pthiDTO);
            gvPhongThi.CancelEdit();
        }
        else
        {
            strMess = "Lưu Dữ Liệu Không Thành Công";
            gvPhongThi.DoRowValidation();
        }
    }
예제 #19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Convert.ToString(Session["TenDangNhap"]) == "")
            Response.Redirect("~/dangnhap.aspx");
        pthiDAL = new clsPhongThi_DAL();
        pthiDTO = new clsPhongThi_DTO();

        dthiDAL = new clsDiaDiemThi_DAL();
        //dthiDTO = new clsDiaDiemThi_DTO();

        cmn = new clsCommon();
        if (!IsPostBack || !IsCallback)
        {

        }
        if (!Page.IsPostBack)
        {

        }
        loadMasterData();
        if (cboDiemThi.Value != null)
        {
            pthiDTO.MaDiemThi = cboDiemThi.Value.ToString();
            gvPhongThi.DataSource = loadDataToUI(pthiDTO);
            gvPhongThi.DataBind();
        }
    }
예제 #20
0
 protected void gvPhongThi_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
 {
     pthiDTO = new clsPhongThi_DTO();
     e.Cancel = true;
     pthiDTO.OldID = e.OldValues["MaPhong"].ToString();
     pthiDTO.MaPhong = e.NewValues["MaPhong"].ToString();
     pthiDTO.MoTa = e.NewValues["MoTa"].ToString(); ;
     pthiDTO.SoThSinhToiDa = e.NewValues["SoThSinhToiDa"].ToString();
     pthiDTO.TrangThai = e.NewValues["TrangThai"].ToString();
     pthiDTO.MaDiemThi = cboDiemThi.Value.ToString();
     int iReturn = pthiDAL.InsertUpdate(pthiDTO);
     if (iReturn >= 0)
     {
         pthiDTO = new clsPhongThi_DTO();
         pthiDTO.MaDiemThi = cboDiemThi.Value.ToString();
         gvPhongThi.DataSource = loadDataToUI(pthiDTO);
         gvPhongThi.CancelEdit();
     }
     else if (iReturn == -2)
     {
         strMess = "Không tồn tại mã để cập nhật";
         gvPhongThi.DoRowValidation();
     }
     else
     {
         strMess = "Do ràng buộc dữ liệu. Không thể thực hiện cập nhật";
         gvPhongThi.DoRowValidation();
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Convert.ToString(Session["TenDangNhap"]) == "")
            Response.Redirect("~/dangnhap.aspx");
        pcctDAL = new clsPhanCongCoithi_DAL();
        pcctDTO = new clsPhanCongCoiThi_DTO();

        pthiDAL = new clsPhongThi_DAL();
        pthiDTO = new clsPhongThi_DTO();

        cathiDAL = new clsCaThi_DAL();
        cathiDTO = new clsCaThi_DTO();

        //thisinhDAL = new clsThiSinh_DAL();
        //thisinhDTO = new clsThiSinh_DTO();

        cmn = new clsCommon();
        if (!IsPostBack || !IsCallback)
        {

        }
        if (!Page.IsPostBack)
        {

        }
        loadMasterData();
        gvPhanCongCT.DataSource = loadDataToUI();
        gvPhanCongCT.DataBind();
    }
예제 #22
0
 private DataTable loadDataToUI(clsPhongThi_DTO pthiDTO)
 {
     DataTable dt = new DataTable();
     dt = pthiDAL.getPhongThi(pthiDTO);
     return dt;
 }
예제 #23
0
    private void loadMasterData()
    {
        cathiDTO = new clsCaThi_DTO();
        DataTable dt = new DataTable();
        dt = cathiDAL.getCaThi(cathiDTO);

        cboCaThi.ValueField = "MaCaThi";
        cboCaThi.TextField = "MaCaThi";

        cboCaThi.DataSource = dt;
        cboCaThi.DataBind();

        //GridViewDataComboBoxColumn gclCathi = gvThiSinh.Columns["MaCaThi"] as GridViewDataComboBoxColumn;
        //gclCathi.PropertiesComboBox.DataSource = dt;
        //gclDiemThi.PropertiesComboBox.ValueField = "MaDienThi";
        //gclDiemThi.PropertiesComboBox.TextField = "TenDiemThi";
        pthiDTO = new clsPhongThi_DTO();
        dt = pthiDAL.getPhongThi(pthiDTO);

        cboPhongThi.ValueField = "MaPhong";
        cboPhongThi.TextField = "MaPhong";

        cboPhongThi.DataSource = dt;
        cboPhongThi.DataBind();

        //GridViewDataComboBoxColumn gclPhongthi = gvThiSinh.Columns["MaPhong"] as GridViewDataComboBoxColumn;
        //gclPhongthi.PropertiesComboBox.DataSource = dt;
    }