Exemple #1
0
        protected void saveBtn_Click(object sender, EventArgs e)
        {
            try
            {
                string logOnToken   = null;
                string pswdToken    = null;
                var    temporalUser = new VLClientUser();
                this.contactsform1.GetValues(temporalUser, ref logOnToken, ref pswdToken);

                var account = SystemManager.CreateClientAccount(this.SelectedClient.ClientId, temporalUser.FirstName, temporalUser.LastName, temporalUser.Role, temporalUser.Email, logOnToken, pswdToken);
                account.Title      = temporalUser.Title;
                account.Department = temporalUser.Department;
                account.Country    = temporalUser.Country;
                account.Prefecture = temporalUser.Prefecture;
                account.Town       = temporalUser.Town;
                account.Address    = temporalUser.Address;
                account.Zip        = temporalUser.Zip;
                account.Telephone1 = temporalUser.Telephone1;
                account.Telephone2 = temporalUser.Telephone2;
                account.IsActive   = temporalUser.IsActive;
                account.Comment    = temporalUser.Comment;

                if (account.IsDirty)
                {
                    account = SystemManager.UpdateClientUser(account);
                }


                this.Response.Redirect(_UrlSuffix(string.Format("../edit.aspx?ClientId={0}", account.Client)), false);
                this.Context.ApplicationInstance.CompleteRequest();
            }
            catch (ThreadAbortException)
            {
                //
            }
            catch (Exception ex)
            {
                this.ErrorMessage = ex.Message;
            }
        }