private void ProcessUserName(int AccountID)
 {
     if (tbUserName.Text.Length > 0)
     {
         property.Insert(AccountID, "UserName", tbUserName.Text);
     }
 }
Esempio n. 2
0
 private void ProcessUserName()
 {
     if (tbUserName.Text.Length > 0)
     {
         try
         {
             property.Insert(aid, "UserName", tbUserName.Text);
         }
         catch (SqlException sqlerr)
         {
             if (sqlerr.Message.IndexOf("duplicate key") >= 0)
             {
                 property.Update(aid, "UserName", tbUserName.Text);
             }
             else
             {
                 throw sqlerr;
             }
         }
     }
     else
     {
         property.RemoveProperty(aid, "UserName");
     }
 }
        private void Page_Load(object sender, System.EventArgs e)
        {
            int Domain = Convert.ToInt32(Request.QueryString["Domain"]);

            // First Time in no Domain specified
            if (Domain == 0)
            {
                Domain = 1;
            }

            MainNavBar.Domain = Domain;

            Account account   = new Account(appEnv.GetConnection());
            int     accountID = account.GetAccountID(User.Identity.Name);

            if (!IsPostBack)
            {
                AccountProperty property   = new AccountProperty(appEnv.GetConnection());
                string          strZoneIds = property.GetValue(accountID, "ZoneCards");

                if (strZoneIds.Length <= 0)
                {
                    property.Insert(accountID, "ZoneCards", "0,0,0,0,0,0");
                }
            }

            for (int i = 0; i < 6; i++)
            {
                ZoneCards[i].Card      = i;
                ZoneCards[i].AccountID = accountID;
            }
        }
 private void ProcessAdministratorName()
 {
     if (txtAdministratorName.Text.Length > 0)
     {
         try
         {
             property.Insert(1, "UserName", txtAdministratorName.Text);
         }
         catch (SqlException sqlerr)
         {
             if (sqlerr.Message.IndexOf("duplicate key") >= 0)
             {
                 property.Update(1, "UserName", txtAdministratorName.Text);
             }
             else
             {
                 throw sqlerr;
             }
         }
     }
 }