protected void btnCreate_Click(object sender, EventArgs e) { AdminDataContext ad = new AdminDataContext(); tblLogonId logIn = new tblLogonId(); BusLogic bl = new BusLogic(); if (txtNewUser.Text != string.Empty) { logIn.UserName = txtNewUser.Text; } if (txtPword.Text != string.Empty) { logIn.Password = bl.getMd5Hash(txtPword.Text); } if (txtRole.Text != string.Empty) { logIn.Role = int.Parse(txtRole.Text); } if (txtEmail.Text != string.Empty) { if (bl.ValidateEmail(txtEmail.Text)) { logIn.emailAddress = txtEmail.Text; } } try { ad.tblLogonIds.InsertOnSubmit(logIn); ad.SubmitChanges(); string fn = "alert('" + txtNewUser.Text + " was successfully added!');"; ShowClientFunction(fn); btnView_Click(sender, e); } catch (Exception) { } finally { txtNewUser.Text = string.Empty; txtPword.Text = string.Empty; txtEmail.Text = string.Empty; } }
partial void UpdatetblLogonId(tblLogonId instance);
partial void DeletetblLogonId(tblLogonId instance);
partial void InserttblLogonId(tblLogonId instance);