void IRepositoryCreatedEntity.SaveToRecordset(IMRecordset source) { source.Put(MD.Inspection.Fields.Id, this.Id); source.Put(MD.Inspection.Fields.Type, this.Type); source.Put(MD.Inspection.Fields.Status, this.Status); source.Put(MD.Inspection.Fields.DoItAfter, this.DoItAfter); source.Put(MD.Inspection.Fields.DoItBefore, this.DoItBefore); source.Put(MD.Inspection.Fields.TourId, this.TourId); source.Put(MD.Inspection.Fields.StationTableName, this.StationTableName); source.Put(MD.Inspection.Fields.StationTableId, this.StationTableId); }
void IRepositoryUpdatedEntity.SaveToRecordset(IMRecordset source) { source.Put(MD.Tours.Fields.Status, this.Status); }
public static void PutNextId(this IMRecordset recordset, string tableNmae, string fieldName) { recordset.Put(fieldName, IM.AllocID(tableNmae, 1, -1)); }
public static void WriteToDb(Record record) { try { var logsRs = new IMRecordset(MD.SysLogs.TableName, IMRecordset.Mode.ReadWrite); using (var logsRsScope = logsRs.OpenForAdd( MD.SysLogs.Fields.Id, MD.SysLogs.Fields.Event, MD.SysLogs.Fields.TableName, MD.SysLogs.Fields.Count, MD.SysLogs.Fields.Info, MD.SysLogs.Fields.Who, MD.SysLogs.Fields.When )) { var currentTime = DateTime.Now; var currentUser = IM.ConnectedUser(); logsRs.AddNew(MD.SysLogs.TableName, MD.SysLogs.Fields.Id); logsRs.Put(MD.SysLogs.Fields.Event, record.Type.ToString()); logsRs.Put(MD.SysLogs.Fields.TableName, MD.SysLogs.TableName); logsRs.Put(MD.SysLogs.Fields.Count, 1); logsRs.Put(MD.SysLogs.Fields.Info, $"{record.Process}: {record.Message}"); logsRs.Put(MD.SysLogs.Fields.Who, currentUser); logsRs.Put(MD.SysLogs.Fields.When, currentTime); logsRs.Update(); if (record.Duration > 0) { logsRs.AddNew(MD.SysLogs.TableName, MD.SysLogs.Fields.Id); logsRs.Put(MD.SysLogs.Fields.Event, record.Type.ToString()); logsRs.Put(MD.SysLogs.Fields.TableName, MD.SysLogs.TableName); logsRs.Put(MD.SysLogs.Fields.Count, 1); logsRs.Put(MD.SysLogs.Fields.Info, $"{record.Process}: Duration {record.Duration}ms"); logsRs.Put(MD.SysLogs.Fields.Who, currentUser); logsRs.Put(MD.SysLogs.Fields.When, currentTime); logsRs.Update(); } if (!string.IsNullOrEmpty(record.Data)) { logsRs.AddNew(MD.SysLogs.TableName, MD.SysLogs.Fields.Id); logsRs.Put(MD.SysLogs.Fields.Event, record.Type.ToString()); logsRs.Put(MD.SysLogs.Fields.TableName, MD.SysLogs.TableName); logsRs.Put(MD.SysLogs.Fields.Count, 1); logsRs.Put(MD.SysLogs.Fields.Info, $"{record.Process}: {record.Data}"); logsRs.Put(MD.SysLogs.Fields.Who, currentUser); logsRs.Put(MD.SysLogs.Fields.When, currentTime); logsRs.Update(); } } } catch (Exception e) { System.Windows.Forms.MessageBox.Show(e.ToString(), "Logger.WriteToDb", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } }
void IRepositoryUpdatedEntity.SaveToRecordset(IMRecordset source) { source.Put(MD.Allotments.Fields.Status, this.Status); source.Put(MD.Allotments.Fields.MeasTaskId, this.MeasTaskId); }