Example #1
0
        private void AddLog(AssetsInformation model)
        {
            LogModel logModel = new LogModel();

            logModel.AssetName            = model.AssetName;
            logModel.AssetCode            = model.AssetCode;
            logModel.AssetModel           = model.AssetModel;
            logModel.ManagementDepartment = model.ManagementDepartment;
            logModel.UseDepartment        = model.UseDepartment;
            logModel.UseState             = model.UseState;
            logModel.UsePlace             = model.UsePlace;
            logModel.UseDate    = model.UseDate;
            logModel.CreateDate = DateTime.Now;
            using (var db = new LogInformationDB(dbPath))
            {
                db.Insert(logModel);
            }
        }
Example #2
0
 private void GetList()
 {
     using (var db = new LogInformationDB(dbPath))
     {
         List <LogModel> source = new List <LogModel>();
         if (!string.IsNullOrWhiteSpace(Code))
         {
             source = db.Query <LogModel>($"select AssetName from LogModel where AssetCode='{Code}'");
             if (source != null && source.Any())
             {
                 this.DataGrid.GenerateColumns(source,
                                               new ColumnDataDescriptor("资产名称", new DataColumn()
                 {
                     DataType = typeof(string), ColumnName = "AssetName",
                 }));
                 this.DataGrid.PrepareStyleForEditingData();
                 this.DataGrid.AddDataRowStateDrawingInRowHeaders();
             }
         }
     }
 }