コード例 #1
0
    private DataTable loadDataToUI(clsThiSinh_DTO thisinhDTO)
    {
        DataTable dt = new DataTable();

        dt = thisinhDAL.getThiSinh(thisinhDTO);
        return(dt);
    }
コード例 #2
0
 public int InsertUpdate(clsThiSinh_DTO thisinhDTO)
 {
     try
     {
         ListDictionary _list = new ListDictionary();
         _list.Add("old_id", thisinhDTO.OldID);
         _list.Add("MaTS", thisinhDTO.MaTS);
         _list.Add("MatKhau", thisinhDTO.MatKhau);
         _list.Add("HoTenLot", thisinhDTO.HoTenLot);
         _list.Add("Ten", thisinhDTO.Ten);
         _list.Add("QuocTich", thisinhDTO.QuocTich);
         _list.Add("NgaySinh", thisinhDTO.NgaySinh);
         _list.Add("NguyenQuan", thisinhDTO.NguyenQuan);
         _list.Add("NoiDKHoKhau", thisinhDTO.NoiDKHoKhau);
         _list.Add("NoiThuongTru", thisinhDTO.NoiThuongTru);
         _list.Add("DienThoai", thisinhDTO.DienThoai);
         _list.Add("DVCongTac", thisinhDTO.DVCongTac);
         _list.Add("CMND", thisinhDTO.CMND);
         _list.Add("NgayCapCMND", thisinhDTO.NgayCapCMND);
         _list.Add("NoiCapCMND", thisinhDTO.NoiCapCMND);
         _list.Add("TrinhDoVanHoa", thisinhDTO.TrinhDoVanHoa);
         _list.Add("NgayDKThi", thisinhDTO.NgayDKThi);
         _list.Add("MaCaThi", thisinhDTO.MaCaThi);
         _list.Add("MaPhong", thisinhDTO.MaPhong);
         int iReturn = obj.ExcSql("Insert_Update_Thi_Sinh", _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
     }
 }
コード例 #3
0
    protected void gvThiSinh_CustomDataCallback(object sender, ASPxGridViewCustomDataCallbackEventArgs e)
    {
        thisinhDTO = new clsThiSinh_DTO();
        string        strReturn = string.Empty;
        string        strMess   = string.Empty;
        int           iRow      = gvThiSinh.VisibleRowCount;
        List <object> keyValues = gvThiSinh.GetSelectedFieldValues("MaTS");

        foreach (object key in keyValues)
        {
            thisinhDTO.MaTS = key.ToString();
            int iReturn = thisinhDAL.Delete(thisinhDTO);
            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;
        }
        gvThiSinh.DataSource = loadDataToUI(thisinhDTO);
        gvThiSinh.Selection.SelectAll();
    }
コード例 #4
0
    public DataTable getThiSinh(clsThiSinh_DTO thisinhDTO)
    {
        ListDictionary _list = new ListDictionary();
        _list.Add("MaTS", thisinhDTO.MaTS);
        _list.Add("MatKhau", thisinhDTO.MatKhau);
        _list.Add("HoTenLot", thisinhDTO.HoTenLot);
        _list.Add("Ten", thisinhDTO.Ten);
        _list.Add("QuocTich", thisinhDTO.QuocTich);
        _list.Add("NgaySinh", thisinhDTO.NgaySinh);
        _list.Add("NguyenQuan", thisinhDTO.NguyenQuan);
        _list.Add("NoiDKHoKhau", thisinhDTO.NoiDKHoKhau);
        _list.Add("NoiThuongTru", thisinhDTO.NoiThuongTru);
        _list.Add("DienThoai", thisinhDTO.DienThoai);
        _list.Add("DVCongTac", thisinhDTO.DVCongTac);
        _list.Add("CMND", thisinhDTO.CMND);
        _list.Add("NgayCapCMND", thisinhDTO.NgayCapCMND);
        _list.Add("NoiCapCMND", thisinhDTO.NoiCapCMND);
        _list.Add("TrinhDoVanHoa", thisinhDTO.TrinhDoVanHoa);
        _list.Add("NgayDKThi", thisinhDTO.NgayDKThi);
        _list.Add("MaCaThi", thisinhDTO.MaCaThi);
        _list.Add("MaPhong", thisinhDTO.MaPhong);

        DataTable dt = new DataTable();
        try
        {
            dt = obj.GetDataTable("Select_Thi_Sinh", _list, CommandType.StoredProcedure);
        }
        catch
        {
            dt = null;
        }
        return dt;
    }
コード例 #5
0
    public DataTable getThiSinh(clsThiSinh_DTO thisinhDTO)
    {
        ListDictionary _list = new ListDictionary();

        _list.Add("MaTS", thisinhDTO.MaTS);
        _list.Add("MatKhau", thisinhDTO.MatKhau);
        _list.Add("HoTenLot", thisinhDTO.HoTenLot);
        _list.Add("Ten", thisinhDTO.Ten);
        _list.Add("QuocTich", thisinhDTO.QuocTich);
        _list.Add("NgaySinh", thisinhDTO.NgaySinh);
        _list.Add("NguyenQuan", thisinhDTO.NguyenQuan);
        _list.Add("NoiDKHoKhau", thisinhDTO.NoiDKHoKhau);
        _list.Add("NoiThuongTru", thisinhDTO.NoiThuongTru);
        _list.Add("DienThoai", thisinhDTO.DienThoai);
        _list.Add("DVCongTac", thisinhDTO.DVCongTac);
        _list.Add("CMND", thisinhDTO.CMND);
        _list.Add("NgayCapCMND", thisinhDTO.NgayCapCMND);
        _list.Add("NoiCapCMND", thisinhDTO.NoiCapCMND);
        _list.Add("TrinhDoVanHoa", thisinhDTO.TrinhDoVanHoa);
        _list.Add("NgayDKThi", thisinhDTO.NgayDKThi);
        _list.Add("MaCaThi", thisinhDTO.MaCaThi);
        _list.Add("MaPhong", thisinhDTO.MaPhong);

        DataTable dt = new DataTable();

        try
        {
            dt = obj.GetDataTable("Select_Thi_Sinh", _list, CommandType.StoredProcedure);
        }
        catch
        {
            dt = null;
        }
        return(dt);
    }
コード例 #6
0
 public int Delete(clsThiSinh_DTO thisinhDTO)
 {
     try
     {
         ListDictionary _list = new ListDictionary();
         _list.Add("MaTS", thisinhDTO.MaTS);
         int iReturn = obj.ExcSql("Delete_Thi_Sinh", _list, CommandType.StoredProcedure);
         return iReturn;
     }
     catch (Exception)
     {
         //return ex.Message;
         return -1111;
     }
 }
コード例 #7
0
 public int Delete(clsThiSinh_DTO thisinhDTO)
 {
     try
     {
         ListDictionary _list = new ListDictionary();
         _list.Add("MaTS", thisinhDTO.MaTS);
         int iReturn = obj.ExcSql("Delete_Thi_Sinh", _list, CommandType.StoredProcedure);
         return(iReturn);
     }
     catch (Exception)
     {
         //return ex.Message;
         return(-1111);
     }
 }
コード例 #8
0
 protected void gvThiSinh_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
 {
     thisinhDTO = new clsThiSinh_DTO();
     if (e.Parameters == "Update")
     {
         thisinhDTO.MaTS      = cboCaThi.Value.ToString();
         gvThiSinh.DataSource = loadDataToUI(thisinhDTO);
         gvThiSinh.Selection.UnselectAll();
     }
     else
     {
         thisinhDTO = new clsThiSinh_DTO();
         //thisinhDTO.MaTS = e.Parameters;
         if (cboPhongThi.Value != null)
         {
             thisinhDTO.MaPhong = cboPhongThi.Value.ToString();
         }
         if (cboCaThi.Value != null)
         {
             thisinhDTO.MaCaThi = cboCaThi.Value.ToString();
         }
         DataTable dt = thisinhDAL.getThiSinh(thisinhDTO);
         gvThiSinh.DataSource = dt;
         gvThiSinh.DataBind();
     }
     //thisinhDTO = new clsThiSinh_DTO();
     //if (e.Parameters == "Update")
     //{
     //    thisinhDTO.MaTS = cboPhongThi.Value.ToString();
     //    gvThiSinh.DataSource = loadDataToUI(thisinhDTO);
     //    gvThiSinh.Selection.UnselectAll();
     //}
     //else
     //{
     //    thisinhDTO = new clsThiSinh_DTO();
     //    thisinhDTO.MaTS = e.Parameters;
     //    DataTable dt = thisinhDAL.getThiSinh(thisinhDTO);
     //    gvThiSinh.DataSource = dt;
     //    gvThiSinh.DataBind();
     //}
 }
コード例 #9
0
    protected void gvThiSinh_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
    {
        thisinhDTO               = new clsThiSinh_DTO();
        e.Cancel                 = true;
        thisinhDTO.OldID         = e.OldValues["MaTS"].ToString();
        thisinhDTO.MaTS          = e.NewValues["MaTS"].ToString();
        thisinhDTO.MatKhau       = e.NewValues["MatKhau"].ToString();
        thisinhDTO.HoTenLot      = e.NewValues["HoTenLot"].ToString();
        thisinhDTO.Ten           = e.NewValues["Ten"].ToString();
        thisinhDTO.QuocTich      = e.NewValues["QuocTich"].ToString();
        thisinhDTO.NgaySinh      = cmn.Convert_DMY_To_MDY(e.NewValues["NgaySinh"].ToString());
        thisinhDTO.NguyenQuan    = e.NewValues["NguyenQuan"].ToString();
        thisinhDTO.NoiDKHoKhau   = e.NewValues["NoiDKHoKhau"].ToString();
        thisinhDTO.NoiThuongTru  = e.NewValues["NoiThuongTru"].ToString();
        thisinhDTO.DienThoai     = e.NewValues["DienThoai"].ToString();
        thisinhDTO.DVCongTac     = e.NewValues["DVCongTac"].ToString();
        thisinhDTO.CMND          = e.NewValues["CMND"].ToString();
        thisinhDTO.NgayCapCMND   = cmn.Convert_DMY_To_MDY(e.NewValues["NgayCapCMND"].ToString());
        thisinhDTO.NoiCapCMND    = e.NewValues["NoiCapCMND"].ToString();
        thisinhDTO.TrinhDoVanHoa = e.NewValues["TrinhDoVanHoa"].ToString();
        thisinhDTO.NgayDKThi     = cmn.Convert_DMY_To_MDY(e.NewValues["NgayDKThi"].ToString());
        thisinhDTO.MaCaThi       = e.NewValues["MaCaThi"].ToString();
        thisinhDTO.MaPhong       = e.NewValues["MaPhong"].ToString();
        int iReturn = thisinhDAL.InsertUpdate(thisinhDTO);

        if (iReturn >= 0)
        {
            gvThiSinh.DataSource = loadDataToUI(thisinhDTO);
            gvThiSinh.CancelEdit();
        }
        else if (iReturn == -2)
        {
            strMess = "Không tồn tại mã để cập nhật";
            gvThiSinh.DoRowValidation();
        }
        else
        {
            strMess = "Do ràng buộc dữ liệu. Không thể thực hiện cập nhật";
            gvThiSinh.DoRowValidation();
        }
    }
コード例 #10
0
 protected void gvThiSinh_CustomDataCallback(object sender, ASPxGridViewCustomDataCallbackEventArgs e)
 {
     thisinhDTO = new clsThiSinh_DTO();
     string strReturn = string.Empty;
     string strMess = string.Empty;
     int iRow = gvThiSinh.VisibleRowCount;
     List<object> keyValues = gvThiSinh.GetSelectedFieldValues("MaTS");
     foreach (object key in keyValues)
     {
         thisinhDTO.MaTS = key.ToString();
         int iReturn = thisinhDAL.Delete(thisinhDTO);
         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;
     gvThiSinh.DataSource = loadDataToUI(thisinhDTO);
     gvThiSinh.Selection.SelectAll();
 }
コード例 #11
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();
        }
    }
コード例 #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Convert.ToString(Session["TenDangNhap"]) == "")
        {
            Response.Redirect("~/dangnhap.aspx");
        }
        kqtDAL = new clsKetQuaThi_DAL();
        kqtDTO = new clsKetQuaThi_DTO();

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

        cmn = new clsCommon();
        if (!IsPostBack || !IsCallback)
        {
        }
        if (!Page.IsPostBack)
        {
        }
        loadMasterData();
        gvKetQuaThi.DataSource = loadDataToUI();
        gvKetQuaThi.DataBind();
    }
コード例 #13
0
 protected void gvThiSinh_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
 {
     thisinhDTO = new clsThiSinh_DTO();
     if (e.Parameters == "Update")
     {
         thisinhDTO.MaTS = cboCaThi.Value.ToString();
         gvThiSinh.DataSource = loadDataToUI(thisinhDTO);
         gvThiSinh.Selection.UnselectAll();
     }
     else
     {
         thisinhDTO = new clsThiSinh_DTO();
         //thisinhDTO.MaTS = e.Parameters;
         if (cboPhongThi.Value != null)
             thisinhDTO.MaPhong = cboPhongThi.Value.ToString();
         if (cboCaThi.Value!= null)
             thisinhDTO.MaCaThi = cboCaThi.Value.ToString();
         DataTable dt = thisinhDAL.getThiSinh(thisinhDTO);
         gvThiSinh.DataSource = dt;
         gvThiSinh.DataBind();
     }
     //thisinhDTO = new clsThiSinh_DTO();
     //if (e.Parameters == "Update")
     //{
     //    thisinhDTO.MaTS = cboPhongThi.Value.ToString();
     //    gvThiSinh.DataSource = loadDataToUI(thisinhDTO);
     //    gvThiSinh.Selection.UnselectAll();
     //}
     //else
     //{
     //    thisinhDTO = new clsThiSinh_DTO();
     //    thisinhDTO.MaTS = e.Parameters;
     //    DataTable dt = thisinhDAL.getThiSinh(thisinhDTO);
     //    gvThiSinh.DataSource = dt;
     //    gvThiSinh.DataBind();
     //}
 }
コード例 #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Convert.ToString(Session["TenDangNhap"]) == "")
            Response.Redirect("~/dangnhap.aspx");
        kqtDAL = new clsKetQuaThi_DAL();
        kqtDTO = new clsKetQuaThi_DTO();

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

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

        }
        if (!Page.IsPostBack)
        {

        }
        loadMasterData();
        gvKetQuaThi.DataSource = loadDataToUI();
        gvKetQuaThi.DataBind();
    }
コード例 #15
0
 private DataTable loadDataToUI(clsThiSinh_DTO thisinhDTO)
 {
     DataTable dt = new DataTable();
     dt = thisinhDAL.getThiSinh(thisinhDTO);
     return dt;
 }
コード例 #16
0
 protected void gvThiSinh_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
 {
     thisinhDTO = new clsThiSinh_DTO();
     e.Cancel = true;
     thisinhDTO.MaTS = e.NewValues["MaTS"].ToString();
     thisinhDTO.MatKhau = e.NewValues["MatKhau"].ToString();
     thisinhDTO.HoTenLot = e.NewValues["HoTenLot"].ToString();
     thisinhDTO.Ten = e.NewValues["Ten"].ToString();
     thisinhDTO.QuocTich = e.NewValues["QuocTich"].ToString();
     thisinhDTO.NgaySinh = cmn.Convert_DMY_To_MDY(e.NewValues["NgaySinh"].ToString());
     thisinhDTO.NguyenQuan = e.NewValues["NguyenQuan"].ToString();
     thisinhDTO.NoiDKHoKhau = e.NewValues["NoiDKHoKhau"].ToString();
     thisinhDTO.NoiThuongTru = e.NewValues["NoiThuongTru"].ToString();
     thisinhDTO.DienThoai = e.NewValues["DienThoai"].ToString();
     thisinhDTO.DVCongTac = e.NewValues["DVCongTac"].ToString();
     thisinhDTO.CMND = e.NewValues["CMND"].ToString();
     thisinhDTO.NgayCapCMND = cmn.Convert_DMY_To_MDY(e.NewValues["NgayCapCMND"].ToString());
     thisinhDTO.NoiCapCMND = e.NewValues["NoiCapCMND"].ToString();
     thisinhDTO.TrinhDoVanHoa = e.NewValues["TrinhDoVanHoa"].ToString();
     thisinhDTO.NgayDKThi = cmn.Convert_DMY_To_MDY(e.NewValues["NgayDKThi"].ToString());
     thisinhDTO.MaCaThi = e.NewValues["MaCaThi"].ToString();
     thisinhDTO.MaPhong = e.NewValues["MaPhong"].ToString();
     int iReturn = thisinhDAL.InsertUpdate(thisinhDTO);
     if (iReturn >= 0)
     {
         thisinhDTO = new clsThiSinh_DTO();
         thisinhDTO.MaTS = cboPhongThi.Value.ToString();
         thisinhDTO.MaTS = cboCaThi.Value.ToString();
         gvThiSinh.DataSource = loadDataToUI(thisinhDTO);
         gvThiSinh.CancelEdit();
     }
     else
     {
         strMess = "Lưu Dữ Liệu Không Thành Công";
         gvThiSinh.DoRowValidation();
     }
 }
コード例 #17
0
 public int InsertUpdate(clsThiSinh_DTO thisinhDTO)
 {
     try
     {
         ListDictionary _list = new ListDictionary();
         _list.Add("old_id", thisinhDTO.OldID);
         _list.Add("MaTS", thisinhDTO.MaTS);
         _list.Add("MatKhau", thisinhDTO.MatKhau);
         _list.Add("HoTenLot", thisinhDTO.HoTenLot);
         _list.Add("Ten", thisinhDTO.Ten);
         _list.Add("QuocTich", thisinhDTO.QuocTich);
         _list.Add("NgaySinh", thisinhDTO.NgaySinh);
         _list.Add("NguyenQuan", thisinhDTO.NguyenQuan);
         _list.Add("NoiDKHoKhau", thisinhDTO.NoiDKHoKhau);
         _list.Add("NoiThuongTru", thisinhDTO.NoiThuongTru);
         _list.Add("DienThoai", thisinhDTO.DienThoai);
         _list.Add("DVCongTac", thisinhDTO.DVCongTac);
         _list.Add("CMND", thisinhDTO.CMND);
         _list.Add("NgayCapCMND", thisinhDTO.NgayCapCMND);
         _list.Add("NoiCapCMND", thisinhDTO.NoiCapCMND);
         _list.Add("TrinhDoVanHoa", thisinhDTO.TrinhDoVanHoa);
         _list.Add("NgayDKThi", thisinhDTO.NgayDKThi);
         _list.Add("MaCaThi", thisinhDTO.MaCaThi);
         _list.Add("MaPhong", thisinhDTO.MaPhong);
         int iReturn = obj.ExcSql("Insert_Update_Thi_Sinh", _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
     }
 }
コード例 #18
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();
        }
    }