示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int    id       = Convert.ToInt32(IdBox.Text);
            string name     = NameBox.Text;
            int    Phon     = Convert.ToInt32(PhonBox.Text);
            string payment  = PaymentBox.Text;
            string pass     = PassBox.Text;
            int    paid     = Convert.ToInt32(PaidBox.Text);
            string package  = PackageBox.Text;
            int    due      = Convert.ToInt32(DueBox.Text);
            string validity = ValidityBox.Text;

            MemRegDAO b = new MemRegDAO();

            b.createMember(new MemRegDTO(id, pass, name, Phon, payment, package, paid, due, validity));
            LoadCustomersInfo();

            IdBox.Clear();
            PassBox.Clear();
            NameBox.Clear();
            PhonBox.Clear();
            PaymentBox.Clear();
            PaidBox.Clear();
            DueBox.Clear();
            ValidityBox.Clear();
        }
示例#2
0
        // Compile checkes for building
        public bool Compile_Checks()
        {
            bool   OldKeyStyle      = Convert.ToBoolean(Settings.Default["OldTitleKeyEnable"]);
            string Keys             = Control.DircControl.buildpath + "keys.dat";
            string root             = System.IO.Path.GetPathRoot(Environment.CurrentDirectory);
            string dev_kit_win      = @"C:\DEVKITPRO\libnx\include\switch.h";
            string dev_kit_unix     = root + @"/opt/devkitpro/libnx/include/switch.h";
            string CustomDevkitPath = Settings.Default["CustomDevkitPath"].ToString() + @"\libnx\include\switch.h";
            string imgfind          = (Control.DircControl.buildpath + Control.DircControl.controlpath + "icon_AmericanEnglish.dat");

            bool[] ArrayCheck = new bool[8];
            char[] IdChar     = IdBox.ToCharArray();

            //Array of checks to enable compiling
            ArrayCheck[0] = File.Exists(Keys); ArrayCheck[1] = File.Exists(dev_kit_win) || File.Exists(dev_kit_unix) || File.Exists(CustomDevkitPath);
            ArrayCheck[2] = NameBox.Length > 0 && NameBox != "App Name"; ArrayCheck[3] = (OldKeyStyle == true && IdBox.Length == 16 && IdBox != "05000A0000000000" && IdChar[0] == '0' && IdChar[1] == '5') ||
                                                                                         (OldKeyStyle == false && IdBox.Length == 16 && IdBox != "05000A0000000000" && IdChar[0] == '0' && IdChar[1] == '5' && IdChar[12] == '0' && IdChar[13] == '0' && IdChar[14] == '0' && IdChar[15] == '0');
            ArrayCheck[4] = AuthorBox.Length > 0 && AuthorBox != "Author"; ArrayCheck[5] = VersionBox.Length > 0;
            ArrayCheck[6] = File.Exists(imgfind); ArrayCheck[7] = Line != null;

            //Array of messgages corrosponding to the check if failed
            string[] Errors = { "Could not locate \"Keys.dat\", Please verify its named correctly and located in the \"Resources\" folder", "Devkitpro missing, Make sure its installed or set the custom path in the settings",
                                "Entered \"App Name\" is not vaild, Please change and retry",                                               "Entered \"Title Id\" is not vaild, Please change and retry *Vaild Title Id is to start with a 05, ends in 0000, and be 16 Hex char long ex. 05XXXXXXXXXX0000 or revert to old title key style in settings*",
                                "Entered \"Author\" is not vaild, Please change and retry",                                                 "Entered \"Version\" is not vaild, Please change and retry",                                                                                                                                                 "Icon is Missing, Please verify a Icon was provided and rety",
                                "\"Romfs\" or \"Sdmc\" was not selected, Please select as required and retry" };
            for (int x = 0; x < ArrayCheck.Length; x++)
            {
                if (ArrayCheck[x] == false)
                {
                    MessageBox.Show(Errors[x]);
                }
            }
            return(ArrayCheck.All(a => a));
        }
示例#3
0
        private void button1_Click(object sender, EventArgs e)
        {
            int    employeeid = Convert.ToInt32(IdBox.Text);
            string name       = NameBox.Text;
            int    Phone      = Convert.ToInt32(PhoneBox.Text);
            string joinigdate = JoinBox.Text;
            string pass       = PassBox.Text;
            int    salary     = Convert.ToInt32(SalaryBox.Text);
            // string package = PackageBox.Text;
            // int due = Convert.ToInt32(DueBox.Text);
            string position = PsitionBox.Text;

            EmployeeDAO b = new EmployeeDAO();

            b.createEmployee(new EmployeeDTO(name, employeeid, pass, Phone, joinigdate, position, salary));
            loademployee();

            IdBox.Clear();
            PassBox.Clear();
            NameBox.Clear();
            PhoneBox.Clear();
            JoinBox.Clear();
            PsitionBox.Clear();
            SalaryBox.Clear();
        }
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            //agentsList.AddAgent();
            Agents agents = (Agents)this.DataContext;

            agents.Add(new Agent());
            AgentListBox.SelectedIndex = AgentListBox.Items.Count - 1;
            IdBox.Focus();
        }
示例#5
0
        private void Reset()
        {
            string text = SearchBox.Text.Trim();

            View.DataSource = Program.Entities.Teachers
                              .Where(s => text.Length == 0 || s.Name.Contains(text))
                              .ToList();

            IdBox.Clear();
            NameBox.Clear();
            AddressBox.Clear();
            MaleButton.Checked = FemaleButton.Checked = false;
            DobBox.Value       = DateTime.Today;
            PhoneBox.Clear();
        }