using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class SignUp : BasePage { protected void Page_Load(object sender, EventArgs e) { pSingupCreated.Visible = false; pSingupForm.Visible = true; TxtUname.Enabled = false; BtnSubmit.Attributes.Add("onClick", "return checkemail();"); TxtEmail.Attributes.Add("onBlur", "fillUserid();"); } protected void BtnSubmit_Click(object sender, EventArgs e) { string FName; string LName; string CompName; string Email; string UName; string Pass; string Role; //string Status; string PO; int Recid; DateTime? expirationDate; FName = (TxtFname.Text).Replace("'", "''"); LName = (TxtLname.Text).Replace("'", "''"); CompName = (TxtCompname.Text).Replace("'", "''"); Email = (TxtEmail.Text).Replace("'", "''"); expirationDate = null; UName = (TxtUname.Text).Replace("'", "''"); // UserName is same as Email Pass = (TxtPass.Text).Replace("'", "''"); Role = "User"; PO = ""; Recid = 0; //For addition UserInfo MasterData = new UserInfo(); try { MasterData.UdateKeySetUsed(TxtKey.Text); DateTime? expDate = null; expDate = MasterData.HandleMasterUserData(FName, LName, CompName, Email, UName, Pass, Role, "Active", Recid, PO, expirationDate); if (expDate == null) throw new ApplicationException("System Exception. User wasn't created. Try it once again."); txtExpirationDate.Text = expDate.ToString(); pSingupCreated.Visible = true; pSingupForm.Visible = false; } catch (Exception exception) { LbMess.Text = exception.Message; LbMess.Attributes.Add("style", "display:inline"); } } }