protected void Page_Load(object sender, EventArgs e) { clsCache.NoCache(); if (!IsPostBack) { if (PreviousPage != null) { ContentPlaceHolder Cntp = (ContentPlaceHolder)Page.Master.FindControl("ContentPlaceHolder1"); if (((HtmlInputHidden)Cntp.FindControl("hidInstID")).Value != null || ((HtmlInputHidden)Cntp.FindControl("hidInstID")).Value != "") { hidInstID.Value = ((HtmlInputHidden)Cntp.FindControl("hidInstID")).Value; } } ContentPlaceHolder Cntph = (ContentPlaceHolder)Page.Master.FindControl("ContentPlaceHolder1"); sInst = (searchInstNew)Cntph.FindControl("SchInst1"); clsUser user = (clsUser)Session["user"]; if (user.UserTypeCode == "2") { hidInstID.Value = user.UserReferenceID; string InstID = hidInstID.Value; hidUniID.Value = Classes.clsGetSettings.UniversityID.ToString(); Server.Transfer("ELGV2_ViewStatus__1.aspx?InstituteID=" + InstID, true); } else { HtmlInputHidden[] hid = new HtmlInputHidden[2]; hid[0] = hidInstID; hid[1] = hidUniID; Common.setHiddenVariables(ref hid); lblPageHead.Text = "View Eligibility Status"; } } lblGridName.Visible = false; //sInst = (searchInstNew)Page.FindControl("SchInst1"); SchInst1.dgData1.RowCommand += new GridViewCommandEventHandler(dgData1_RowCommand); }
protected void btnSignIn_Click(object sender, EventArgs e) { clsUser tempUser = new clsUser(txtUsername.Text.ToString(), txtPassword.Text.ToString()); if (tempUser.validateUser(tempUser.getUsername(), tempUser.getPassword()) == true) { SqlConnection con = new SqlConnection(connStr); SqlDataAdapter sda = new SqlDataAdapter("SELECT userID FROM dbo.Users WHERE userName ='******'", con); DataTable dt = new DataTable(); sda.Fill(dt); int id = (int)dt.Rows[0][0]; clsUser user = new clsUser(id); Session["USER"] = user; Response.Redirect("Profile.aspx"); } else { lblStatus.Text = "User details do not exist."; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["userInformation"] != null) { clsUser currUser = (clsUser)Session["userInformation"]; if (!currUser.IsManager) { Response.Redirect(@"welcome!.aspx"); } else { //current user is manager List <List <string> > usersList = new List <List <string> >(); dbHandler dbh = new dbHandler(); usersList = dbh.getAllUsers(); if (usersList != null) { showUsersToTable(usersList); } } } }
public clsUser GetUser(int userID) { string strQry = string.Format("select * from tblUser with (nolock) where ID={0}", userID); DataTable dtUser = GetUser(strQry); clsUser objUser = null; if (dtUser != null && dtUser.Rows.Count != 0) { DataRow drUser = dtUser.Rows[0]; { objUser = new clsUser() { ID = drUser["ID"] != DBNull.Value ? Convert.ToInt32(drUser["ID"]) : 0, FirstName = drUser["FirstName"] != DBNull.Value ? Convert.ToString(drUser["FirstName"]) : string.Empty, LastName = drUser["LastName"] != DBNull.Value ? Convert.ToString(drUser["LastName"]) : string.Empty, EmailAddress = drUser["emailaddress"] != DBNull.Value ? Convert.ToString(drUser["emailaddress"]) : string.Empty, Gender = drUser["gender"] != DBNull.Value ? Convert.ToInt32(drUser["gender"]) : 0 }; } } return(objUser); }
public JsonResult InsertUser(clsUser _user) { try { var usernm = users.GetByID(x => x.UserName == _user.UserName); if (usernm != null) { return(Json(new { usernm = "UserName already Exist" })); } var emailId = users.GetByID(x => x.Email == _user.Email); if (emailId != null) { return(Json(new { emailId = "Email already Exist" })); } var mobileNo = users.GetByID(x => x.Phone == _user.Phone); if (mobileNo != null) { return(Json(new { mobileNo = "Mobile No. already Exist" })); } tblUser user = new tblUser(); user.UserName = _user.UserName; user.FullName = _user.FullName; user.Email = _user.Email; user.Password = new Helper().Encrypt("welcome_123"); user.Phone = _user.Phone; user.RoleId = _user.RoleId; user.IsBlocked = false; user.DateCreate = DateTime.Now; user.IsDeleted = false; users.Insert(user); users.Save(); return(Json(user)); } catch (Exception ex) { Log.Error(ex.ToString()); } return(Json(null)); }
protected void Page_Load(object sender, EventArgs e) { user = (clsUser)Session["user"]; if (!IsPostBack) { ContentPlaceHolder Cntph1 = (ContentPlaceHolder)Page.PreviousPage.Master.FindControl("ContentPlaceHolder1"); HtmlInputHidden[] hid = new HtmlInputHidden[9]; hid[0] = hidUniID; hid[1] = hidFacID; hid[2] = hidCrID; hid[3] = hidMoLrnID; hid[4] = hidPtrnID; hid[5] = hidBrnID; hid[6] = hidCrPrDetailsID; hid[7] = hidCrPrChID; hid[8] = hid_fk_AcademicYr_ID; Common.setHiddenVariablesMPC(ref hid); lblPageHead.Text = "Provisional Non Provisional Bulk Importing"; } }
public static clsUser SelectUserById(int?AuthorisedUserId) { clsUser objUser = new clsUser(); bool isnull = true; string SpName = "usp_SelectUser"; var objPar = new DynamicParameters(); if (String.IsNullOrEmpty(AuthorisedUserId.ToString())) { throw new ArgumentException("Function parameters cannot be blank!"); } else { try { objPar.Add("@AuthorisedUserId", AuthorisedUserId, dbType: DbType.Int32); using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"])) { objUser = db.Query <clsUser>(SpName, objPar, commandType: CommandType.StoredProcedure).SingleOrDefault(); isnull = false; } } catch (Exception ex) { ErrorHandler.ErrorLogging(ex, false); ErrorHandler.ReadError(); } } if (isnull) { return(null); } else { return(objUser); } }
protected void Page_Load(object sender, EventArgs e) { // Load curent pofile info clsUser user = (clsUser)Session["User"]; if (user == null) { Response.Redirect("/LoginMsg.aspx"); } if (user.AdminLogin) { Response.Redirect("/Unauthorized.aspx"); } if (!IsPostBack) { lblFullName.Text = user.FullName; profileimg.ImageUrl = "/Content/profile/" + user.Picture; BindCoupons(); } }
public static void CookieGetSession(clsUser AdminUser) { if (HttpContext.Current.Request.Cookies["LoginCookies"] != null) { string strValue = HttpContext.Current.Request.Cookies["LoginCookies"].Value; string[] sValue = strValue.Split('#'); if (sValue.Length > 3) { AdminUser.UserId = Convert.ToInt32(sValue[1]); AdminUser.TypeId = Convert.ToInt32(sValue[2]); AdminUser.UserName = sValue[3].ToString(); } else { HttpContext.Current.Response.Redirect("logout.aspx"); } } else { HttpContext.Current.Response.Redirect("logout.aspx"); } }
protected void UpdateUser_Click(object sender, EventArgs e) { try { // Save new profile data to database clsUser user = (clsUser)Session["User"]; user.FullName = FullName.Text; user.Email = Email.Text; user.PhoneNumber = PhoneNumber.Text; user.Password = ""; if (chkPassword.Checked) { user.Password = Cipher.Encrypt(Password.Text); } if (hdnUpload.Value != "") { string filename = Path.GetFileName(fileupload.FileName); fileupload.SaveAs(Server.MapPath("~/Content/profile/") + filename); user.Picture = filename; imgPreview.Src = "/Content/profile/" + user.Picture; profileimg.ImageUrl = "/Content/profile/" + user.Picture; } lblFullName.Text = user.FullName; mgtUSer.Update(user); // Store user details to session as login user Session["User"] = user; messageBox.Visible = true; } catch (Exception ex) { AlertMessage(ex.Message); } }
protected void btnsignup_Click(object sender, EventArgs e) { objuser = new clsUser(); try { bool ans; objuser.Username = txtuname.Text; objuser.Password = txtpswd.Text; objuser.FullName = txtfname.Text; objuser.Email = txtemail.Text; objuser.UserType = utype.Text; if (chkStatus.Checked == true) { objuser.Status = "Active"; } else { objuser.Status = "Inactive"; } objuser.MobileNo = txtmno.Text; ans = objuser.CheckUser(txtuname.Text); if (ans == true) { Alert.Visible = true; return; } else { objuser.InsertData(objuser); } } catch (Exception x) { Response.Write(x.Message); } }
public Boolean IsFormComplete(TextBox first, TextBox last, TextBox email, TextBox user, TextBox pass1, TextBox pass2) { if (first.Text != "" && last.Text != "" && email.Text != "" && user.Text != "" && pass1.Text != "" && pass2.Text != "" && lbxGender.SelectedValue != "" && radioList1.SelectedValue != "") { //if passwords match if (pass1.Text != pass2.Text) { lblReg.Text = "Passwords don't match"; return(false); //if email is valid } else if (email.Text.Contains("@") && email.Text.Contains(".com")) { //if username is unique clsUser tempUser = new clsUser(txtInputUsername.Text); if (tempUser.validateUsername(tempUser.getUsername()) == true) { lblReg.Text = "All good username does not exist."; return(true); } else { lblReg.Text = "username already exists"; return(false); } } else { lblReg.Text = "Enter valid email"; return(false); } } else { lblReg.Text = "Enter all fields..."; return(false); } }
private void repoRemove_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (gridView1.FocusedRowHandle < 0) { return; } clsUser curr = (clsUser)gridView1.GetFocusedRow(); if (curr.ID != 0 && MessageBox.Show("Сонгосон хэрэглэгчийг идэвхгүй болгох уу?", "Анхааруулга", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try { Cursor.Current = Cursors.WaitCursor; using (var db = new Gobibase()) { SqlConnection conn = new SqlConnection(db.Connection.ConnectionString); SqlCommand cmd = new SqlCommand(@"UPDATE [dbo].[t_user] SET isActive = 0 WHERE id = @p1", conn); cmd.Parameters.Add("@p1", SqlDbType.Int).Value = curr.ID; cmd.CommandType = CommandType.Text; conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); LoadData(); Cursor.Current = Cursors.Default; } } catch (Exception ex) { Cursor.Current = Cursors.Default; MessageBox.Show("Aлдаа гарлаа!" + Environment.NewLine + ex.Message, "Анхааруулга", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
protected void Page_Load(object sender, EventArgs e) { user = (clsUser)Session["user"]; DataTable dtInst = new DataTable(); if (!IsPostBack) { HtmlInputHidden[] hid = new HtmlInputHidden[2]; hid[0] = hidInstID; hid[1] = hidUniID; Common.setHiddenVariables(ref hid); lblPageHead.Text = "Student Program Validity Report"; if (hidUniID.Value == "") { hidUniID.Value = Classes.clsGetSettings.UniversityID.ToString(); FillExamEvent(); } // FillExamEvent(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["userInformation"] != null) { clsUser currUser = (clsUser)Session["userInformation"]; if (!currUser.IsManager) { Response.Redirect(@"welcome!.aspx"); } else { //current user is manager if (Request.UrlReferrer != null) { ViewState["PreviousPageUrl"] = Request.UrlReferrer.ToString(); } makedatatable(-1, -1); //-1, -1 will get all the sets without filtering by @WordSize or @NumOfMatches } } } }
void LoadData() { try { clsUser obj = new clsUser(); obj.ID = Convert.ToInt32(Request.Cookies["User"].Value); obj.Op = 5; System.Data.DataTable dt = obj.UserMaster(obj).Tables[0]; txtName.Text = dt.Rows[0]["Name"].ToString(); txtEmail.Text = dt.Rows[0]["Email"].ToString(); txtPhone.Text = dt.Rows[0]["PhoneNo"].ToString(); txtDesignation.Text = dt.Rows[0]["Designation"].ToString(); ddlSite.SelectedValue = dt.Rows[0]["SiteID"].ToString(); ddlUserType.SelectedValue = dt.Rows[0]["UserType"].ToString(); if (dt.Rows[0]["Signature"].ToString() != "") { imgSignature.ImageUrl = "~/" + dt.Rows[0]["Signature"].ToString(); } } catch { } }
private Hashtable CreateHashTable() { oHt = new Hashtable(); oHt["AcademicYearID"] = ddlAcadYear.SelectedValue; oHt["UniID"] = clsGetSettings.UniversityID; oHt["FacID"] = hidFacID.Value.Trim(); oHt["CrID"] = hidCrID.Value.Trim(); oHt["MoLrnID"] = hidMoLrnID.Value.Trim(); oHt["PtrnID"] = hidPtrnID.Value.Trim(); oHt["BrnID"] = ddlCrBrnDesc.SelectedValue; oHt["ConsiderResultStatus"] = rblResultConsideration.SelectedValue; oclsUser = (clsUser)Session["User"]; if (oclsUser != null) { oHt["User"] = oclsUser.User_ID; } else { HttpContext.Current.Response.Write(clsGetSettings.LogOffMessage); HttpContext.Current.Response.End(); } return(oHt); }
private string FormValid() { //this function validates the contents of all of the fields //var to store any error messages string ErrMsg = ""; //used to validate the password entered by the user clsUser TempUser; //if the two new passwords do not match if (txtNewPW1.Text != txtNewPW2.Text) { ErrMsg = ErrMsg + " the new passwords do not match "; } //try to log in using the old password entered TempUser = new clsUser(TheCurrentUser.EMail, txtOldPW.Text); //if it cant authenticate if (TempUser.Authenticated == false) { ErrMsg = ErrMsg + " the old password is not correct "; } //return any error messages return(ErrMsg); }
protected void CreateUser_Click(object sender, EventArgs e) { try { // Creating a new user object with form data clsUser user = new clsUser(); user.FullName = FullName.Text; user.Username = Username.Text; user.Password = Cipher.Encrypt(Password.Text); user.Email = Email.Text; user.PhoneNumber = PhoneNumber.Text; user.AdminLogin = false; //check username availability if (mgtUSer.ValidateUsername(user.Username)) { // Saving user class to database mgtUSer.Register(user); //get registered user details user = mgtUSer.GetUserByUsername(Username.Text); // Store user details to session as login user, redirects to home page Session["User"] = user; //redirect to home page Response.Redirect("/SpinToWin.aspx", false); } else { AlertMessage("The Username is already in use."); } } catch (Exception ex) { // displays error messsage AlertMessage(ex.Message); } }
protected void FinishButton_OnClick(object sender, EventArgs e) { //https://www.c-sharpcorner.com/UploadFile/1326ef/transactionscope-in-C-Sharp/ using (TransactionScope transactionScope = new TransactionScope()) { try { clsUser user = (clsUser)Session["User"]; bookingObject.Address = Address.Text; bookingObject.PostCode = PostCode.Text; bookingObject.Remarks = Remarks.Text; bookingObject.VehicleColor = VehicleColor.Text; bookingObject.VehicleMake = VehicleMake.Text; bookingObject.VehicleReg = VehicleReg.Text; bookingObject.VehicleModel = VehicleModel.Text; bookingObject.UserID = user.UserID; bookingObject.Total = Convert.ToDouble(lblTotal.Text); mgtBooking.Add(bookingObject, string.Join(",", selectedExtras)); mgtPoint.Add(user.UserID, 1); if (bookingObject.CouponCode > 0) { mgtCoupon.UpdateStatus(bookingObject.CouponCode); } SendBookingConfirmation(user); transactionScope.Complete(); transactionScope.Dispose(); messageBox.Visible = true; Page.ClientScript.RegisterStartupScript(this.GetType(), "clientScript", "redirectToHome();", true); } catch (Exception ex) { transactionScope.Dispose(); AlertMessage("Something went wrong. Please try again later!"); } } }
public void Page_Load(object sender, System.EventArgs e) { // for(int i=0;i<Request.ServerVariables.Count;i++) // { // Response.Write("<BR>"+Request.ServerVariables.Keys[i].ToString()+"="+Request.ServerVariables[i]); // } Classes.clsCache.NoCache(); clsUser user = null; string Module = clsMenu.Module_Key(Request.Url); string Menu = clsMenu.Menu_Key(Request.Url); if (Session["User"] != null && Session["User"].ToString() != "") { user = (clsUser)Session["User"]; } string obj = Request.QueryString["MenuID"]; int MenuID = 0; if (obj != null && obj.ToString() != "") { try { MenuID = Convert.ToInt16(obj); } catch { } } if (Menu.ToUpper() != "DEFAULT" && Menu.ToUpper() != "LOGOUT" && Menu.ToUpper() != "ONERRORSHOW" && !clsMenu.isValidMenu(user, Module, Menu, MenuID.ToString())) { Response.Write(UniversityPortal.clsGetSettings.LogOffMessage); Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { clsCache.NoCache(); // chkCourse.Attributes.Add("onclick","fnChkCourse();"); btnProcess.Attributes.Add("onclick", "return fnSaveValidate();"); user = (clsUser)Session["User"]; userid = user.User_ID.ToString(); chkCourse.Items[1].Attributes.Add("onclick", "fnDisplayCourse();"); chkCourse.Items[0].Attributes.Add("onclick", "fnHideCourse();"); if (!IsPostBack) { if (PreviousPage != null) { ContentPlaceHolder Cntp = (ContentPlaceHolder)Page.Master.FindControl("ContentPlaceHolder1"); if (((HtmlInputHidden)Cntp.FindControl("hidInstID")).Value != null || ((HtmlInputHidden)Cntp.FindControl("hidInstID")).Value != "") { hidInstID.Value = ((HtmlInputHidden)Cntp.FindControl("hidInstID")).Value; } } //-------------------------------------------------------- //University ID Checking //-------------------------------------------------------- if (hidUniID.Value == "") { hidUniID.Value = Classes.clsGetSettings.UniversityID.ToString(); } fnFirstFill(); FillGrid(); lblCrNote.Text = "Already configured eligibility rights"; } ContentPlaceHolder Cntph = (ContentPlaceHolder)Page.Master.FindControl("ContentPlaceHolder1"); //sInst = (searchInstNew)Cntph.FindControl("SchInst1"); }
protected void Page_Load(object sender, EventArgs e) { string Filter; //this event runs when the page is loaded at the server //if this is the first time the page has loaded if (IsPostBack == false) { //set the number of login attempts to zero Attempts = 0; //get the search filter Filter = txtSearch.Text; //display list of swaps lblResultsCount.Text = ListMySwaps(Filter); } else { //if it is a page reload then get the current value from the session object Attempts = Convert.ToInt32(Session["Attempts"]); } //get the current user from the session object TheCurrentUser = (clsUser)Session["TheCurrentUser"]; if (TheCurrentUser == null) { //initialise the current user TheCurrentUser = new clsUser(); } //if there have been too many failed login attempts if (Attempts >= 2) { //redirect to the badlogin page Response.Redirect("badlogin.aspx"); } //manage the interface ManageInterface(); }
protected void Page_Load(object sender, EventArgs e) { clsUser user = (clsUser)Session["User"]; if (user == null) { Response.Redirect("/LoginMsg.aspx"); } else if (!user.AdminLogin) { //TODO Response.Redirect("/Unauthorized.aspx"); } if (!Page.IsPostBack) { txtStartDate.Text = string.Format("{0:dd/MM/yyyy}", DateTime.Now); txtEndDate.Text = string.Format("{0:dd/MM/yyyy}", DateTime.Now); BindCurrentBookings(); BindBookingsByDate(); } messageBox.Visible = false; Page.ClientScript.RegisterStartupScript(this.GetType(), "defaultTab", "defaultTab('" + hdnTab.Value + "')", true); }
protected void Page_Load(object sender, EventArgs e) { Classes.clsCache.NoCache(); chkCourse.Attributes.Add("onclick", "fnChkCourse();"); btnProcess.Attributes.Add("onclick", "return fnSaveValidate();"); userob = (clsUser)Session["User"]; userid = userob.User_ID.ToString(); if (!IsPostBack) { //-------------------------------------------------------- //University ID Checking //-------------------------------------------------------- if (hidUniID.Value == "") { hidUniID.Value = UniversityPortal.clsGetSettings.UniversityID.ToString(); } fnFirstFill(); DisplayGrid(""); lblCrNote.Text = "Already configured eligibility rights"; } }
public List <clsUser> GetAllUser() { string strQry = "select * from tblUser with (nolock)"; DataTable dtUser = GetUser(strQry); List <clsUser> lstUser = new List <clsUser>(); if (dtUser != null && dtUser.Rows.Count != 0) { clsUser objUser = null; foreach (DataRow drUser in dtUser.Rows) { objUser = new clsUser() { ID = drUser["ID"] != DBNull.Value ? Convert.ToInt32(drUser["ID"]) : 0, FirstName = drUser["FirstName"] != DBNull.Value ? Convert.ToString(drUser["FirstName"]) : string.Empty, LastName = drUser["LastName"] != DBNull.Value ? Convert.ToString(drUser["LastName"]) : string.Empty, EmailAddress = drUser["emailaddress"] != DBNull.Value ? Convert.ToString(drUser["emailaddress"]) : string.Empty, Gender = drUser["gender"] != DBNull.Value ? Convert.ToInt32(drUser["gender"]) : 0 }; lstUser.Add(objUser); } } return(lstUser); }
protected void btnConfirm_Click(object sender, EventArgs e) { clsOthers oImportFromExcel = new clsOthers(); string result = string.Empty; try { clsUser oUser = (clsUser)Session["user"]; int res = oImportFromExcel.ImportPRNFromExcel(hidSourceTableName.Value, oUser.User_ID); //int res = 1; if (res != 0) { lblMessage.Text = "Data Imported Successfully."; lblMessage.CssClass = "saveNote"; btnConfirm.Enabled = false; btnCancel.Enabled = false; // btnGetDetails.Enabled = false; //ShowDiscrepancyStats(); } else { //tnGetDetails.Enabled = true; } } catch (Exception ex1) { lblFileError.Text = ex1.Message; lblFileError.CssClass = "errorNote"; } if (oImportFromExcel != null) { oImportFromExcel = null; } }
/// <summary> /// Create hash table. /// </summary> /// <returns>Hash table.</returns> private Hashtable CreateHashTable() { user = (clsUser)Session["user"]; oHS = new Hashtable(); oHS.Add("pk_Uni_ID", Classes.clsGetSettings.UniversityID); oHS.Add("pk_Institute_ID", hidInstID.Value); oHS.Add("pk_Year", hid_pk_Year.Value); oHS.Add("pk_Student_ID", hid_pk_Student_ID.Value); oHS.Add("pk_Fac_ID", hidFacultyID.Value); oHS.Add("pk_Cr_ID", hidCourseID.Value); oHS.Add("pk_MoLrn_ID", hidMolrnID.Value); oHS.Add("pk_Ptrn_ID", hidPtrnID.Value); oHS.Add("pk_Brn_ID", hidBrnID.Value); oHS.Add("fk_CrPr_Details_ID", hidCrPrDetailsID.Value); oHS.Add("CrPr_Seq", hidCrPr_Seq.Value); oHS.Add("CrPrCh_Seq", hidCrPrCh_Seq.Value); oHS.Add("pk_CrPrCh_ID", hidCrPrChID.Value); oHS.Add("Prev_pk_Fac_ID", hid_Prev_pk_Fac_ID.Value); oHS.Add("Prev_pk_Cr_ID", hid_Prev_pk_Cr_ID.Value); oHS.Add("Prev_pk_MoLrn_ID", hid_Prev_pk_MoLrn_ID.Value); oHS.Add("Prev_pk_Ptrn_ID", hid_Prev_pk_Ptrn_ID.Value); oHS.Add("Prev_pk_Brn_ID", hid_Prev_pk_Brn_ID.Value); oHS.Add("Prev_fk_CrPr_Details_ID", hid_Prev_pk_CrPr_Details_ID.Value); oHS.Add("Prev_pk_CrPrCh_ID", hid_Prev_CoursePartChild.Value); oHS.Add("Prev_CoursePart_Opted", hid_Prev_CoursePart_Opted.Value); oHS.Add("Prev_CoursePart_Admission_Type", hid_Prev_CoursePart_Admission_Type.Value); oHS.Add("PRN_Number", hidPRN.Value); oHS.Add("Papers_IDs", hid_Papers.Value); oHS.Add("fk_AcademicYear_ID", hidAcademicYear_ID.Value); oHS.Add("Prev_CrPr_Seq", "0"); oHS.Add("Prev_CrPrCh_Seq", "0"); oHS.Add("Created_By", user.User_ID); return(oHS); }
/*Modificar Password luego de logearse*/ public Boolean UpdatePassword(ref BaseEntity entitym, ref clsUser objuser) { Boolean iscorrect = false; SqlConnection objConnection = null; try { objConnection = clsConexion.ObtenerConexion(); SqlCommand objcmd = new SqlCommand("sp_xP_Actualizar_Password_Usuario", objConnection); objcmd.Parameters.AddWithValue("@UserId", objuser.ID); objcmd.Parameters.AddWithValue("@Password", objuser.Password); objcmd.Parameters.AddWithValue("@LastUpdateBy", objuser.Updatedby); objcmd.CommandType = CommandType.StoredProcedure; objcmd.ExecuteNonQuery(); iscorrect = true; } catch (Exception ex) { entitym.Errors.Add(new BaseEntity.ListError(ex, "Error en la Base de datos")); } finally { clsConnection.DisposeCommand(objConnection); } return(iscorrect); }
public static void SendPaymentLink(int bookingId, string encodedBookingId) { try { HttpContext context = HttpContext.Current; string baseUrl = context.Request.Url.Scheme + "://" + context.Request.Url.Authority + context.Request.ApplicationPath.TrimEnd('/') + '/'; string pageurl = baseUrl + "BookingPayment.aspx?id=" + encodedBookingId; string paymentLink = "<a href='" + pageurl + "'>Click Here</a>"; clsBooking booking = mgtBooking.GetBookingById(bookingId); clsUser user = mgtUSer.GetUserByUserId(booking.UserID); string emailBody = "<h2>Hello " + user.FullName + ".</h2>" + "<h3>Your booking #" + booking.BookingNo + " is completed successfully</h3></br></br>"; emailBody = emailBody + "<p>Please " + paymentLink + " to proceed the payment.</p></br></br>"; emailBody = emailBody + "<p>Thank You, <br>Team AutoCare </p>"; EmailSender.Send("Booking completed successfully!", emailBody, user.Email); } catch (Exception ex) { } }