public Delete_Admin(Admin_Home ah)
 {
     InitializeComponent();
     this.ah = ah;
     AutoCompleteText1();
     AutoCompleteText();
 }
        private void Back_Click(object sender, EventArgs e)
        {
            Admin_Home a4 = new Admin_Home();

            a4.Show();
            this.Hide();
        }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            Admin_Home a1 = new Admin_Home();

            a1.Show();
            this.Hide();
        }
Exemple #4
0
        public AddSalesman(Admin_Home a1)
        {
            InitializeComponent();


            label11.Text = ss.SId;
            this.a1      = a1;
        }
 public Add_Product(Admin_Home a)
 {
     InitializeComponent();
     label11.Text = pp.PID;
     this.a       = a;
     timer1.Start();
     label9.Hide();
 }
        private void button2_Click(object sender, EventArgs e)
        {
            string a, b;

            a = textBox2.Text;
            b = textBox3.Text;

            if (a.Equals(b))
            {
                SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Lenovo\Desktop\project final\try table with\Super_shop_test_1.mdf;Integrated Security=True;Connect Timeout=30");
                con.Open();
                SqlCommand    s1 = new SqlCommand("SELECT * FROM Customerinfo where userId = '" + nm + "' and password = '******'", con);
                SqlDataReader dt;
                dt = s1.ExecuteReader();
                int c = 0;
                while (dt.Read())
                {
                    c += 1;
                }
                con.Close();
                if (c == 1)
                {
                    if (a.Equals(b) && a.Length > 0)
                    {
                        SqlConnection con2 = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Lenovo\Desktop\project final\try table with\Super_shop_test_1.mdf;Integrated Security=True;Connect Timeout=30");
                        con2.Open();
                        SqlCommand s = new SqlCommand("UPDATE Customerinfo SET  password = '******' where userId = '" + nm + "'", con2);
                        if (s.ExecuteNonQuery() == 1)
                        {
                            MessageBox.Show("Successfully Saved");
                        }
                        else
                        {
                            MessageBox.Show("Error");
                        }
                        con2.Close();
                    }
                    else
                    {
                        MessageBox.Show("Password don't Match", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }

                else if (c > 0)
                {
                    MessageBox.Show("Wrong Password", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    MessageBox.Show("Wrong Password", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                //MessageBox.Show("Save Changes","Done",MessageBoxButtons.OK,MessageBoxIcon.Asterisk);
            }
        }
        public Profit(Admin_Home ah)
        {
            InitializeComponent();

            this.ah = ah;
            timer1.Start();
            SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Lenovo\Desktop\project final\try table with\Super_shop_test_1.mdf;Integrated Security=True;Connect Timeout=30");

            con.Open();
            SqlCommand    s  = new SqlCommand("SELECT * From profita ", con);
            SqlDataReader dt = s.ExecuteReader();

            /// db.UpdateWholeProfita(label4.Text, (Convert.ToSingle(label11.Text) + Convert.ToSingle(label6.Text) + Convert.ToSingle(textBox1.Text)) - Convert.ToSingle(label2.Text));

            while (dt.Read())
            {
                label11.Text  = Convert.ToString(dt[0]);
                label2.Text   = Convert.ToString(dt[1]);
                label6.Text   = Convert.ToString(dt[3]);
                label10.Text  = Convert.ToString(dt[5]);
                label8.Text   = Convert.ToString(dt[4]);
                textBox1.Text = Convert.ToString(dt[2]);
            }
            whole = Convert.ToSingle(label2.Text) - (Convert.ToSingle(label11.Text) + Convert.ToSingle(label6.Text) + Convert.ToSingle(textBox1.Text));
            db.UpdateWholeProfita(whole);

            textBox1.Enabled = false;

            //

            stor = db.GetStorecostPRofit() + Convert.ToSingle(textBox1.Text);



            //  db.UpdateProfit(stor, label4.Text, whole);
            SqlConnection con1 = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Lenovo\Desktop\project final\try table with\Super_shop_test_1.mdf;Integrated Security=True;Connect Timeout=30");

            con1.Open();
            SqlCommand    s1  = new SqlCommand("SELECT * From profita ", con1);
            SqlDataReader dt1 = s1.ExecuteReader();

            while (dt1.Read())
            {
                label11.Text  = Convert.ToString(dt1[0]);
                label2.Text   = Convert.ToString(dt1[1]);
                label6.Text   = Convert.ToString(dt1[3]);
                label10.Text  = Convert.ToString(dt1[5]);
                label8.Text   = Convert.ToString(dt1[4]);
                textBox1.Text = Convert.ToString(dt1[2]);
            }
        }
        public Update_Salesman_Info(Admin_Home a2)
        {
            InitializeComponent();
            this.a2 = a2;
            AutoCompleteText();
            t.Rows.Clear();
            t.Columns.Clear();
            dataGridView1.DataSource = t;
            SqlConnection con1 = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Lenovo\Desktop\project final\try table with\Super_shop_test_1.mdf;Integrated Security=True;Connect Timeout=30");

            con1.Open();

            string sl = string.Format("SELECT SId,name,email,mobileNo,address,salary FROM Salesmaninfo");

            SqlCommand s = new SqlCommand(sl, con1);

            SqlDataAdapter dt = new SqlDataAdapter(s);

            dt.Fill(t);
            dataGridView1.DataSource = t;
            label10.Hide();
        }
Exemple #9
0
        public Update_Admin(Admin_Home a7)
        {
            InitializeComponent();
            this.a7 = a7;
            AutoCompleteText();
            t.Rows.Clear();
            t.Columns.Clear();
            dataGridView1.DataSource = t;
            SqlConnection con1 = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=D:\C# pro\try table with\Super_shop_test_1.mdf;Integrated Security=True;Connect Timeout=30");

            con1.Open();

            string sl = string.Format("SELECT AId,name,email,mobileNo,address FROM Admininfo");

            SqlCommand s = new SqlCommand(sl, con1);

            SqlDataAdapter dt = new SqlDataAdapter(s);

            dt.Fill(t);
            dataGridView1.DataSource = t;
            label10.Hide();
        }
Exemple #10
0
        public CustomerDetails(Admin_Home aa)
        {
            InitializeComponent();
            this.aa = aa;


            t.Rows.Clear();
            dataGridView1.DataSource = t;
            SqlConnection con1 = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Lenovo\Desktop\project final\try table with\Super_shop_test_1.mdf;Integrated Security=True;Connect Timeout=30");

            con1.Open();

            string sl = string.Format("SELECT userId,name,mobileNo,discount,count FROM Customerinfo");

            SqlCommand s = new SqlCommand(sl, con1);

            SqlDataAdapter dt = new SqlDataAdapter(s);

            dt.Fill(t);
            dataGridView1.DataSource = t;
            t.DefaultView.Sort       = "count asc";
            t = t.DefaultView.ToTable(true);
        }
        public Salary(Admin_Home ah)
        {
            InitializeComponent();
            this.ah = ah;
            timer1.Start();

            t.Rows.Clear();
            dataGridView1.DataSource = t;
            SqlConnection con1 = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Lenovo\Desktop\project final\try table with\Super_shop_test_1.mdf;Integrated Security=True;Connect Timeout=30");

            con1.Open();

            string sl = string.Format("SELECT SId,salary,salarystatus,paiddate FROM Salesmaninfo");

            SqlCommand s = new SqlCommand(sl, con1);

            SqlDataAdapter dt = new SqlDataAdapter(s);

            dt.Fill(t);
            dataGridView1.DataSource = t;
            // t.DefaultView.Sort = "count asc";
            t = t.DefaultView.ToTable(true);
            label10.Hide();
        }
Exemple #12
0
 public Add_Product(Admin_Home a)
 {
     InitializeComponent();
     label11.Text = pp.PID;
     this.a       = a;
 }
 public Update_Product(Admin_Home a8)
 {
     InitializeComponent();
     this.a8 = a8;
     timer1.Start();
 }
Exemple #14
0
 public Delete_Product(Admin_Home a)
 {
     InitializeComponent();
     this.a = a;
 }
Exemple #15
0
 public Add_Admin(Admin_Home a)
 {
     InitializeComponent();
     label11.Text = aa.AID;
     this.a       = a;
 }
 public PasswordChangeA(Admin_Home a, string nm)
 {
     InitializeComponent();
     this.a  = a;
     this.nm = nm;
 }
Exemple #17
0
        private void button1_Click(object sender, EventArgs e)
        {
            string identi = textBox1.Text;
            int    l      = textBox1.Text.Length;
            int    l1     = textBox2.Text.Length;

            if (l == 5 || l == 6 || l == 7)
            {
                SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=D:\C# pro\try table with\Super_shop_test_1.mdf;Integrated Security=True;Connect Timeout=30");
                con.Open();
                SqlCommand    s1 = new SqlCommand("SELECT * FROM Admininfo where AId = '" + textBox1.Text + "' and password = '******'", con);
                SqlDataReader dt;
                dt = s1.ExecuteReader();
                int c = 0;

                while (dt.Read())
                {
                    c += 1;
                }
                if (c == 1)
                {
                    Admin_Home ah = new Admin_Home(identi);
                    ah.Show();
                    this.Hide();
                }
                else if (c > 0)
                {
                    MessageBox.Show("Wrong User Id or password", "Waring", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else
                {
                    MessageBox.Show("Wrong User Id or password", "Waring", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                textBox1.Text = textBox1.Text;
                textBox2.Clear();
            }
            else if (l == 8 || l == 9 || l == 10 || l == 11)
            {
                SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=D:\C# pro\try table with\Super_shop_test_1.mdf;Integrated Security=True;Connect Timeout=30");
                con.Open();
                SqlCommand    s1 = new SqlCommand("SELECT * FROM Salesmaninfo where SId = '" + textBox1.Text + "' and password = '******'", con);
                SqlDataReader dt;
                dt = s1.ExecuteReader();
                int c = 0;

                while (dt.Read())
                {
                    c += 1;
                }
                if (c == 1)
                {
                    Salesman_Home sh = new Salesman_Home(identi);
                    sh.Show();
                    this.Hide();
                }
                else if (c > 0)
                {
                    MessageBox.Show("Wrong User Id or password", "Waring", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else
                {
                    MessageBox.Show("Wrong User Id or password", "Waring", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                textBox1.Text = textBox1.Text;
                textBox2.Clear();
            }

            else
            {
                MessageBox.Show("Wrong User Id or password", "Waring", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }