public void GetToPoint(EPVDatabase database, Point pnt, DateTime time, string reason, SecurityUser user)
        {
            Point       = pnt;
            IdleReason  = reason;
            DateToPoint = time;

            Save(database);

            if ((int)database.ExecuteScalar("select count(id) from docAppointStates where docState = 1 and appoint = " + id.ToString())
                == 0)
            {
                SetDocState(database, 1, Point, user);
            }
        }
Beispiel #2
0
        public PlanAppoint GetLastPlanAppoint(EPVDatabase database)
        {
            string          query      = DispatcherService.Resources.Ref.Vehicle.GetLastPlanAppoint;
            QueryParameters parameters = new QueryParameters("id", Id);
            object          result     = database.ExecuteScalar(query, parameters);

            if (result != null && !DBNull.Value.Equals(result))
            {
                PlanAppoint planAppoint = PlanAppoint.Load(database, (int)result);
                return(planAppoint);
            }

            return(null);
        }
        private void GetUserRole()
        {
            string          query      = DispatcherService.Resources.Doc.MaterialPermit.GetUserRole;
            QueryParameters parameters = new QueryParameters("userId", User.Id);

            parameters.Add("unitId", ((Unit)cboxUnit.SelectedItem).Id);

            object result = Database.ExecuteScalar(query, parameters);

            if (result == null)
            {
                IsCreator = false;
                IsSigner  = false;
            }
            else
            {
                IsCreator = true;
                IsSigner  = ((int)result == 5);
            }
        }
        public string GetComment(EPVDatabase database)
        {
            QueryParameters parameters = new QueryParameters("id", Id);

            return((string)database.ExecuteScalar(DispatcherService.Resources.Doc.Permit.GetComment, parameters));
        }