コード例 #1
0
        public void ReturnToDispatcher(EPVDatabase database, SecurityUser user)
        {
            string query = "update docAppoints set point = 0, dateToPoint='31.12.2100' where id = " + id.ToString();

            database.ExecuteQuery(query);

            query = "delete from docAppointStates where appoint = @appoint and docState > 0";
            QueryParameters parameters = new QueryParameters("appoint", Id);

            database.ExecuteQuery(query, parameters);

            WriteLogRow(database, -1, user);
        }
コード例 #2
0
        public void UpdateComment(EPVDatabase database, string comment)
        {
            QueryParameters parameters = new QueryParameters("id", Id);

            parameters.Add("comment", comment);
            database.ExecuteQuery(DispatcherService.Resources.Doc.Permit.UpdateComment, parameters);
        }
コード例 #3
0
        private void SaveDeletedRow(EPVDatabase database)
        {
            QueryParameters parameters = new QueryParameters("id", Id);

            parameters.Add("userId", Modifier.Id);
            database.ExecuteQuery(QueryDelete, parameters);
        }
コード例 #4
0
        private void SaveModifiedRow(EPVDatabase database, ISystemUser user)
        {
            QueryParameters parameters = CreateParameters();

            parameters.Add("userId", user.Id);

            database.ExecuteQuery(UpdateQuery, parameters);
        }
コード例 #5
0
        private void WriteLogRow(EPVDatabase database, int stateId, SecurityUser user)
        {
            string          query      = DispatcherService.Resources.Doc.Appoint.InsertLog;
            QueryParameters parameters = new QueryParameters("appoint", Id);

            parameters.Add("appointState", stateId);
            parameters.Add("hostName", Environment.MachineName);
            parameters.Add("userName", user.Name);

            database.ExecuteQuery(query, parameters);
        }
コード例 #6
0
        internal void ClearNew(EPVDatabase database, ISystemUser user)
        {
            string          query      = DispatcherService.Resources.Doc.MaterialPermit.ClearNew;
            QueryParameters parameters = new QueryParameters("documentId", Id);

            parameters.Add("userId", user.Id);

            database.ExecuteQuery(query, parameters);

            IsNew = false;
        }
コード例 #7
0
        public void SetTimeComing(EPVDatabase database, DateTime dateComing, SecurityUser user)
        {
            if (id == 0)
            {
                return;
            }
            string          query      = "update docAppointStates set dateState = @date where appoint = @appoint and docState = 0";
            QueryParameters parameters = new QueryParameters("date", dateComing);

            parameters.Add("appoint", id);
            database.ExecuteQuery(query, parameters);

            WriteLogRow(database, 0, user);
        }
コード例 #8
0
        private void SetDocState(EPVDatabase database, int idState, DateTime date, Point pnt, SecurityUser user)
        {
            string query = "insert into docAppointStates (id, appoint, docState, dateState, point) ";

            query += "values (gen_id(gen_docAppointStates_id, 1), @appoint, @state, @time, @point)";
            QueryParameters parameters = new QueryParameters("appoint", id);

            parameters.Add("state", idState);
            parameters.Add("time", date);
            if (pnt == null)
            {
                parameters.Add("point", DBNull.Value);
            }
            else
            {
                parameters.Add("point", pnt.Id);
            }
            database.ExecuteQuery(query, parameters);

            WriteLogRow(database, idState, user);
        }
コード例 #9
0
        private void CreateAppoint()
        {
            Appoint appoint = new Appoint(PlanAppoint);

            appoint.Citizen = (State)cboxCountry.SelectedItem;
            appoint.SetComingDate(pickComingTime.Value);
            appoint.Unit    = (Unit)cboxUnit.SelectedItem;
            appoint.Warrant = tboxWarrant.Text;
            appoint.Trailer = tboxTrailer.Text;

            appoint.Save(Database);

            string          query      = DispatcherService.Resources.Doc.PlanAppoint.LinkToAppoint;
            QueryParameters parameters = new QueryParameters("plan", PlanAppoint.Id);

            parameters.Add("id", appoint.Id);
            Database.ExecuteQuery(query, parameters);


            FindForm().Close();
        }
コード例 #10
0
        private void SaveInsertedRow(EPVDatabase database)
        {
            Id = ((FirebirdDatabase)database).Generator("docPlanAppoint");

            database.ExecuteQuery(InsertQuery, CreateParameters());
        }
コード例 #11
0
        private void SaveDeletedRow(EPVDatabase database)
        {
            QueryParameters parameters = new QueryParameters("id", Id);

            database.ExecuteQuery(QueryDelete, parameters);
        }
コード例 #12
0
 private void SaveModifiedRow(EPVDatabase database)
 {
     database.ExecuteQuery(QueryUpdate, CreateParameters());
 }
コード例 #13
0
 private void SaveInsertedRow(EPVDatabase database)
 {
     Id = ((FirebirdDatabase)database).Generator(TableName);
     database.ExecuteQuery(QueryInsert, CreateParameters());
 }