Esempio n. 1
0
        public bool AddNewCustomer(Customer customer)
        {
            int id = Convert.ToInt32(Functions.IDGeneration(MyShopConfigration.Custmors)) + 1;

            SysRegedit.SaveReg(MyShopConfigration.Custmors, id.ToString() + "." + customer.Name, "Id", id.ToString());
            SysRegedit.SaveReg(MyShopConfigration.Custmors, id.ToString() + "." + customer.Name, "Name", Name);
            SysRegedit.SaveReg(MyShopConfigration.Custmors, id.ToString() + "." + customer.Name, "Address", Address);
            SysRegedit.SaveReg(MyShopConfigration.Custmors, id.ToString() + "." + customer.Name, "PIN", PIN.ToString());
            SysRegedit.SaveReg(MyShopConfigration.Custmors, id.ToString() + "." + customer.Name, "Mobile", Mobile);
            SysRegedit.SaveReg(MyShopConfigration.Custmors, id.ToString() + "." + customer.Name, "Email", Email);
            return(true);
        }
Esempio n. 2
0
        //public static void ClearTextBox(Form from)
        //{
        //    foreach (var item in from.Controls)
        //    {
        //        if (item.GetType() == typeof(TextBox))
        //        {
        //            TextBox textBox = (TextBox)item;
        //            textBox.Text = "";//9946
        //        }
        //    }
        //}
        public static int BuildBillNo()
        {
            int a = 0;

            if (SysRegedit.ReadReg(MyShopConfigration.ProjectName, "Settings", "BillNo") != "")
            {
                a = Convert.ToInt32(SysRegedit.ReadReg(MyShopConfigration.ProjectName, "Settings", "BillNo"));
                a++;
                SysRegedit.SaveReg(MyShopConfigration.ProjectName, "Settings", "BillNo", a.ToString());
            }
            return(a);
        }
 public static bool ChangePassword(string oldPassword, string newPassword)
 {
     if (SysRegedit.ReadReg(MyShopConfigration.ProjectName, "Login", "Password") == oldPassword)
     {
         SysRegedit.SaveReg(MyShopConfigration.ProjectName, "Login", "Password", newPassword);
         return(true);
     }
     else
     {
         return(false);
     }
 }
 public static bool ChangeUsername(string oldUsername, string newUsername)
 {
     if (SysRegedit.ReadReg(MyShopConfigration.ProjectName, "Login", "Username") == oldUsername)
     {
         SysRegedit.SaveReg(MyShopConfigration.ProjectName, "Login", "Username", newUsername);
         return(true);
     }
     else
     {
         return(false);
     }
 }
        public bool AddNewProduct(Product product)
        {
            int id = Convert.ToInt32(Functions.IDGeneration(MyShopConfigration.Products)) + 1;

            SysRegedit.SaveReg(MyShopConfigration.Products, id.ToString() + "." + product.Name, "Id", id.ToString());
            SysRegedit.SaveReg(MyShopConfigration.Products, id.ToString() + "." + product.Name, "Name", Name);
            SysRegedit.SaveReg(MyShopConfigration.Products, id.ToString() + "." + product.Name, "Price", Price.ToString());
            SysRegedit.SaveReg(MyShopConfigration.Products, id.ToString() + "." + product.Name, "ExpDate", ExpDate.ToString());
            SysRegedit.SaveReg(MyShopConfigration.Products, id.ToString() + "." + product.Name, "ManDate", ManDate.ToString());
            SysRegedit.SaveReg(MyShopConfigration.Products, id.ToString() + "." + product.Name, "CompanyName", CompanyName);
            SysRegedit.SaveReg(MyShopConfigration.Products, id.ToString() + "." + product.Name, "Quntity", Quntity.ToString());
            SysRegedit.SaveReg(MyShopConfigration.Products, id.ToString() + "." + product.Name, "Features", Features);
            return(true);
        }
        private void lblColor1_Click_1(object sender, EventArgs e)
        {
            Label lbl = (Label)sender;

            if (lbl.Name == "lblColor1")
            {
                SysRegedit.SaveReg(MyShopConfigration.ProjectName, "Settings", "ActiveTheme", lbl.BackColor.Name);
            }
            else if (lbl.Name == "lblColor2")
            {
                SysRegedit.SaveReg(MyShopConfigration.ProjectName, "Settings", "ActiveTheme", lbl.BackColor.Name);
            }
            else if (lbl.Name == "lblColor3")
            {
                SysRegedit.SaveReg(MyShopConfigration.ProjectName, "Settings", "ActiveTheme", lbl.BackColor.Name);
            }
            else if (lbl.Name == "lblColor4")
            {
                SysRegedit.SaveReg(MyShopConfigration.ProjectName, "Settings", "ActiveTheme", lbl.BackColor.Name);
            }
            else if (lbl.Name == "lblColor5")
            {
                SysRegedit.SaveReg(MyShopConfigration.ProjectName, "Settings", "ActiveTheme", lbl.BackColor.Name);
            }
            else if (lbl.Name == "lblColor6")
            {
                SysRegedit.SaveReg(MyShopConfigration.ProjectName, "Settings", "ActiveTheme", lbl.BackColor.Name);
            }

            ThemeService.ActiveTheme(this);

            foreach (Label control in this.pnlThemeList.Controls)
            {
                // Label lbl1 = (Label)control;
                if (this.BackColor == control.BackColor)
                {
                    control.BorderStyle = BorderStyle.Fixed3D;
                    control.Text        = "Active Theme";
                }
                else
                {
                    control.BorderStyle = BorderStyle.None;
                    control.Text        = "";
                }
            }
            lblColorName.BorderStyle = BorderStyle.None;
            lblColorName.Text        = this.BackColor.Name;
        }
 private void tmrMain_Tick_1(object sender, EventArgs e)
 {
     b++;
     if (b == 10)
     {
         lblMachineName.Visible = true;
         lblMachineName.Text    = lblMachineName.Text + "  " + Environment.MachineName;
     }
     else if (b == 20)
     {
         lblOSBuild.Visible = true;
         lblOSBuild.Text    = lblOSBuild.Text + "  " + Environment.OSVersion.ToString();
     }
     else if (b == 30)
     {
         lblProcesserCount.Visible = true;
         lblProcesserCount.Text    = lblProcesserCount.Text + "  " + Environment.ProcessorCount.ToString() + " only.";
     }
     else if (b == 40)
     {
         lblSysPageSize.Visible = true;
         lblSysPageSize.Text    = lblSysPageSize.Text + "  " + Environment.ProcessorCount.ToString() + " only.";
     }
     else if (b == 45)
     {
         pnlSysChek.Visible = false;
         lblMessage.Visible = true;
     }
     else if (b == 60)
     {
         lblMessage.Text = "Installing " + MyShopConfigration.ProjectName + " components.";
         SysRegedit.SaveReg(MyShopConfigration.ProjectName, "Settings", "Themes", MyShopConfigration.Themes);
         SysRegedit.SaveReg(MyShopConfigration.ProjectName, "Settings", "ActiveTheme", MyShopConfigration.ActiveTheme);
         SysRegedit.SaveReg(MyShopConfigration.ProjectName, "Login", "Username", MyShopConfigration.Username);
         SysRegedit.SaveReg(MyShopConfigration.ProjectName, "Login", "Password", MyShopConfigration.Password);
         SysRegedit.SaveReg(MyShopConfigration.ProjectName, "Settings", "New", "1");
     }
     else if (b == 80)
     {
         lblMessage.Text = "All most done, plese wait...";
     }
     //  ColorCharge();
 }
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            // string ss = SysRegedit.ReadReg(MyShopConfigration.ProjectName, "Settings", "New");
            if (SysRegedit.ReadReg(MyShopConfigration.ProjectName, "Settings", "New") == null || SysRegedit.ReadReg(MyShopConfigration.ProjectName, "Settings", "New") == "")
            {
                MyApplicationContext context = new MyApplicationContext(new Install());
                SysRegedit.SaveReg(MyShopConfigration.ProjectName, "Settings", "New", "1");
                Application.Run(context);
                return;
            }

            else if (SysRegedit.ReadReg(MyShopConfigration.ProjectName, "Settings", "New") == "1")
            {
                MyApplicationContext context = new MyApplicationContext(new LogIn());
                Application.Run(context);
            }
        }