private void Add_Click(object sender, RoutedEventArgs e)
        {
            String Name = ProdN.Text;
            int    Price;

            try { Price = Convert.ToInt32(ProdP.Text); }
            catch
            {
                this.Title = "Erorr";
                return;
            }

            if (ProdN.Text == "" || ProdP.Text == "")
            {
                this.Title = "Erorr";
                return;
            }
            Product_tbl a1 = new Product_tbl();

            a1.ProdName  = Name;
            a1.ProdPrice = Price;

            db.Product_tbl.Add(a1);
            db.SaveChanges();
            this.Title = "Employee Add";

            ProdN.Text = "";
            ProdP.Text = "";

            this.Title = "sucsses";
            UpdateDGV();
            updateCB();
        }
Beispiel #2
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            String Name = PoolN.Text;
            String City = PoolC.Text;


            /*בודק שהוכנסו כל הנתונים שהם חובה
             * EmpN name of textBox*/
            if (PoolN.Text == "" || PoolC.Text == "")
            {
                this.Title = "Erorr";
                return;
            }

            /*   שומר את הנתונים שהוקלדו והוכנסו אל המשתנים המתאימים בטבלה
             * EmpName השם של העמודה בטבלה*/
            Pool_Tbl a1 = new Pool_Tbl();

            a1.PoolCity = City;
            a1.PoolName = Name;



            db.Pool_Tbl.Add(a1);
            db.SaveChanges();
            this.Title = "Employee Add";

            PoolN.Text = "";
            PoolC.Text = "";

            this.Title = "sucsses";
            UpdateDGV();
            updateCB();
        }
Beispiel #3
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            int    Price  = (ProdCombo.SelectedItem as Product_tbl).ProdPrice;
            int    Amount = Convert.ToInt32(ExpA.Text);
            String Date   = ExpD.Text;
            String Pname  = (ProdCombo.SelectedItem as Product_tbl).ProdName;
            int    Id;

            try { Id = (ProdCombo.SelectedItem as Product_tbl).ProdId; }
            catch
            {
                this.Title = "Erorr";
                return;
            }
            int Sum = Price * Amount;

            /*בודק שהוכנסו כל הנתונים שהם חובה
             * EmpN name of textBox*/
            if (ExpA.Text == "" || ExpD.Text == "")
            {
                this.Title = "Erorr";
                return;
            }

            /*   שומר את הנתונים שהוקלדו והוכנסו אל המשתנים המתאימים בטבלה
             * EmpName השם של העמודה בטבלה*/
            Expense_Tbl a1 = new Expense_Tbl();

            a1.ExpenseDate        = Date;
            a1.ExpenseAmount      = Amount;
            a1.ExpenseProductId   = Id;
            a1.ExpenseSum         = Sum;
            a1.ExpenseProductName = Pname;



            db.Expense_Tbl.Add(a1);
            db.SaveChanges();
            this.Title = "Employee Add";

            ExpD.Text      = "";
            ExpA.Text      = "";
            ProdCombo.Text = "";


            this.Title = "sucsses";
            UpdateDGV();
            updateCB();
        }
Beispiel #4
0
        private void ADD(object sender, RoutedEventArgs e)
        {
            int    Pid, Tid;
            String Pname = (Pcombo.SelectedItem as Pool_Tbl).PoolName;
            String Date  = SchD.Text;
            String Tname = (Tcombo.SelectedItem as Teams_Tbl).TeamName;

            try { Pid = (Pcombo.SelectedItem as Pool_Tbl).PoolId;  Tid = (Tcombo.SelectedItem as Teams_Tbl).TeamId; }
            catch
            {
                this.Title = "Erorr";
                return;
            }

            /*בודק שהוכנסו כל הנתונים שהם חובה
             * EmpN name of textBox*/
            if (SchD.Text == "")
            {
                this.Title = "Erorr";
                return;
            }

            /*   שומר את הנתונים שהוקלדו והוכנסו אל המשתנים המתאימים בטבלה
             * EmpName השם של העמודה בטבלה*/
            Schedule_Tbl a1 = new Schedule_Tbl();

            a1.ScheduleDate   = Date;
            a1.Team           = Tname;
            a1.ScheduleTeamId = Tid;
            a1.Pool           = Pname;
            a1.SchedulePoolId = Pid;



            db.Schedule_Tbl.Add(a1);
            db.SaveChanges();
            this.Title = "schedule Add";

            SchD.Text   = "";
            Pcombo.Text = "";
            Tcombo.Text = "";


            this.Title = "sucsses";
            UpdateDGV();
            updateCB();
        }
Beispiel #5
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            int    Emp;
            String Name    = WorkN.Text;
            String Date    = WorkD.Text;
            String EmpName = (Ecombo.SelectedItem as Employees_Tbl).EmpName;

            try { Emp = (Ecombo.SelectedItem as Employees_Tbl).EmpId; }
            catch
            {
                this.Title = "Erorr";
                return;
            }

            /*בודק שהוכנסו כל הנתונים שהם חובה
             * EmpN name of textBox*/
            if (WorkN.Text == "" || WorkD.Text == "")
            {
                this.Title = "Erorr";
                return;
            }

            /*   שומר את הנתונים שהוקלדו והוכנסו אל המשתנים המתאימים בטבלה
             * EmpName השם של העמודה בטבלה*/
            WorkShop_Tbl a1 = new WorkShop_Tbl();

            a1.WorkShopDate         = Date;
            a1.WorkShopName         = Name;
            a1.WorkShopEmployee     = Emp;
            a1.WorkShopEmployeeName = EmpName;



            db.WorkShop_Tbl.Add(a1);
            db.SaveChanges();
            this.Title = "Employee Add";

            WorkD.Text  = "";
            WorkN.Text  = "";
            Ecombo.Text = "";


            this.Title = "sucsses";
            UpdateDGV();
            updateCB();
        }
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            /*מעביר את הנתונים שהוכנסו למשתנה מתאים
             * EmpN name of textBox*/
            String Name     = EmpN.Text;
            String Email    = EmpE.Text;
            String Phone    = EmpP.Text;
            String Function = EmpF.Text;
            String Address  = EmpA.Text;



            /*בודק שהוכנסו כל הנתונים שהם חובה
             * EmpN name of textBox*/
            if (EmpN.Text == "" || EmpF.Text == "" || EmpP.Text == "" || EmpA.Text == "")
            {
                this.Title = "Erorr";
                return;
            }

            /*   שומר את הנתונים שהוקלדו והוכנסו אל המשתנים המתאימים בטבלה
             * EmpName השם של העמודה בטבלה*/
            Employees_Tbl a1 = new Employees_Tbl();

            a1.EmpName     = Name;
            a1.EmpMail     = Email;
            a1.EmpPhone    = Phone;
            a1.EmpFunction = Function;
            a1.EmpAddress  = Address;



            db.Employees_Tbl.Add(a1);
            db.SaveChanges();
            this.Title = "Employe Add";

            EmpN.Text = "";
            EmpE.Text = "";
            EmpP.Text = "";
            EmpF.Text = "";
            EmpA.Text = "";

            this.Title = "sucsses";
            UpdateDGV();
            updateCB();
        }
Beispiel #7
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            String Name    = StuN.Text;
            String Email   = StuM.Text;
            String Phone   = StuP.Text;
            String Age     = StuAge.Text;
            String Address = StuAdd.Text;



            /*בודק שהוכנסו כל הנתונים שהם חובה
             * EmpN name of textBox*/
            if (StuN.Text == "" || StuAge.Text == "" || StuP.Text == "" || StuAdd.Text == "")
            {
                this.Title = "Erorr";
                return;
            }

            /*   שומר את הנתונים שהוקלדו והוכנסו אל המשתנים המתאימים בטבלה
             * EmpName השם של העמודה בטבלה*/
            Students_Tbl a1 = new Students_Tbl();

            a1.StudentName    = Name;
            a1.StudentMail    = Email;
            a1.StudentPhone   = Phone;
            a1.StudentAge     = Age;
            a1.StudentAddress = Address;



            db.Students_Tbl.Add(a1);
            db.SaveChanges();
            this.Title = "Employe Add";

            StuN.Text   = "";
            StuM.Text   = "";
            StuP.Text   = "";
            StuAdd.Text = "";
            StuAge.Text = "";

            this.Title = "sucsses";
            UpdateDGV();
            updateCB();
        }
Beispiel #8
0
        private void Add_click(object sender, RoutedEventArgs e)
        {
            String Name  = TeamN.Text;
            String Date  = TeamS.Text;
            String Level = TeamL.Text;
            String Ename = (Ecombo.SelectedItem as Employees_Tbl).EmpName;
            int    Emp   = (Ecombo.SelectedItem as Employees_Tbl).EmpId;


            /*בודק שהוכנסו כל הנתונים שהם חובה
             * EmpN name of textBox*/
            if (TeamL.Text == "" || TeamN.Text == "" || Ecombo.Text == "")
            {
                this.Title = "Erorr";
                return;
            }

            /*   שומר את הנתונים שהוקלדו והוכנסו אל המשתנים המתאימים בטבלה
             * EmpName השם של העמודה בטבלה*/
            Teams_Tbl a1 = new Teams_Tbl();

            a1.TeamStartDate    = Date;
            a1.TeamName         = Name;
            a1.TeamEmployee     = Emp;
            a1.TeamLevel        = Level;
            a1.TeamEmployeeName = Ename;


            db.Teams_Tbl.Add(a1);
            db.SaveChanges();
            this.Title = "Employee Add";

            TeamS.Text  = "";
            TeamN.Text  = "";
            Ecombo.Text = "";
            TeamL.Text  = "";

            this.Title = "sucsses";
            UpdateDGV();
            updateCB();
        }