Example #1
0
 public static bool InsertCar()
 {
     bool execute = true;
     foreach(List<object>car in cars)
         execute &= Access.Execute(SQL_Queries.Insert("cars", car));
     return execute;
 }
Example #2
0
        private void Treatment_Wizzard_Finish(object sender, EventArgs e)
        {
            int id = Assets.GetNewId("treatments");

            if (id == -1)
            {
                MessageBox.Show(Access.ExplaindError());
                return;
            }
            try
            {
                List <object> list = new List <object>()
                {
                    id,
                    Treatment_Name.Text,
                    Treatment_Decription.Text,
                    int.Parse(Treatment_Price.Text)
                };
                if (Access.Execute(SQL_Queries.Insert("treatments", list)))
                {
                    MessageBox.Show("טיפול חדש נכנס לטיפול");
                    Refresh_Screen();
                }
                else
                {
                    MessageBox.Show(Access.ExplaindError());
                }
            }
            catch
            {
            }
        }
Example #3
0
        public static bool InsertCar(List <object> values)
        {
            bool execute = Access.Execute(SQL_Queries.Insert("cars", values));

            if (execute)
            {
                Refresh();
            }
            return(execute);
        }
Example #4
0
        public static bool Enter(int id)
        {
            List <object> list = new List <object>()
            {
                getLastShift() + 1,
                id,
                DateTime.Today.ToShortDateString(),
                DateTime.Today.ToShortTimeString(),
                "not"
            };
            string query = SQL_Queries.Insert("shifts", list);

            if (Access.Execute(query))
            {
                Assets.Reload_Shifts();
                return(true);
            }
            return(false);
        }
Example #5
0
 private void Worker_Register_Finish(object sender, EventArgs e)
 {
     if (Wizzard_Helper.inputValidator(Worker_Profile_Panel) &&
         Wizzard_Helper.inputValidator(Worker_User_panel))
     {
         try
         {
             List <object> profile = new List <object>()
             {
                 int.Parse(Worker_Id.Text),
                 Worker_fname.Text,
                 Worker_lname.Text,
                 Worker_Bdate.Value.ToShortDateString(),
                 Worker_gender.Text,
                 Worker_phone.Text,
                 Worker_email.Text,
             }, user = new List <object>()
             {
                 int.Parse(Worker_Id.Text),
                 Worker_password.Text,
                 Worker_Admin.Checked
             };
             if (Access.Execute(SQL_Queries.Insert("people", profile)) && Access.Execute(SQL_Queries.Insert("workers", user)))
             {
                 Refresh_Screen();
                 MessageBox.Show("inserted");
             }
             else
             {
                 MessageBox.Show(Access.ExplaindError());
                 Access.Execute(SQL_Queries.Delete("people", new Condition("id", int.Parse(Worker_Id.Text))));
             }
         }
         catch
         {
         }
     }
     else
     {
         MessageBox.Show("אנא מלא את השדות החסרים");
     }
 }
Example #6
0
 public static bool InsertPerson(List<object> values)
 {
     return Access.Execute(SQL_Queries.Insert("people", values));
 }