protected void btnSaveTimeZone_Click(object sender, EventArgs e) { if (Page.IsValid) { BUser objBUser = new BUser(); BEUser objBEUser = new BEUser(); objBEUser.StrFirstName = txtFirstName.Text; objBEUser.StrLastName = txtLastName.Text; objBEUser.StrEmail = txtEmail.Text; //objBEUser.StrGender = ddlGender.SelectedValue; objBEUser.strTimeZone = ddlTimeZone.SelectedValue; objBEUser.IntUserID = Convert.ToInt32(Session[EnumPageSessions.USERID]); objBUser.BUpdateTimeZone(objBEUser); if (objBEUser.IntResult == 1) { Session["TimeZoneID"] = ddlTimeZone.SelectedValue.ToString(); Session["TimeZone"] = ddlTimeZone.SelectedItem.Text.ToString(); LinkButton lbtnTimeZone = this.Master.FindControl("lbtnTimeZone") as LinkButton; //Label lblDate = this.Master.FindControl("lblDate") as Label; //lbtnTimeZone.Text = "[ " + Session["TimeZone"].ToString() + " ]"; BECommon objBECommon = new BECommon(); BCommon objBCommon = new BCommon(); objBECommon.iTimeZoneID = Convert.ToInt32(Session["TimeZoneID"]); objBCommon.BGetTimeDelay(objBECommon); //lblDate.Text = "Date: " + DateTime.UtcNow.AddMinutes(objBECommon.IntResult).ToString(); //lblsucc.Text = "Time Zone has been updated successfully."; string[] strtimezone = Session["TimeZone"].ToString().Split('('); lbtnTimeZone.Text = strtimezone[0].ToString() + " : " + DateTime.UtcNow.AddMinutes(objBECommon.IntResult).ToString("MM/dd/yyyy HH:mm tt"); Session["UserName"] = txtFirstName.Text + " " + txtLastName.Text + " [ Auditor ]"; Label lblUserName = this.Master.FindControl("lblUser") as Label; lblUserName.Text = txtFirstName.Text + " " + txtLastName.Text + " [ Auditor ]"; lblsucc.Text = "<img src='../Images/yes.png' align='middle'/> <font color='#00C000'>" + Resources.ResMessages.MyProfile_TimeZoneUpdateSuccess + "</font>"; } else { lblsucc.Text = "<img src='../Images/no.png'align='middle'/> <font color='red'>" + Resources.ResMessages.MyProfile_TimeZoneUpdateFailed + "</font>"; } BindTimeZone(); //BindGender(); BindDemographicDetails(); lblTimeZone.Visible = true; lblFirstName.Visible = true; lblLastName.Visible = true; lblEmail.Visible = true; //lblGender.Visible = true; ddlTimeZone.Visible = false; //ddlGender.Visible = false; txtFirstName.Visible = false; txtLastName.Visible = false; txtEmail.Visible = false; tdSaveTimeZone.Visible = false; tdEditTimeZon.Visible = true; // Response.Redirect("myprofile.aspx"); } }
protected void btnSaveTimeZone_Click(object sender, EventArgs e) { if (Page.IsValid) { BUser objBUser = new BUser(); BEUser objBEUser = new BEUser(); objBEUser.StrFirstName = txtFirstName.Text; objBEUser.StrLastName = txtLastName.Text; objBEUser.StrEmail = txtEmail.Text; objBEUser.strPhoneNumber = txtPhoneNumber.Text; objBEUser.strTimeZone = ddlTimeZone.SelectedValue; objBEUser.IntUserID = Convert.ToInt32(Session[EnumPageSessions.USERID]); //11sep2017----removing plus sign from the country code string[] ArrCodes = null; if (!string.IsNullOrEmpty(txtCountryCode.Text)) { ArrCodes = txtCountryCode.Text.Split('+'); } if (ArrCodes != null) { objBEUser.CountryCode = ArrCodes[0]; } objBUser.BUpdateTimeZone(objBEUser); if (objBEUser.IntResult == 1) { Session["TimeZoneID"] = ddlTimeZone.SelectedValue.ToString(); Session["TimeZone"] = ddlTimeZone.SelectedItem.Text.ToString(); LinkButton lbtnTimeZone = this.Master.FindControl("lbtnTimeZone") as LinkButton; BECommon objBECommon = new BECommon(); BCommon objBCommon = new BCommon(); objBECommon.iTimeZoneID = Convert.ToInt32(Session["TimeZoneID"]); objBCommon.BGetTimeDelay(objBECommon); string[] strtimezone = Session["TimeZone"].ToString().Split('('); lbtnTimeZone.Text = strtimezone[0].ToString() + " : " + DateTime.UtcNow.AddMinutes(objBECommon.IntResult).ToString("MM/dd/yyyy hh:mm tt"); Session["UserName"] = txtFirstName.Text + " " + txtLastName.Text + " [ Student ]"; Label lblUserName = this.Master.FindControl("lblUser") as Label; lblUserName.Text = txtFirstName.Text + " " + txtLastName.Text + " [ Student ]"; lblsucc.Text = "<img src='../Images/yes.png' align='middle'/> <font color='#00C000'>" + Resources.ResMessages.MyProfile_TimeZoneUpdateSuccess + "</font>"; } else { lblsucc.Text = "<img src='../Images/no.png'align='middle'/> <font color='red'>" + Resources.ResMessages.MyProfile_TimeZoneUpdateFailed + "</font>"; } BindTimeZone(); BindDemographicDetails(); lblformat.Visible = false; trDemographicEdit.Visible = false; trDemographicView.Visible = true; this.ValidatePhotoIdentity(); ScriptManager.RegisterStartupScript(this, this.GetType(), "NotSaved", "document.getElementById('" + lblsucc.ClientID.ToString() + "').focus();", true); } }