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); }
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); }
private void SaveDeletedRow(EPVDatabase database) { QueryParameters parameters = new QueryParameters("id", Id); parameters.Add("userId", Modifier.Id); database.ExecuteQuery(QueryDelete, parameters); }
private void SaveModifiedRow(EPVDatabase database, ISystemUser user) { QueryParameters parameters = CreateParameters(); parameters.Add("userId", user.Id); database.ExecuteQuery(UpdateQuery, parameters); }
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); }
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; }
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); }
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); }
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(); }
private void SaveInsertedRow(EPVDatabase database) { Id = ((FirebirdDatabase)database).Generator("docPlanAppoint"); database.ExecuteQuery(InsertQuery, CreateParameters()); }
private void SaveDeletedRow(EPVDatabase database) { QueryParameters parameters = new QueryParameters("id", Id); database.ExecuteQuery(QueryDelete, parameters); }
private void SaveModifiedRow(EPVDatabase database) { database.ExecuteQuery(QueryUpdate, CreateParameters()); }
private void SaveInsertedRow(EPVDatabase database) { Id = ((FirebirdDatabase)database).Generator(TableName); database.ExecuteQuery(QueryInsert, CreateParameters()); }