示例#1
0
 public static void insertDatabase(firstSetupModel fsm)
 {
     using (IDbConnection mastercon = new SqlConnection(Helper.masterConString))
     {
         mastercon.Execute($"create database {fsm.dbName}");
     }
 }
示例#2
0
 private void fadeIn_Tick(object sender, EventArgs e)
 {
     if (flag)
     {
         if (this.Opacity <= 1.0)
         {
             this.Opacity += 0.2;
         }
         else
         {
             fade.Stop();
         }
     }
     else
     {
         if (this.Opacity > 0.0)
         {
             this.Opacity -= 0.2;
         }
         else
         {
             AdminaccountForm next = new AdminaccountForm();
             firstSetupModel  fsm  = setData();
             next.getData(fsm);
             fade.Stop();
             this.Close();
             next.Show();
         }
     }
 }
 public static void insertData(firstSetupModel fsm)
 {
     using (IDbConnection sqlitecon = new SQLiteConnection(Helper.sqlConString("firstSetupConnection")))
     {
         sqlitecon.Execute("insert into storeDatabaseTbl (storeName, dbName, dbPassword, creatorName, timeCreated)" +
                           "values (@storeName , @dbName, @dbPassword, @fullName, datetime('now'))", fsm);
     }
 }
示例#4
0
 //Methods
 public void getData(firstSetupModel fsm)
 {
     storenameTxt.Text = fsm.storeName;
     firstname         = fsm.firstName;
     lastname          = fsm.lastName;
     middlename        = fsm.middleName;
     email             = fsm.emailAddress;
     birthdate         = fsm.birthDate;
 }
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (flag)
     {
         if (this.Opacity <= 1.0)
         {
             this.Opacity += 0.2;
         }
         else
         {
             fade.Stop();
         }
     }
     else
     {
         if (next)
         {
             if (this.Opacity > 0.0)
             {
                 this.Opacity -= 0.2;
             }
             else
             {
                 fade.Stop();
                 firstSetupModel     fsm  = setData();
                 CreateAdminPassForm next = new CreateAdminPassForm();
                 next.getData(fsm);
                 this.Close();
                 next.Show();
             }
         }
         if (back)
         {
             if (this.Opacity > 0.0)
             {
                 this.Opacity -= 0.2;
             }
             else
             {
                 fade.Stop();
                 firstSetupModel   fsm  = setData();
                 RegisterstoreForm back = new RegisterstoreForm();
                 back.getData(fsm);
                 this.Close();
                 back.Show();
             }
         }
     }
 }
示例#6
0
 public static void insertUserAccountAdmin(firstSetupModel fsm)
 {
     using (IDbConnection storecon = new SqlConnection(Helper.storeConString))
     {
         storecon.Execute($"USE {fsm.dbName} " +
                          $"exec spUserAccounts_InsertAdmin " +
                          $"@firstName, " +
                          $"@lastName, " +
                          $"@middleName, " +
                          $"@birthDate, " +
                          $"@emailAddress",
                          new { firstName    = fsm.firstName,
                                lastName     = fsm.lastName,
                                middleName   = fsm.middleName,
                                birthDate    = fsm.birthDate,
                                emailAddress = fsm.emailAddress });
     }
 }
        public void getData(firstSetupModel fsm)
        {
            firstnameTxt.Text  = fsm.firstName;
            lastnameTxt.Text   = fsm.lastName;
            middlenameTxt.Text = fsm.middleName;
            emailTxt.Text      = fsm.emailAddress;
            storenameLbl.Text  = $"{fsm.storeName}";
            dbpassword         = fsm.dbPassword;
            dbname             = fsm.dbName;

            if (fsm.birthDate.Month == 1 && fsm.birthDate.Day == 1 && fsm.birthDate.Year == 1)
            {
                monthCmb.SelectedIndex = DateTime.Now.Month - 1;
                yearCmb.SelectedItem   = DateTime.Now.Year - 18;
                dayCmb.SelectedItem    = DateTime.Now.Day;
            }
            else
            {
                monthCmb.SelectedIndex = fsm.birthDate.Month - 1;
                dayCmb.SelectedItem    = fsm.birthDate.Day;
                yearCmb.SelectedItem   = fsm.birthDate.Year;
            }
        }
        private void formReset()
        {
            firstSetupModel fsm = new firstSetupModel();

            Themes.UpdateThemeStyle(this, MinimizeBtn, ExitBtn, switchBtn, themeToolTip);
            firstnameTxt.Text  = "";
            lastnameTxt.Text   = "";
            middlenameTxt.Text = "";
            emailTxt.Text      = "";
            namevalidLbl.Text  = "";
            nextBtn.Enabled    = false;
            monthCmb.Hide();
            dayCmb.Hide();
            yearCmb.Hide();
            monthCmb.DataSource = CultureInfo.InvariantCulture.DateTimeFormat.MonthNames.Take(12).ToList();
            yearCmb.DataSource  = Enumerable.Range(1940, (DateTime.Now.Year - 18) - 1940 + 1).ToList();
            getData(fsm);
            this.AcceptButton = nextBtn;
            this.Opacity      = 0.1;
            fade.Start();
            this.ActiveControl = firstnameTxt;
            next = false;
            back = false;
        }