protected void btnSubmit_Click(object sender, EventArgs e) { if (hdneditId.Value != null && hdneditId.Value != "" && int.Parse(hdneditId.Value.ToString()) > 0) { AccreditationDataContext objDB = new AccreditationDataContext(); objDB.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"]; using (AccreditationDataContext group = new AccreditationDataContext()) { LINQ.TblPasswordChange grp = objDB.TblPasswordChanges.First(D => D.PasswordChangeId == int.Parse(hdneditId.Value.ToString())); grp.EmailAddress = txtEmail.Text.Trim(); grp.TempPassword = txtTempPassword.Text.Trim(); grp.NewPassword = txtNewPassword.Text.Trim(); grp.RetypePassword = txtRetypPassword.Text.Trim(); grp.Active = true; objDB.SubmitChanges(); } }else{ if (!IsExistEmail(txtEmail.Text.Trim())) { if (string.Compare(txtNewPassword.Text.Trim(), txtRetypPassword.Text.Trim()).Equals(0)) { using (AccreditationDataContext passwordchange = new AccreditationDataContext()) { TblPasswordChange passwordchange1 = new TblPasswordChange { EmailAddress = txtEmail.Text.Trim(), TempPassword = txtTempPassword.Text.Trim(), NewPassword = txtNewPassword.Text.Trim(), RetypePassword = txtRetypPassword.Text.Trim(), }; passwordchange.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"]; passwordchange.TblPasswordChanges.InsertOnSubmit(passwordchange1); passwordchange.SubmitChanges(); // Utilities.CreateMessageLabel(this, BLL.Constants.Insert, true); } } } } Response.Redirect("PasswordList.aspx"); return; }
partial void UpdateTblPasswordChange(TblPasswordChange instance);
partial void DeleteTblPasswordChange(TblPasswordChange instance);
partial void InsertTblPasswordChange(TblPasswordChange instance);