Example #1
0
 protected void UserGridView_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
 {
     try
     {
         securityAgent = new CryptoProvider();
         DBAgent       = new DataAccessProvider(DataAccessProvider.ParamType.ServerCredentials, ConfigurationManager.AppSettings["DBServerName"], ConfigurationManager.AppSettings["DBUserName"], ConfigurationManager.AppSettings["DBPassword"]);
         DBAgent.AddParameter("@ParamUserName", e.NewValues["UserName"]);
         DBAgent.AddParameter("@ParamFirstName", e.NewValues["FirstName"]);
         DBAgent.AddParameter("@ParamLastName", e.NewValues["LastName"]);
         DBAgent.AddParameter("@ParamPassword", securityAgent.GetTemporaryPassword());
         DBAgent.AddParameter("@ParamModifiedBy", Session["LoginID"]);
         DBAgent.ExecuteNonQuery("dbo.spAddUser");
         e.Cancel = true;
         UserGridView.CancelEdit();
         UserGridView.DataBind();
     }
     catch (Exception ex)
     {
         CommonHelpers.writeLogToFile("UserGridView_RowInserting: UserManagement.aspx", ex.Message);
     }
 }