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"; }
protected void gvPhongHc_SelectedIndexChanged(object sender, EventArgs e) { try { int Result = -1; lblThongBao.Text = ""; if (gvPhongHc.Rows.Count > 0) { ScheduleID = gvPhongHc.SelectedDataKey["ScheduleID"].ToString(); string StudentID = gvPhongHc.SelectedDataKey["StudentID"].ToString(); string DaDuyet = HttpUtility.HtmlDecode(gvPhongHc.SelectedRow.Cells[1].Text); if (DaDuyet == "Rồi") { lblThongBao.Text = "Học viên bạn chọn đã được duyệt cho học trước đây"; return; } StudentName = gvPhongHc.SelectedRow.Cells[2].Text; Email = gvPhongHc.SelectedRow.Cells[4].Text; Date = gvPhongHc.SelectedRow.Cells[5].Text; DayOfWeek = gvPhongHc.SelectedRow.Cells[6].Text; tv2 = new ThuVien(); Result = tv2.SP_ExcecutePro("USP_Student_Update", new string[] { "@flag", "@StudentID", "@ModifyPeopleID" }, new object[] { 3, StudentID, Session["loginPeopleID"] }); if (Result > 0) { //Cập nhật thành công lblThongBao.Text = "Học viên <span style='color:red'>" + StudentName + "</span> đã được chấp nhận cho học thử. Một email đã được gửi cho học viên"; f_ShowData(); //Gửi email int iTB = sendEmail.SendMailForTechnical(Email, "Thông báo học thử SeaGuitar", "Chúng tôi đồng ý cho bạn học thử vào ngày thứ " + DayOfWeek + " ngày " + Date, true); if (iTB <= 0) { lblThongBao.Text = "Lỗi gửi email... Vui lòng thông báo cho chúng tôi biết"; lblThongBao.ForeColor = System.Drawing.Color.Red; } } else { lblThongBao.Text = "Thao tác không thành công"; } } else lblThongBao.Text = "Không còn học viên nào xin học thử nữa"; } catch (Exception ex) { //Gửi email báo lỗi sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi", ex.ToString(), true); } }
//@1 public string DongYHocThu(string ScheduleID, string BranchID, string ClassID, string StudentID) { int result = -1; ThuVien tv = new ThuVien(); result = tv.SP_ExcecutePro("USP_Student_Update", new string[] { "@flag", "@BranchID", "@ClassID", "@StudentID", "@ModifyPeopleID" }, new object[] { 3, BranchID, ClassID, StudentID, HttpContext.Current.Session["loginPeopleID"] }); 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 return "Lỗi chưa xác định"; }
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"; }
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"; } }
protected void btnLuu_Click(object sender, EventArgs e) { int result = -1; string strValid; lblThongBao.Text = ""; DeleteSpaceCharacter(); strValid = isValidFillForm(); if (strValid != "OK") { lblThongBao.Text = strValid; lblThongBao.ForeColor = System.Drawing.Color.Red; return; } try { SelectedPeopleCode = Session["SelectedPeopleCode"].ToString(); Ability = txtKhaNangAmNhac.Text; Introduction = txtLoiGioiThieu.Text; FavouriteSong = txtBaiHatUaThich.Text; int rs = 1; //HV đang học thì Chuyển lớp if ((Session["StudentStatusID"] + "" == "2") && (ddlTrangThai.SelectedValue == "2") && chkChuyenLop.Checked) { //Phòng chưa bấm nút refresh rs = fnCalChuyenLop(); if (rs == 0) return; tv1 = new ThuVien(); result = tv1.SP_ExcecutePro("USP_EnterClass_Insert", new string[] { "@flag", "@StudentID", "@BranchID", "@ClassID", "@DegreeID", "@NewBranchID", "@NewClassID", "@Dic_SchoolFeeID", "@OperatorID", "@NewEnterClassDate", "@Note", "@SessionNumber", "@SchoolFee" }, new object[] { 2, Session["selectedPeopleID"], Session["BranchID"], Session["ClassID"], Session["DegreeID"], ddlTrungTam.SelectedValue, ddlLop.SelectedValue, ddlTrinhDo.SelectedValue, Session["loginPeopleID"], Convert.ToDateTime(txtNgayChuyenLop.Text).ToString("MM/dd/yyyy"), "Chuyển lớp", lblSoBuoiCon.Text, Session["NewSchoolFee"] }); } //@2 HV đi học lại sau khi bảo lưu else if ((Session["StudentStatusID"] + "" == "3") && ddlTrangThai.SelectedValue == "2") { //Phòng chưa bấm nút refresh rs = fnCalChuyenLop(); if (rs == 0) return; if (txtNgayChuyenLop.Text.Trim() == "") { lblThongBao.ForeColor = System.Drawing.Color.Red; lblThongBao.Text = "Bạn chưa chọn ngày đi học lại"; return; } tv1 = new ThuVien(); result = tv1.SP_ExcecutePro("USP_Reservation_Update", new string[] { "@flag", "@StudentID", "@BranchID", "@ClassID", "@DegreeID", "@Dic_SchoolFeeID", "@Date", "@NewBranchID", "@NewClassID", "@NewDegreeID", "@NewDic_SchoolFeeID", "@OperatorID", "@Note", "@TotalSession", "@Money", "@isChuyenLop" }, new object[] { 2, Session["selectedPeopleID"], Session["BranchID"], Session["ClassID"], Session["DegreeID"], Session["Dic_SchoolFeeID"], Convert.ToDateTime(txtNgayChuyenLop.Text).ToString("MM/dd/yyyy"), ddlTrungTam.SelectedValue, ddlLop.SelectedValue, "", ddlTrinhDo.SelectedValue, Session["loginPeopleID"], "Đi học lại - hết bảo lưu", lblSoBuoiCon.Text, Session["NewSchoolFee"], chkChuyenLop.Checked }); }//HV đang học giờ bảo lưu else if ((Session["StudentStatusID"] + "" == "2") && ddlTrangThai.SelectedValue == "3") { //Phòng chưa bấm nút refresh rs = fnCalBaoLuu(); if (rs == 0) return; string s = lblTrangThai.Text; int ChieuDaiChuoi = s.Length; //Học tại: Trung tâm 7A, 4.6_19.30 (T.Hadan) chưa học: 12 , sẽ được bảo lưu int ViTriSoBuoiTrongChuoi = s.LastIndexOf(": ") + 2; int ViTriSauSoBuoi = s.LastIndexOf(" , sẽ "); int SoBuoi = ViTriSauSoBuoi - ViTriSoBuoiTrongChuoi; string strSoBuoi = s.Substring(ViTriSoBuoiTrongChuoi, SoBuoi); //Thực hiện bảo lưu @3 tv1 = new ThuVien(); int resultTHBL = tv1.SP_ExcecutePro("USP_Reservation_Insert", new string[] { "@StudentID", "@Dic_SchoolFeeID", "@Date", "@TotalSession", "@Money", "@Note", "@OperatorID" }, new object[] { Session["selectedPeopleID"], ddlTrinhDo.SelectedValue, Convert.ToDateTime(txtNgayBaoLuu.Text).ToString("MM/dd/yyyy"), strSoBuoi, 0, "Bảo lưu từ form Update", Session["loginPeopleID"] }); } //Sau khi thông tin Chỗ linh tinh trạng thái điền thành công if (rs == 0) return; else if (rs == 1) { tv = new ThuVien(); result = tv.SP_ExcecutePro("USP_Student_Update", new string[] { "@flag", "@StudentID", "@StudentStatusID", "@Introduction", "@FavouriteSong", "@Ability", "@ModifyPeopleID" }, new object[] { 3, Session["selectedPeopleID"], ddlTrangThai.SelectedValue, Introduction, FavouriteSong, txtKhaNangAmNhac.Text, Session["loginPeopleID"] }); if (result == 1) Session["StudentStatusID"] = ddlTrangThai.SelectedValue; } } catch (Exception ex) { result = -1; //Gửi email báo lỗi sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi cập nhật Học viên", ex.ToString(), true); } if (result <= 0) { // lblThongBao2.Text = "Không thành công"; lblThongBao.ForeColor = System.Drawing.Color.Red; lblThongBao.Text = "Không thành công"; } else { lblThongBao.ForeColor = System.Drawing.Color.Yellow; lblThongBao.Text = "Cập nhật thành công"; } }
protected void btnLuu_Click(object sender, EventArgs e) { lblThongBao.Text = ""; lblThongBao.ForeColor = System.Drawing.Color.Red; int result = -1; try { DeleteSpaceCharacter(); string strValid; strValid = isValidFillForm(); if (strValid != "OK") { lblThongBao.Text = strValid; return; } ibtnReCalculate_Click(null, null); string FirstPart, LastPart; FirstPart = ddlLoaiThanhVien.SelectedValue; LastPart = rbtKiemNhiem.SelectedValue; if (LastPart == "GH" || LastPart == "GU") MaTV = LastPart + FirstPart; else MaTV = FirstPart + LastPart; daPeople.fPeopleCode = MaTV; daPeople.fUserName = txtTenDangNhap.Text; daPeople.fLastName = txtLastName.Text; daPeople.fFirstName = txtFirstName.Text; //cm upload image //string pre_fileName = Session["PeopleImage"]+""; if (FileUploadAvatar.HasFile) { string fileName = FileUploadAvatar.FileName; //if (!string.IsNullOrEmpty(pre_fileName)) //{ //Trường hợp đã có file trước đây nhưng Upload tiếp -> xóa đi file trước đây //common.deleteFile(pre_fileName, PhysicalImgFolder); fileName = common.renameFileIfExists(fileName, PhysicalImgFolder); //} //cm Get the name of the file to upload. FileUploadAvatar.SaveAs(PhysicalImgFolder + fileName); //Lấy tên file mới Session["PeopleImage"] = fileName; daPeople.fPhoto = fileName; common.ResizeImage(PhysicalImgFolder, fileName, 100, FileUploadAvatar.PostedFile.InputStream); } //else //Chưa browser file //{ // if (!string.IsNullOrEmpty(pre_fileName)) // { // daPeople.fPhoto = pre_fileName; // } // //else // //{ // // lblThongBao.Text = "Bạn chưa chọn hình ảnh"; // // return; // //} //} if (!txtDateNgaySinh.Text.Trim().Equals(string.Empty)) { daPeople.fBirthday = txtDateNgaySinh.Text; } if (RadioButtonList1.SelectedValue == "1") { daPeople.fGender = true; } else { daPeople.fGender = false; } daPeople.fCellPhone = txtMobile.Text; daPeople.fHomePhone = txtHomePhone.Text; //Thường trú daPeople.fResident = txtThuongTru.Text; string TT_ToaDo = txtTT_ToaDo.Text; TT_ToaDo = TT_ToaDo.Replace(",", "_"); TT_ToaDo = TT_ToaDo.Replace(".", ","); TT_ToaDo = TT_ToaDo.Replace("_", "."); if (!TT_ToaDo.Equals("")) { daPeople.fLatitude = TT_ToaDo.Substring(0, TT_ToaDo.IndexOf(".")); daPeople.fLongitude = TT_ToaDo.Substring(TT_ToaDo.IndexOf(".") + 1); } //Tạm trú daPeople.fStayProvisionally = txtTamTru.Text; string Tam_ToaDo = txtTam_ToaDo.Text; Tam_ToaDo = Tam_ToaDo.Replace(",", "_"); Tam_ToaDo = Tam_ToaDo.Replace(".", ","); Tam_ToaDo = Tam_ToaDo.Replace("_", "."); if (!Tam_ToaDo.Equals("")) { daPeople.fLongitudeStayProvisionally = Tam_ToaDo.Substring(0, Tam_ToaDo.IndexOf(".")); daPeople.fLatitudeStayProvisionally = Tam_ToaDo.Substring(Tam_ToaDo.IndexOf(".") + 1); } daPeople.fEmail = txtEmail.Text; daPeople.fYahoo = txtYahoo.Text; daPeople.fSkyper = txtSkyper.Text; daPeople.fSocialWebiste = txtFaceweb.Text; daPeople.fCareer = txtNgheNghiep.Text; daPeople.fDescription = txtLoiGioiThieu.Text; //Mật khẩu string PassEncode; PassEncode = Cipher.EncryptText(txtMatKhau.Text, WebConfigurationManager.AppSettings["HomeFolder"]); daPeople.fPassword = PassEncode; if (loginPeopleCode != "") { daPeople.fActive = 1; } daPeople.fisDeleted = false; daPeople.fOperatorID = Session["loginPeopleID"]; //Thực hiện Insert vào Thành viên resultInsertPeople = daPeople.USP_People_Insert(); if (resultInsertPeople <= 0) //Thực hiện insert Member k thành công { lblThongBao.Text = "Không thành công"; lblThongBao.ForeColor = System.Drawing.Color.Red; } else //insert Member thành công { ///HỌC VIÊN //Nếu là Học viên thì có thông tin riêng. if (MaTV == "HV") { StudentID = resultInsertPeople; Introduction = txtLoiGioiThieu.Text; FavouriteSong = txtBaiHatUuThich.Text; f_UpdateDataToStudent(StudentID); //Thông tin nhập học của học viên if (ddlTrungTam.SelectedIndex > 0 && ddlLop.SelectedIndex > 0 && ddlTrinhDo.SelectedIndex > 0) { BranchID = ddlTrungTam.SelectedValue; ClassID = ddlLop.SelectedValue; DegreeID = ddlTrinhDo.SelectedValue; if(!txtNgayNhapHoc.Text.Trim().Equals("")) EnterClassDate = Convert.ToDateTime(txtNgayNhapHoc.Text).ToString("MM/dd/yyyy"); tv1 = new ThuVien(); resultInsertEnterClass = tv1.SP_ExcecutePro("USP_EnterClass_Insert", new string[] { "@flag", "@StudentID", "@BranchID", "@ClassID", "@Dic_SchoolFeeID", "@OperatorID", "@EnterClassDate" }, new object[] { 3, StudentID, BranchID, ClassID, DegreeID, Session["loginPeopleID"], EnterClassDate }); if (resultInsertEnterClass < 0) { lblThongBao.Text = "Thêm Thông tin Nhập học không thành công"; return; } } } if (loginPeopleCode == "") //Visitor đăng ký { //Tạo Mã active string ActiveCode = ""; ActiveCode = Cipher.EncryptText(DateTime.Now.ToString(), "SaltKeyCC"); //insert vào bảng tạm TempPeople daTempPeople = new TempPeople(); int rsTempPeople = -1; rsTempPeople = daTempPeople.USP_TempPeople_Insert(resultInsertPeople, ActiveCode); if (rsTempPeople <= 0) { lblThongBao.Text = "Kiểm tra lại dữ liệu nhập"; lblThongBao.ForeColor = System.Drawing.Color.Red; //Email báo kỹ thuật return; } else //Insert vô bảng tạm thành công { //Gửi email mã kích hoạt string host = HttpContext.Current.Request.Url.AbsoluteUri; host = host.Substring(0, host.IndexOf("?")); int iTB = sendEmail.SendMailForTechnical(txtEmail.Text, "Kích hoạt thành viên SeaGuitar", "Vui lòng mở link này để kích hoạt tài khoản <a href='" + host + "?s=active&ac=" + ActiveCode + "' target='_blank'>" + host + "?s=active&ac=" + ActiveCode + "</a>", true); if (iTB <= 0) { //Nếu có lỗi gửi email thì xem như đéo cần email int result2 = daPeople.USP_People_Update_Status(resultInsertPeople, true); if (result2 < 0) { lblThongBao.Text = "Lỗi khi xử lý"; return; } else { lblThongBao.Text = "Chúc mừng bạn đã là thành viên chính thức! Gửi admin mã kết quả '01' nhé."; } } else { lblThongBao.Text = "Redirect..."; lblThongBao.ForeColor = System.Drawing.Color.Green; Session["AscxAnnouncement_NoiDung"] = "Chúc mừng thành viên mới"; Session["AscxAnnouncemento_NoiDung"] = "Vui lòng kiểm tra email để kích hoạt tài khoản"; Response.Redirect("/?s=tb",false); } } } else if (loginPeopleCode != "") //Là Giám hiệu, giáo vụ login { //Giám hiệu có thể sẽ có phần đóng học phí if (ddlLoaiThanhVien.SelectedValue == "HV") if (f_AddSchoolFee(resultInsertPeople.ToString()) <= 0) lblThongBao.Text = "Học phí chưa có. "; ///setEmpty(); lblThongBao2.ForeColor = System.Drawing.Color.Yellow; lblThongBao2.Text = "Đã đăng ký thành công, bạn có thể tiếp tục nhập Thành viên, click here! "; imgbtn_ThemThanhVien.Visible = true; } Session["IsCoLichDiHocRieng"] = null; Session["listSoBuoiThamGiaDuoc"] = null; } } catch (Exception ex) { //Gửi email báo lỗi lblThongBao.Text = "Có lỗi trong quá trình thực hiện. Vui lòng kiểm tra lại dữ liệu nhập"; sendEmail.SendMailForTechnical("*****@*****.**", "Lỗi", ex.ToString(), true); } finally { str.Append("PeopleID:" + resultInsertPeople + "; "); str.Append("fPeopleCode:" + MaTV + "; "); str.Append("fUserName:"******"; "); str.Append("fLastName:" + txtLastName.Text + "; "); str.Append("fFirstName:" + txtFirstName.Text + "; "); str.Append("fBirthday:" + txtDateNgaySinh.Text + "; "); str.Append("fStayProvisionally:" + txtTamTru.Text + "; "); str.Append("fEmail:" + txtEmail.Text + "; "); str.Append("fYahoo:" + txtYahoo.Text + "; "); str.Append("fSkyper:" + txtSkyper.Text + "; "); str.Append("fSocialWebiste:" + txtFaceweb.Text + "; "); str.Append("fCareer:" + txtNgheNghiep.Text + "; "); str.Append("fDescription:" + txtLoiGioiThieu.Text + "; "); str.Append("fisDeleted:" + false + "; "); str.Append("fOperatorID:" + Session["loginPeopleID"] + "; "); str.Append("StudentID:" + resultInsertPeople + "; "); str.Append("Introduction:" + txtLoiGioiThieu.Text + "; "); str.Append("FavouriteSong:" + txtBaiHatUuThich.Text + "; "); str.Append("ddlTrungTam: " + ddlTrungTam.Text + "; ddlLop: " + ddlLop.Text + "; ddlTrinhDo: " + ddlTrinhDo.Text); str.Append("Ngày nhập học:" + txtNgayNhapHoc.Text + "; Trạng thái: " + ddlTrangThai.Text); SupportLogger log = new SupportLogger(); log.SP_ExcecutePro("USP_Sys_Log", new string[] { "@flag","@loginPeopleID", "@Module", "@Action", "@IPclient", "@Description" }, new object[] { 1, HttpContext.Current.Session["loginPeopleID"], "USP_People_Insert", "Insert", HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"], str.ToString() }); } }
int f_UpdateDataToStudent() { tv = new ThuVien(); return tv.SP_ExcecutePro("USP_Student_Update", new string[] { "@flag", "@StudentID", "@StudentStatusID", "@Introduction", "@FavouriteSong", "@Ability", "@ModifyPeopleID" }, new object[] { 1, selectedPeopleID, ddlTrangThai.SelectedValue, Introduction, FavouriteSong, txtKhaNangAmNhac.Text, Session["loginPeopleID"] }); }
private void f_EditData() { int result = -1; tv1 = new ThuVien(); //Nếu Lớp hoặc Trình độ bị thay đổi thì các học phí của lớp lúc trước sẽ bị xóa result = tv1.SP_ExcecutePro("USP_EnterClass_Update", new string[] { "@flag", "@EnterClassID", "@StudentID", "@BranchID", "@ClassID", "@DegreeID", "@OperatorID", "@EnterClassDate", "@Note" }, new object[] {1, EnterClassID, StudentID, BranchID, ClassID, DegreeID, OperatorID, EnterClassDate, Note }); 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_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); } }
private void f_EditData() { int result = -1; tv1 = new ThuVien(); result = tv1.SP_ExcecutePro("USP_TeacherSalary_Update", new string[] { "@TeacherSalaryID", "@TeacherTypeID", "@BranchID", "@MonthlySalary", "@EmplementDate", "@ModifyPeopleID" }, new object[] { TeacherSalaryID, TeacherTypeID, BranchID, MonthlySalary, EmplementDate, ModifyPeopleID }); 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 GuiThoiGianRanh(string StudentID, string FreeTime) { int result = -1; ThuVien tv = new ThuVien(); result = tv.SP_ExcecutePro("USP_People_Update", new string[] { "@flag", "@PeopleID", "@Description" }, new object[] { 3, StudentID, FreeTime }); if (result <= 0) { return "Gửi không thành công, Xin liên lạc với trung tâm"; } else { return "Gửi thành công"; } }
//@2 public string GuiHocThuFromAdmin(string PeopleID, string StudentID, string ScheduleID, string BranchID, string ClassID) { int result = -1; ThuVien tv = new ThuVien(); result = tv.SP_ExcecutePro("USP_Student_TrialLesson", new string[] { "@flag", "@ModifyPeopleID", "@StudentID", "@ScheduleID", "@BranchID", "@ClassID" }, new object[] { 2, PeopleID, StudentID, ScheduleID, BranchID, ClassID }); if (result <= 0) { return Common.msgThaoTacKhongTC; } else { return Common.msgSaveComplete; } }
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"; } }
//Đó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; }
protected void gvHocVien_RowDeleting(object sender, GridViewDeleteEventArgs e) { selectedPeopleID = gvHocVien.DataKeys[e.RowIndex].Value.ToString(); tv1 = new ThuVien(); int result = tv1.SP_ExcecutePro("USP_People_Update", new string[] { "@flag", "@PeopleID", "@isDeleted", "@ModifyPeopleID" }, new object[] { 4, selectedPeopleID, 1, Session["loginPeopleID"] }); if (result > 0) { lblThongBao.Text = Common.msgDeleteComplete; btnTimKiem_Click(null, null); } else lblThongBao.Text = "Xoá không thành công"; }
private void f_EditData() { int result = -1; tv1 = new ThuVien(); result = tv1.SP_ExcecutePro("USP_Degree_Update", new string[] { "@flag", "@DegreeID", "@DegreeTypeID", "@DegreeCode", "@DegreeNameVN", "@DegreeNameEN", "@Description", "@OperatorID" }, new object[] { 1, DegreeID, DegreeTypeID, DegreeCode, DegreeNameVN, DegreeNameEN, Description, Session["loginPeopleID"] }); 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); } }
int f_UpdateData(string StudyID) { int result = -1; tv1 = new ThuVien(); result = tv1.SP_ExcecutePro("USP_Study_Update", new string[] { "@flag", "@StudyID", "@OperatorID", "@Present", "@isFurloughAbsent", "@StudyRecord" }, new object[] { 1, StudyID, OperatorID, Present, isFurloughAbsent, StudyRecord }); return result; }
private void f_AddData() { int result = -1; tv1 = new ThuVien(); result = tv1.SP_ExcecutePro("USP_TeacherSalary_Insert", new string[] { "@TeacherTypeID", "@BranchID", "@MonthlySalary", "@EmplementDate", "@ModifyPeopleID" }, new object[] { TeacherTypeID, BranchID == "" ? null : BranchID, MonthlySalary, EmplementDate, ModifyPeopleID }); 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; tv1 = new ThuVien(); result = tv1.SP_ExcecutePro("USP_EnterClass_Insert", new string[] { "@flag", "@StudentID", "@BranchID", "@ClassID", "@DegreeID", "@OperatorID", "@EnterClassDate", "@Note" }, new object[] {1, StudentID, BranchID, ClassID, DegreeID, OperatorID, EnterClassDate, Note }); 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); } }
int f_UpdateDataToStudent(int StudentID) { tv1 = new ThuVien(); return tv1.SP_ExcecutePro("USP_Student_Update", new string[] { "@flag", "@StudentID", "@StudentStatusID", "@Introduction", "@FavouriteSong", "@Ability", "@IsCoLichDiHocRieng", "@NgayCoTheDiHoc", "@ModifyPeopleID" }, new object[] { 1, StudentID, ddlTrangThai.SelectedValue == "0" ? null : ddlTrangThai.SelectedValue, Introduction, FavouriteSong, txtKhaNangAmNhac.Text, Session["IsCoLichDiHocRieng"], Session["listSoBuoiThamGiaDuoc"], Session["loginPeopleID"] }); }
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."; } }
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"; } }
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 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"; } }
protected void btnXoa_Click(object sender, EventArgs e) { object selectedPeopleID = Session["selectedPeopleID"]; tv1 = new ThuVien(); int result = tv1.SP_ExcecutePro("USP_People_Update", new string[] { "@flag", "@PeopleID", "@isDeleted", "@ModifyPeopleID" }, new object[] { 4, selectedPeopleID, 1, Session["loginPeopleID"] }); if (result > 0) { Session["AscxAnnouncement_NoiDung"] = "Đã xóa thành viên thành công"; Session["AscxAnnouncemento_NoiDung"] = "Thực hiện thành công xóa!"; Response.Redirect("/?s=tb", false); } else lblThongBao.Text = "Xoá không thành công"; }
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"; } }
int f_UpdateDataToTeacher() { tv = new ThuVien(); return tv.SP_ExcecutePro("USP_Teacher_Update", new string[] { "@flag", "@TeacherID", "@TeacherTypeID", "@TeacherStatusID", "@Evaluate", "@ModifyPeopleID" }, new object[] { 2, selectedPeopleID, ddlXepLoai.SelectedValue == "0" ? null : ddlXepLoai.SelectedValue, ddlTrangThai.SelectedValue == "0" ? null : ddlTrangThai.SelectedValue, txtDanhGia.Text, Session["loginPeopleID"] }); }
private void f_EditData() { int result = -1; tv1 = new ThuVien(); result = tv1.SP_ExcecutePro("USP_Branch_Update", new string[] { "@BranchID", "@BranchChiefID", "@BranchName", "@Address", "@Phone", "@Latitude", "@Longitude", "@Description", "@OperatorID" }, new object[] { BranchID, BranchChiefID, BranchName, Address, Phone, Latitude, Longitude, Description, Session["loginPeopleID"] }); 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); } }