Ejemplo n.º 1
0
        private void label4_Click(object sender, EventArgs e)
        {
            ManagerList M = new ManagerList();

            M.Show();
            this.Hide();
        }
Ejemplo n.º 2
0
        public void SearchMan(int s, string mname, string mpassword, string memail, string mcontact, int msalary, ManagerList m)
        {
            ID = s; NAME = mname; PASSWORD = mpassword; EMAIL = memail; CONTACT = mcontact; SALARY = msalary;

            /*   if (ID == a) {
             *
             *     m.ErrorMassage("No data found");
             * } */
            //  new DataAccess().SearchManager(ID,NAME,PASSWORD,EMAIL,CONTACT,SALARY,this,m);
            //  new DataAccess().SearchManager(s,mname, mpassword, memail, mcontact, msalary,this, m);
            //  new DataAccess().GetManagerData(s, mname, mpassword, memail, mcontact, msalary, m);
        }
Ejemplo n.º 3
0
 public void EditMan(int s, string mname, string mpassword, string memail, string mcontact, int msalary, ManagerList me)
 {
     NAME = mname; PASSWORD = mpassword; PASSWORD = mpassword; EMAIL = memail; CONTACT = mcontact; SALARY = msalary;
     new DataAccess().UpdateManager(s, mname, mpassword, memail, mcontact, msalary, me);
     me.ErrorMassage3("One Row Updated");
 }
Ejemplo n.º 4
0
        public void AddManager(string mname, string mpassword, string memail, string mcontact, int msalary, ManagerList M)
        {
            if (mname.Equals("") || mpassword.Equals("") || memail.Equals("") || mcontact.Equals("") || msalary.Equals(""))
            {
                M.ErrorMassage("Fill all the entries correctly");
            }

            else
            {
                NAME = mname; PASSWORD = mpassword; PASSWORD = mpassword; EMAIL = memail; CONTACT = mcontact; SALARY = msalary;
                new DataAccess().NewManager(mname, mpassword, memail, mcontact, msalary, M);
            }
        }
Ejemplo n.º 5
0
        public void GetManagerData(int id, string name, string pass, string email, string contNo, float sal, ManagerList MO)
        {
            MydbDataContext cntx = new MydbDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Oyan Computer\Desktop\Project\Project\Forms\Mydb.mdf;Integrated Security=True");

            var str = from a in cntx.Managers

                      where a.Id == id

                      select a;
            //  dataGridView1.DataSource = str;
        }
Ejemplo n.º 6
0
        public void UpdateManager(int id, string name, string pass, string email, string contNo, int sal, ManagerList MO)
        {
            MydbDataContext cntx = new MydbDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Oyan Computer\Desktop\Project\Project\Forms\Mydb.mdf;Integrated Security=True");
            var             str  = from a in cntx.Managers
                                   where a.Id == id
                                   select a;
            Manager M = str.First();

            M.Id        = id;
            M.UserName  = name;
            M.Password  = pass;
            M.Email     = email;
            M.ContactNo = contNo;
            //  M.Salary = sal;
            M.Salary = sal;

            cntx.SubmitChanges();

            name   = M.UserName;
            pass   = M.Password;
            email  = M.Email;
            contNo = M.ContactNo;
            sal    = Convert.ToInt32(M.Salary);

            cntx.SubmitChanges();
        }
Ejemplo n.º 7
0
        /*  public void SearchManager(int ab,string name, string pass, string email, string contNo, int sal,AdminOperation A, ManagerList MO) {
         *
         *
         * /*    foreach (var x in list)
         *    {
         *        productName = x.Item_name;
         *        quantity = x.Quantity.ToString();
         *        categoryName = x.Category.Category_name;
         *        price = x.Unit_price.ToString();
         *        details = x.Item_description;
         *        sellerId = x.Seller_id.ToString();
         *        sellerName = x.Customer.Customer_name;
         *        phn = x.Customer.Phone_number;
         *        email = x.Customer.Email;
         *        country = x.Customer.Addresses.Country.Country_name;
         *
         *    }
         *
         *    //Manager mo = str.First();
         *    foreach (var a in str)
         *    {
         *      //  ab = a.Id;
         *        name = a.UserName;
         *        pass = a.Password;
         *        email = a.Email;
         *        contNo = a.ContactNo;
         *        sal = a.Salary;
         *
         *    }
         *
         *
         *
         *    cnt.SubmitChanges();
         *
         * }*/


        public void DeleteManager(int id, string name, string pass, string email, string contNo, float sal, ManagerList MO)
        {
            MydbDataContext cntx = new MydbDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Oyan Computer\Desktop\Project\Project\Forms\Mydb.mdf;Integrated Security=True");
            var             str  = from a in cntx.Managers
                                   where a.Id == id
                                   select a;
            Manager M = str.First();

            cntx.Managers.DeleteOnSubmit(M);
            cntx.SubmitChanges();
        }
Ejemplo n.º 8
0
        public void NewManager(string name, string pass, string email, string contNo, int sal, ManagerList M)
        {
            MydbDataContext cntx = new MydbDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\USER\Desktop\Project\Project\Forms\Mydb.mdf;Integrated Security=True");
            Manager         Man  = new Manager();
            People          P    = new People();


            cntx.Managers.InsertOnSubmit(Man);
            cntx.Peoples.InsertOnSubmit(P);

            Man.UserName  = name;
            Man.Password  = pass;
            Man.Email     = email;
            Man.ContactNo = contNo;
            Man.Salary    = sal;

            P.UserName = name;
            P.password = pass;
            P.UserType = "Manager";



            cntx.SubmitChanges();


            new ManagerList().ErrorMassage("Successfully added");

            cntx.Dispose();
        }