Beispiel #1
0
        public static bool updateWorker()
        {
            Row       columes = new Row( );
            Condition con     = new Condition("id", int.Parse(worker.GetColValue("id").ToString()));

            columes.AddColume(new Col("password", worker.GetColValue("password")));
            return(Access.Execute(SQL_Queries.Update("workers", columes.GetColumes(), con)));
        }
Beispiel #2
0
        public static bool UpdateTreatment(List <Col> values)
        {
            if (Selected_Treatment == -1)
            {
                return(false);
            }
            Condition condition = new Condition("id", int.Parse(GetValue("id")));

            return(Access.Execute(SQL_Queries.Update("treatments", values, condition)));
        }
Beispiel #3
0
        public static void Exit(int id)
        {
            string query;

            foreach (Row row in Assets.shifts)
            {
                if (row.GetColValue("end_shift").ToString() == "not")
                {
                    row.UpdateColume(new Col("end_shift", DateTime.Today.ToShortTimeString()));
                    query = SQL_Queries.Update("shifts", row.GetColumes(), new Condition("shift", row.GetColValue("shift")));
                    Access.Execute(query);
                }
            }
        }
Beispiel #4
0
        public static bool UpdateUser(List <Col> update)
        {
            bool execute = Access.Execute(SQL_Queries.Update("people", update, new Condition("id", user_id)));

            if (execute)
            {
                foreach (Col col in update)
                {
                    if (col.GetField() == "id")
                    {
                        user_id = (int)(col.GetValue());
                        break;
                    }
                }
                user.UpdateColume(update);
                GetUserInfo();
            }
            return(execute);
        }
Beispiel #5
0
        public static bool UpdateCar(List <Col> update, int number)
        {
            MessageBox.Show(SQL_Queries.Update("cars", update, new Condition("number", number)));
            bool execute = Access.Execute(SQL_Queries.Update("cars", update, new Condition("car_number", number)));

            if (execute)
            {
                foreach (Row row in cars)
                {
                    if (row.GetColValue("car_number").ToString() == number.ToString())
                    {
                        row.UpdateColume(update);
                        break;
                    }
                }
                Refresh();
            }

            return(execute);
        }