public string DiemDanh(string ScheduleID, string StudentID, string StudentStatusID, string StudyRecord, string CoPhep)
    {
        int result = -1;
        try
        {
            ThuVien tv = new ThuVien();
            result = tv.SP_ExcecutePro("USP_Student_FurloughProcess", new string[] { "@ScheduleID", "@StudentID", "@StudentStatusID", "@StudyRecord", "@CoPhep", "@ModifyPeopleID" }, new object[] { ScheduleID, StudentID, StudentStatusID, StudyRecord, CoPhep, HttpContext.Current.Session["loginPeopleID"] });

        }
        catch (Exception ex)
        {
            result = -1;
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi Quản lý học viên", ex.ToString(), true);

        }

        if (result == 0)
        {
            return "Không thành công, vui lòng báo trung tâm";
        }
        else if (result > 0)
        {
            return "Thao tác thành công";
        }
        else if (HttpContext.Current.Session["PeopleCode"] + "" == "")
            return "Lỗi từ phía server làm session bị mất. Chỉ còn cách login lại";
        else
            return "Lỗi chưa xác định. result: " + result.ToString() + " USP_Student_FurloughProcess";
    }
Пример #2
0
    protected void btnLuu_Click(object sender, EventArgs e)
    {
        try
        {
        string strValid;
        strValid = isValidFillForm();

        if (strValid != "OK")
        {
            lblThongBao.Text = strValid;
            return;
        }
        DegreeTypeID = ddlLoaiChuongTrinh.SelectedValue;
        DegreeID = Session["DegreeID"] + "";

        DegreeCode = txtMaTD.Text;
        DegreeNameVN = txtTenTD.Text;
        DegreeNameEN = txtTenEN.Text;
        Description = txtMoTa.Text;

        if (Convert.ToInt32(Session["themsua"]) == 1)
            f_AddData();
        if (Convert.ToInt32(Session["themsua"]) == 2)
            f_EditData();
        }
        catch (Exception ex)
        {
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi Quản lý học viên", ex.ToString(), true);

        }
    }
Пример #3
0
        public static bool SendMailHistory(string OrderCode, string from, string to, string cc, string bcc, string subject, string body, string username)
        {
            try
            {
                //SendMail sendmail = new SendMail(from, to, cc, bcc, subject, body);
                //sendmail.Send2();

                SGmail smail = new SGmail();
                smail.SendMail(to, subject, body);

                //Insert History Email
                SqlParameter[] param = new SqlParameter[8];
                param[0] = new SqlParameter("@OrderCode", OrderCode);
                param[1] = new SqlParameter("@EmailTo", to);
                param[2] = new SqlParameter("@EmailFrom", from);
                param[3] = new SqlParameter("@EmailCc", cc);
                param[4] = new SqlParameter("@EmailBcc", bcc);
                param[5] = new SqlParameter("@Subject", subject);
                param[6] = new SqlParameter("@Body", body);
                param[7] = new SqlParameter("@SendBy", username);
                SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringShopCake, CommandType.StoredProcedure, "HistoryEmail_Insert", param);

                return true;
            }
            catch { return false; }
        }
Пример #4
0
    protected void btnLuu_Click(object sender, EventArgs e)
    {
        try
        {
            string strValid;
            strValid = isValidFillForm();

            if (strValid != "OK")
            {
                lblThongBao.Text = strValid;
                return;
            }

            Dic_SchoolFeeID = Session["Dic_SchoolFeeID"] + "";
            DegreeID = ddlTrinhDo.SelectedValue;
            MonthlySchoolFee = txtHocPhi.Text.Replace(".", "");
            UnitPrice = lblHocPhiBuoi.Text.Replace(".", "");
            EmplementDate = Convert.ToDateTime(txtNgayQuyetDinh.Text);
            IsCurrent = chkIsCurrent.Checked.ToString();
            if (IsCurrent == "True")
                IsCurrent = "1";
            else
                IsCurrent = "0";
            Note = txtGhiChu.Text;

            if (Convert.ToInt32(Session["themsua"]) == 1)
                f_AddData();
            if (Convert.ToInt32(Session["themsua"]) == 2)
                f_EditData();
        }
        catch (Exception ex)
        {
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi Quản lý học viên", ex.ToString(), true);

        }
    }
    public string PayedSalaryTeacher(int OuputMoneyID)
    {
        int result = -1;
        try
        {
            ThuVien tv = new ThuVien();
            result = tv.SP_ExcecutePro("USP_PayedSalaryTeacher_Update", new string[] { "@OuputMoneyID", "@OperatorID" }, new object[] { OuputMoneyID, HttpContext.Current.Session["loginPeopleID"] });

        }
        catch (Exception ex)
        {
            result = -1;
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi Quản lý học viên", ex.ToString(), true);

        }
        if (result > 0)
        {
            return "Success";
        }else
            return "Lỗi chưa xác định";
    }
Пример #6
0
    private void f_DeleteData(string DegreeID)
    {
        int result = -1;
        try
        {
            tv2 = new ThuVien();
            result = tv2.SP_ExcecutePro("USP_Degree_Update", new string[] {"@flag", "@DegreeID", "@isDeleted", "@OperatorID" }, new object[] { 2, DegreeID, 1, Session["loginPeopleID"] });
        }
        catch (Exception ex)
        {
            result = -1;
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi ", ex.ToString(), true);
        }
        if (result <= 0)
        {
            lblThongBao.Text = "Xóa không được";
        }
        else
        {

            f_ShowData();
            lblThongBao.Text = "Xóa thành công";
        }
    }
Пример #7
0
    private void f_DeleteData(string BranchID)
    {
        int result = -1;
        try
        {
            tv2 = new ThuVien();
            result = tv2.SP_ExcecutePro("USP_Branch_Delete", new string[] { "@BranchID", "@OperatorID" }, new object[] { BranchID, Session["loginPeopleID"] });
        }
        catch (Exception ex)
        {
            result = -1;
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi ", ex.ToString(), true);
        }
        if (result <= 0)
        {
            lblThongBao.Text = Common.msgCannotDelete;
        }
        else
        {

            f_ShowData();
            lblThongBao.Text = "Xóa thành công";
        }
    }
    private void f_DeleteData(string PPID, string SGID)
    {
        int result = -1;
        try
        {
            tv = new ThuVien();
            result = tv.SP_ExcecutePro("[USP_UserRole_Delete]", new string[] { "@PeopleID", "@Sys_GroupID" }, new object[] { PPID, SGID });
        }
        catch (Exception ex)
        {
            result = -1;
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi ", ex.ToString(), true);
        }
        if (result <= 0)
        {
            lblThongBao.Text = "Cấp quyền không được";
        }
        else
        {

            f_ShowData();
            lblThongBao.Text = "Cấp quyền thành công";
        }
    }
Пример #9
0
    private void f_DeleteData(string SchoolFeeID)
    {
        int result = -1;
        try
        {
            tv1 = new ThuVien();
            result = tv1.SP_ExcecutePro("USP_Holiday_Delete", new string[] { "@flag", "@HolidayID" }, new object[] { 1, HolidayID });
        }
        catch (Exception ex)
        {
            result = -1;
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi ", ex.ToString(), true);
        }
        if (result <= 0)
        {
            lblThongBao.Text = "Xóa không được";
        }
        else
        {

            f_ShowData();
            f_ThemLuuXoa(true, true, false);
            Session["themsua"] = 1;
            setEmpty();
            lblThongBao.Text = "Xóa thành công";
        }
    }
    protected void btnLuu_Click(object sender, EventArgs e)
    {
        try
        {
            int tc;
            tc = 0;
            string strValid;
            strValid = isValidFillForm();

            if (strValid != "OK")
            {
                lblThongBao.Text = strValid;
                return;
            }

            BranchID = ddlTrungTam.SelectedValue;
            ClassID = ddlLop.SelectedValue;
            StudentID = ddlHocVien.SelectedValue;
            Present = "0";
            isFurloughAbsent = "1";
            StudyRecord = txtGhiChu.Text;
            OperatorID = Session["loginPeopleID"].ToString();

            //if (Convert.ToInt32(Session["themsua"]) == 1)
            //{
            if (ddlNgayThuNhat.SelectedIndex != 0)
            {
                f_UpdateData(ddlNgayThuNhat.SelectedValue);
            }

            if (ddlNgayThuHai.SelectedIndex != 0)
            {
                f_UpdateData(ddlNgayThuHai.SelectedValue);
            }
            //}

            //if (Convert.ToInt32(Session["themsua"]) == 2)
            //    f_EditData();

            //lblThongBao.Text = Common.msgSaveComplete;
            //Giãn ngày đóng học phí
            tv2 = new ThuVien();
            tv2.SP_ExcecutePro("USP_EnterClass_Update", new string[] { "@flag", "@EnterClassID", "@PayDate" }, new object[] { 2, Session["EnterClassID"], Convert.ToDateTime(txtHanNop.Text).ToString("MM/dd/yyyy") });
            lblThongBao.Text = "Thao tác thành công";

            ddlTrungTam.SelectedIndex = -1;
            ddlTrungTam_SelectedIndexChanged(null, null);
            ddlLop_SelectedIndexChanged(null, null);
            ddlHocVien_SelectedIndexChanged(null, null);
            lblNgayNhapHoc.Text = "";
            lblNgayTinhHP.Text = "";
            txtHanNop.Text = "";
            txtGhiChu.Text = "";
        }
        catch (Exception ex)
        {
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi nè", ex.ToString(), true);
            lblThongBao.Text = "Lưu không được! Vui lòng kiểm tra dữ liệu nhập.";
        }
    }
Пример #11
0
    private void f_EditData()
    {
        int result = -1;
           try
           {
           tv1 = new ThuVien();
           result = tv1.SP_ExcecutePro("USP_Room_Update", new string[] { "@RoomID", "@RoomTypeID", "@BranchID", "@RoomName", "@MaxStudent", "@OperatorID" }, new object[] { RoomID, RoomTypeID, BranchID, RoomName, MaxStudent, Session["loginPeopleID"] });
           }
           catch (Exception ex)
           {
           result = -1;
           //Gửi email báo lỗi
           SGmail sendEmail = new SGmail();
           sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi Quản lý học viên", ex.ToString(), true);

           }
           if (result <= 0)
           {
           lblThongBao.Text = "Không thành công";
           }
           else
           {
           f_ShowData();
           lblThongBao.Text = "Cập nhật thành công";

           f_ThemXoaLuu(true, false, false);
           }
    }
Пример #12
0
    private void f_AddData()
    {
        int result = -1;
           try
           {
           result = tv1.SP_ExcecutePro("USP_Room_Insert", new string[] { "@RoomTypeID", "@BranchID", "@RoomName", "@MaxStudent", "@OperatorID" }, new object[] { RoomTypeID,BranchID,RoomName,MaxStudent,Session["loginPeopleID"] });
           }
           catch (Exception ex)
           {
           result = -1;
           //Gửi email báo lỗi
           SGmail sendEmail = new SGmail();
           sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi nè", ex.ToString(), true);
           }

           if (result < 0)
           {
           lblThongBao.Text = "Thêm không thành công";
           }
           else
           {
           f_ThemXoaLuu(false, false, true);

           f_ShowData();
           lblThongBao.Text = "Thêm Thành công";
           }
    }
Пример #13
0
    //Đóng học phí lúc đăng ký @3
    private int f_AddSchoolFee(string StudentID)
    {
        int result = -1;
        try
        {
            if (ddlTrungTam.SelectedIndex > 0 && ddlLop.SelectedIndex > 0 && ddlTrinhDo.SelectedIndex > 0 && txtNgayNhapHoc.Text.Trim() != "" && txtSoTienNap.Text.Trim() != "" && txtSoBuoi.Text.Trim() != "")
            {
                tv1 = new ThuVien();
                result = tv1.SP_ExcecutePro("USP_SchoolFee_Insert", new string[] { "@flag", "@StudentID", "@BranchID", "@ClassID", "@Dic_SchoolFeeID", "@OperatorID", "@ChietKhau", "@Money", "@Period", "@SessionNumber", "@listSoBuoiThamGiaDuoc", "@IsCoLichDiHocRieng", "@FromPayDate", "@ToPayDate", "@OddMoney", "@Note" },
                    new object[] { 1, StudentID, ddlTrungTam.SelectedValue, ddlLop.SelectedValue, ddlTrinhDo.SelectedValue, Session["loginPeopleID"].ToString(), txtChieuKhau.Text, txtSoTienNap.Text.Replace(".", ""), 1, txtSoBuoi.Text, Session["listSoBuoiThamGiaDuoc"], Session["IsCoLichDiHocRieng"], Convert.ToDateTime(txtNgayNhapHoc.Text).ToString("MM/dd/yyyy"), Convert.ToDateTime(Session["ToFromPayDate"]).ToString("MM/dd/yyyy"), lblDu.Text != "" ? lblDu.Text.Substring(lblDu.Text.IndexOf(": ") + 1).Replace(".", "") : "", "Đóng lúc đăng ký" });
            }
        }
        catch (Exception ex)
        {
            lblThongBao.Text = "Vui lòng Kiểm tra dữ liệu nhập";
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi nè", ex.ToString(), true);
        }

        return result;
    }
    private void f_EditData()
    {
        int result = -1;
        try
        {
            tv1 = new ThuVien();
            result = tv1.SP_ExcecutePro("USP_Sys_Group_Rule_Update", new string[] { "@Sys_Group_ID", "@Sys_Object_ID", "@AllowAccess", "@ModifyPeopleID" }, new object[] { SysGroupID, SysObjectID, AllowAccess, Session["loginPeopleID"] });
        }
        catch (Exception ex)
        {
            result = -1;
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi Quản lý học viên", ex.ToString(), true);

        }
        if (result <= 0)
        {
            lblThongBao.Text = "Không thành công";
        }
        else
        {
            f_ShowData();
            lblThongBao.Text = "Cập nhật thành công";

            f_ThemXoaLuu(true, false, false);
        }
    }
    private void f_AddData()
    {
        int result = -1;
        try
        {
            result = tv1.SP_ExcecutePro("USP_Sys_Group_Rule_Insert", new string[] { "@Sys_Group_ID", "@Sys_Object_ID", "@AllowAccess", "@ModifyPeopleID" }, new object[] { SysGroupID, SysObjectID, AllowAccess, Session["loginPeopleID"] });
        }
        catch (Exception ex)
        {
            result = -1;
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi nè", ex.ToString(), true);
        }

        if (result < 0)
        {
            lblThongBao.Text = "Thêm không thành công";
        }
        else
        {
            f_ThemXoaLuu(false, false, true);

            f_ShowData();
            lblThongBao.Text = "Thêm Thành công";
        }
    }
    private void f_AddData()
    {
        int result = -1;
        try
        {
            result = tv1.SP_ExcecutePro("USP_TeacherType_Insert", new string[] { "@TeacherTypeCode", "@TeacherTypeName", "@Description", "@Note" }, new object[] { TeacherTypeCode, TeacherTypeName, Description, Note });
        }
        catch (Exception ex)
        {
            result = -1;
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi nè", ex.ToString(), true);
        }

        if (result < 0)
        {
            lblThongBao.Text = "Thêm không thành công";
        }
        else
        {
            f_ThemXoaLuu(false, false, true);

            f_ShowData();
            lblThongBao.Text = "Thêm Thành công";
        }
    }
    private void f_EditData()
    {
        int result = -1;
        try
        {
            tv1 = new ThuVien();
            result = tv1.SP_ExcecutePro("USP_TeacherType_Update", new string[] { "@TeacherTypeID", "@TeacherTypeCode", "@TeacherTypeName", "@Description", "@Note" }, new object[] { TeacherTypeID, TeacherTypeCode, TeacherTypeName, Description, Note });
        }
        catch (Exception ex)
        {
            result = -1;
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi Quản lý học viên", ex.ToString(), true);

        }
        if (result <= 0)
        {
            lblThongBao.Text = "Không thành công";
        }
        else
        {
            f_ShowData();
            lblThongBao.Text = "Cập nhật thành công";

            f_ThemXoaLuu(true, false, false);
        }
    }
    public string GuiHocThu(string StudentID, string ScheduleID, string LyDoHocThu, string ClassID)
    {
        int result = -1;
        try
        {
            ThuVien tv = new ThuVien();
            result = tv.SP_ExcecutePro("USP_Student_TrialLesson", new string[] { "@flag", "@StudentID", "@ScheduleID", "@LyDoHocThu", "@ClassID" }, new object[] { 1, StudentID, ScheduleID, LyDoHocThu, ClassID });

            if (result == -2)
            {
                return "Bạn đã đăng ký học thử";
            }
            else if (result == -3)
            {
                return "Ngày học không có trong lịch của lớp này";
            }
            else if (result == 0)
            {
                return "Không thành công, vui lòng báo trung tâm";
            }
            else if (result > 0)
            {
                return "Gửi thành công, chờ trung tâm xét duyệt";
            }
            else
                return "Lỗi chưa xác định";
        }
        catch (Exception ex)
        {
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi ", ex.ToString(), true);
            return "Lỗi trong Exception ex";
        }
    }
    private void f_EditData()
    {
        int result = -1;
        try
        {
            tv1 = new ThuVien();
            //result = tv1.SP_ExcecutePro("USP_EnterClass_Update", new string[] { "@flag", "@EnterClassID", "@StudentID", "@BranchID", "@ClassID", "@DegreeID", "@OperatorID", "@EnterClassDate", "@PayDate", "@StudyRecord" },
            //    new object[] { 1, EnterClassID, StudentID, BranchID, ClassID, DegreeID, OperatorID, EnterClassDate, PayDate, StudyRecord });
        }
        catch (Exception ex)
        {
            result = -1;
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi Quản lý học viên", ex.ToString(), true);

        }
        if (result <= 0)
        {
            lblThongBao.Text = "Không thành công";
        }
        else
        {
            f_ShowData();
            lblThongBao.Text = "Cập nhật thành công";

            f_ThemXoaLuu(true, false, false);
        }
    }
    private void f_Authorization(string PPID, string GPPID, string strSysGroupIDCheck, string strSysGroupIDUnCheck)
    {
        int result = -1;
        try
        {
            tv = new ThuVien();
            result = tv.SP_ExcecutePro("USP_UserRole_Insert", new string[] { "@PeopleID", "@ModifyPeopleID", "@strRoleCheck", "@strRoleUnCheck" }, new object[] { PPID, GPPID, strSysGroupIDCheck, strSysGroupIDUnCheck });
        }
        catch (Exception ex)
        {
            result = -1;
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi nè", ex.ToString(), true);
        }

        if (result < 0)
        {
            lblThongBao.Text = "Cấp quyền không thành công";
        }
        else
        {
            f_ThemXoaLuu(false, false, true);

            f_ShowData();
            lblThongBao.Text = "Cấp quyền Thành công";
        }
    }
Пример #21
0
    private void f_DeleteData(string EnterClassID)
    {
        int result = -1;
        try
        {
            tv2 = new ThuVien();
            result = tv2.SP_ExcecutePro("USP_EnterClass_Delete", new string[] { "@EnterClassID" }, new object[] { EnterClassID });
        }
        catch (Exception ex)
        {
            result = -1;
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi ", ex.ToString(), true);
        }
        if (result <= 0)
        {
            lblThongBao.Text = "Xóa không được";
        }
        else
        {

            f_ShowData();
            lblThongBao.Text = "Xóa thành công";
        }
    }
    private int f_CheckData(string PPID, string SGID)
    {
        int result = -1;
        DataTable tbSys;
        try
        {
            tv = new ThuVien();
            tbSys = tv.SP_SelectDataTable("USP_UserRole_CheckPeopleIDAndSysGroupID", new string[] { "@PeopleID", "@Sys_GroupID" }, new object[] { PPID, SGID });
            result = tbSys.Rows.Count;
        }
        catch (Exception ex)
        {
            result = -1;
            //Gửi email báo lỗi
            SGmail sendEmail = new SGmail();
            sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi nè", ex.ToString(), true);
        }

        if (result < 0)
        {
            lblThongBao.Text = "Kiểm tra không thành công";
        }
        return result;
    }