Beispiel #1
0
 private void LoginBtn_Click(object sender, EventArgs e)
 {
     if (usernameTxt.Text == "")
     {
         usernameErrorLbl.Visible = true;
     }
     else
     {
         usernameErrorLbl.Visible = false;
     }
     if (pwdTxt.Text == "")
     {
         PasswordErrorLbl.Visible = true;
     }
     else
     {
         PasswordErrorLbl.Visible = false;
     }
     if (usernameErrorLbl.Visible || PasswordErrorLbl.Visible)
     {
         MainClass.ShowMSG("Fileds with * are mandatory", "Stop", "Error");
     }
     if (usernameTxt.Text != "" && pwdTxt.Text != "")
     {
         if (retrieval.getUserDetails(usernameTxt.Text, pwdTxt.Text))
         {
             HomeScreen hm = new HomeScreen();
             MainClass.showWindow(hm, this, MDI.ActiveForm);
         }
     }
 }
Beispiel #2
0
        private void logoutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            logoutToolStripMenuItem.Enabled = false;
            homeToolStripMenuItem.Enabled   = false;
            Login set = new Login();

            MainClass.showWindow(set, this);
        }
Beispiel #3
0
        private void SaveBtn_Click(object sender, EventArgs e)
        {
            string s;
            string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            if (IntSecChb.Checked)
            {
                if (ServerTxt.Text != "" && DatabaseTxt.Text != "")
                {
                    s = "Data Source=" + ServerTxt.Text + ";initial Catalog=" + DatabaseTxt.Text + ";Integrated Security=true;MultipleActiveResultSets=true;";
                    File.WriteAllText(path + "//connect", s);
                    DialogResult dr = MessageBox.Show("Settings Saved Successfully", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    if (dr == DialogResult.OK)
                    {
                        bool admincheck = retrieval.checkAdminExist();
                        if (admincheck == true)
                        {
                            Login log = new Login();
                            MainClass.showWindow(log, this, MDI.ActiveForm);
                        }
                        else
                        {
                            AdminEntry adm = new AdminEntry();
                            MainClass.showWindow(adm, this, MDI.ActiveForm);
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Please give information to continue..");
                }
            }
            else
            {
                if (ServerTxt.Text != "" && DatabaseTxt.Text != "" && UserIDTxt.Text != "" && PasswordTxt.Text != "")
                {
                    s = "Data Source=" + ServerTxt.Text + ";initial Catalog=" + DatabaseTxt.Text + ";User ID=" + UserIDTxt.Text + ";Password="******";MultipleActiveResultSets=true;";
                    File.WriteAllText(path + "//connect", s);
                    DialogResult dr = MessageBox.Show("Settings Saved Successfully", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    if (dr == DialogResult.OK)
                    {
                        Login log = new Login();
                        MainClass.showWindow(log, this, MDI.ActiveForm);
                    }
                }
                else
                {
                    MessageBox.Show("Please give information to continue..");
                }
            }
        }
Beispiel #4
0
        private void MDI_Load(object sender, EventArgs e)
        {
            string Path       = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            bool   adminexist = retrieval.checkAdminExist();

            if (File.Exists(Path + "\\connect"))
            {
                if (adminexist == false)
                {
                    AdminEntry adm = new AdminEntry();
                    MainClass.showWindow(adm, this);
                }
                else
                {
                    Login log = new Login();
                    MainClass.showWindow(log, this);
                }
            }
            else
            {
                settings set = new settings();
                MainClass.showWindow(set, this);
            }
        }
Beispiel #5
0
        public virtual void backBtn_Click(object sender, EventArgs e)
        {
            HomeScreen obj = new HomeScreen();

            MainClass.showWindow(obj, this, MDI.ActiveForm);
        }
Beispiel #6
0
        private void homeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            HomeScreen home = new HomeScreen();

            MainClass.showWindow(home, this);
        }
Beispiel #7
0
        private void proPricingBtn_Click(object sender, EventArgs e)
        {
            ProductPricing p = new ProductPricing();

            MainClass.showWindow(p, this, MDI.ActiveForm);
        }
Beispiel #8
0
        private void SalesBtn_Click(object sender, EventArgs e)
        {
            Sales s = new Sales();

            MainClass.showWindow(s, this, MDI.ActiveForm);
        }
Beispiel #9
0
        private void PurchaseInvoiceBtn_Click(object sender, EventArgs e)
        {
            PurchaseInvoice p = new PurchaseInvoice();

            MainClass.showWindow(p, this, MDI.ActiveForm);
        }
Beispiel #10
0
        private void CatogoryBtn_Click(object sender, EventArgs e)
        {
            Categories c = new Categories();

            MainClass.showWindow(c, this, MDI.ActiveForm);
        }
Beispiel #11
0
        private void userBtn_Click(object sender, EventArgs e)
        {
            Users u = new Users();

            MainClass.showWindow(u, this, MDI.ActiveForm);
        }
Beispiel #12
0
        private void SalesReturnBtn_Click(object sender, EventArgs e)
        {
            SalesReturnWindow sr = new SalesReturnWindow();

            MainClass.showWindow(sr, this, MDI.ActiveForm);
        }
Beispiel #13
0
        public override void backBtn_Click(object sender, EventArgs e)
        {
            PurchaseInvoice obj = new PurchaseInvoice();

            MainClass.showWindow(obj, this, MDI.ActiveForm);
        }
Beispiel #14
0
        public override void ViewBtn_Click(object sender, EventArgs e)
        {
            ViewSalesInvoice vws = new ViewSalesInvoice();

            MainClass.showWindow(vws, this, MDI.ActiveForm);
        }
Beispiel #15
0
        private void logInBtn_Click(object sender, EventArgs e)
        {
            Login log = new Login();

            MainClass.showWindow(log, this, MDI.ActiveForm);
        }
Beispiel #16
0
        public override void ViewBtn_Click(object sender, EventArgs e)
        {
            PurchaseInvoiceDetails piDetail = new PurchaseInvoiceDetails();

            MainClass.showWindow(piDetail, this, ActiveForm);
        }