/// <summary> /// Load Equipment Parts Data /// </summary> /// Owner:Andy Gao 2011-08-12 12:37:27 private void LoadPartsData() { string msg; int pageNo, pageSize, pages, records; this.paginationParts.GetPaginationProperties(out pageNo, out pageSize); DataTable dataTable = this.equipmentPartEntity.LoadPartsData(this.txtQueryValue.Text.Trim(), pageNo, pageSize, out pages, out records, out msg); if (string.IsNullOrEmpty(msg)) { this.paginationParts.SetPaginationProperties(pageNo, pageSize, pages, records); this.grdPartList.DataSource = dataTable; } else { this.grdPartList.DataSource = EMS_EQUIPMENT_PARTS_FIELDS.CreateDataTable(true); MessageService.ShowError(msg); } this.grvPartList.BestFitColumns(); State = ControlState.Read; }
protected override void InitUIControls() { #region Initial Parts Grid ControlUtils.InitialGridView(this.grvPartList, EMS_EQUIPMENT_PARTS_FIELDS.CreateDataTable(true)); #endregion }
public override bool Insert() { DataSet reqDS = new DataSet(); DataTable partsDataTable = EMS_EQUIPMENT_PARTS_FIELDS.CreateDataTable(false); Dictionary <string, string> dataRow = new Dictionary <string, string>() { { EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_KEY, partKey }, { EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_NAME, partName }, { EMS_EQUIPMENT_PARTS_FIELDS.FIELD_DESCRIPTION, description }, { EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_TYPE, partType }, { EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_MODE, partMode }, { EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_UNIT, partUnit }, { EMS_EQUIPMENT_PARTS_FIELDS.FIELD_CREATOR, Creator }, { EMS_EQUIPMENT_PARTS_FIELDS.FIELD_CREATE_TIMEZONE_KEY, CreateTimeZone }, { EMS_EQUIPMENT_PARTS_FIELDS.FIELD_CREATE_TIME, string.Empty } }; FanHai.Hemera.Utils.Common.Utils.AddKeyValuesToDataTable(ref partsDataTable, dataRow); partsDataTable.AcceptChanges(); reqDS.Tables.Add(partsDataTable); string msg; DataSet resDS = FanHai.Hemera.Utils.Common.Utils.ExecuteEngineMethod("FanHai.Hemera.Modules.EMS.EquipmentPartsEngine, FanHai.Hemera.Modules.EMS", "InsertPart", reqDS, out msg); if (string.IsNullOrEmpty(msg)) { CreateTime = resDS.ExtendedProperties.ContainsKey(PARAMETERS.OUTPUT_EDIT_TIME) ? resDS.ExtendedProperties[PARAMETERS.OUTPUT_EDIT_TIME].ToString() : string.Empty; return(true); } else { MessageService.ShowError(msg); return(false); } }
public override bool Update() { DataSet reqDS = new DataSet(); reqDS.ExtendedProperties.Add(PARAMETERS.INPUT_KEY, partKey); reqDS.ExtendedProperties.Add(PARAMETERS.INPUT_EDITOR, Editor); reqDS.ExtendedProperties.Add(PARAMETERS.INPUT_EDIT_TIME, EditTime); this.DirtyList.Add(EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EDIT_TIME, new DirtyItem(EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EDIT_TIME, string.Empty, string.Empty)); Editor = PropertyService.Get(PROPERTY_FIELDS.USER_NAME); EditTimeZone = PropertyService.Get(PROPERTY_FIELDS.TIMEZONE); DataTable partsDataTable = EMS_EQUIPMENT_PARTS_FIELDS.CreateDataTable(false); FanHai.Hemera.Utils.Common.Utils.AddKeyValuesToDataTable(ref partsDataTable, this.DirtyList); partsDataTable.AcceptChanges(); reqDS.Tables.Add(partsDataTable); string msg; DataSet resDS = FanHai.Hemera.Utils.Common.Utils.ExecuteEngineMethod("FanHai.Hemera.Modules.EMS.EquipmentPartsEngine, FanHai.Hemera.Modules.EMS", "UpdatePart", reqDS, out msg); if (string.IsNullOrEmpty(msg)) { EditTime = resDS.ExtendedProperties.ContainsKey(PARAMETERS.OUTPUT_EDIT_TIME) ? resDS.ExtendedProperties[PARAMETERS.OUTPUT_EDIT_TIME].ToString() : string.Empty; return(true); } else { MessageService.ShowError(msg); return(false); } }