示例#1
0
        /// <summary>
        /// Load Check List Data
        /// </summary>
        /// <param name="checkListName"></param>
        /// Owner:Andy Gao 2011-07-14 12:41:00
        private void LoadCheckListData(string checkListName)
        {
            string msg;

            int pageNo, pageSize, pages, records;

            this.paginationCheckList.GetPaginationProperties(out pageNo, out pageSize);

            DataTable dataTable = this.equipmentCheckListEntity.LoadCheckListData(checkListName, pageNo, pageSize, out pages, out records, out msg);

            if (string.IsNullOrEmpty(msg))
            {
                this.paginationCheckList.SetPaginationProperties(pageNo, pageSize, pages, records);

                this.grdCheckList.DataSource = dataTable;
            }
            else
            {
                this.grdCheckList.DataSource = EMS_CHECKLIST_FIELDS.CreateDataTable(true);

                MessageService.ShowError(msg);
            }

            this.grvCheckList.BestFitColumns();

            State = ControlState.Read;
        }
示例#2
0
        public override bool Insert()
        {
            DataSet reqDS = new DataSet();

            DataTable checkListDataTable = EMS_CHECKLIST_FIELDS.CreateDataTable(false);

            Dictionary <string, string> dataRow = new Dictionary <string, string>()
            {
                { EMS_CHECKLIST_FIELDS.FIELD_CHECKLIST_KEY, checkListKey },
                { EMS_CHECKLIST_FIELDS.FIELD_CHECKLIST_NAME, checkListName },
                { EMS_CHECKLIST_FIELDS.FIELD_CHECKLIST_TYPE, checkListType },
                { EMS_CHECKLIST_FIELDS.FIELD_DESCRIPTION, description },

                { EMS_CHECKLIST_FIELDS.FIELD_CREATOR, Creator },
                { EMS_CHECKLIST_FIELDS.FIELD_CREATE_TIMEZONE_KEY, CreateTimeZone },
                { EMS_CHECKLIST_FIELDS.FIELD_CREATE_TIME, string.Empty }
            };

            FanHai.Hemera.Utils.Common.Utils.AddKeyValuesToDataTable(ref checkListDataTable, dataRow);

            checkListDataTable.AcceptChanges();

            reqDS.Tables.Add(checkListDataTable);

            if (this.CheckListItemsData != null && this.CheckListItemsData.Rows.Count > 0)
            {
                reqDS.Tables.Add(this.CheckListItemsData.Copy());
            }

            string msg;

            DataSet resDS = FanHai.Hemera.Utils.Common.Utils.ExecuteEngineMethod("FanHai.Hemera.Modules.EMS.EquipmentCheckListEngine, FanHai.Hemera.Modules.EMS", "InsertCheckList", 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);
            }
        }
示例#3
0
        public override bool Update()
        {
            DataSet reqDS = new DataSet();

            reqDS.ExtendedProperties.Add(PARAMETERS.INPUT_KEY, checkListKey);
            reqDS.ExtendedProperties.Add(PARAMETERS.INPUT_EDITOR, Editor);
            reqDS.ExtendedProperties.Add(PARAMETERS.INPUT_EDIT_TIME, EditTime);

            this.DirtyList.Add(EMS_CHECKLIST_FIELDS.FIELD_EDIT_TIME, new DirtyItem(EMS_CHECKLIST_FIELDS.FIELD_EDIT_TIME, string.Empty, string.Empty));

            Editor       = PropertyService.Get(PROPERTY_FIELDS.USER_NAME);
            EditTimeZone = PropertyService.Get(PROPERTY_FIELDS.TIMEZONE);

            DataTable checkListDataTable = EMS_CHECKLIST_FIELDS.CreateDataTable(false);

            FanHai.Hemera.Utils.Common.Utils.AddKeyValuesToDataTable(ref checkListDataTable, this.DirtyList);

            checkListDataTable.AcceptChanges();

            reqDS.Tables.Add(checkListDataTable);

            if (this.IsCheckListItemsModified && this.CheckListItemsData != null && this.CheckListItemsData.Rows.Count > 0)
            {
                reqDS.Tables.Add(this.CheckListItemsData.Copy());
            }

            string msg;

            DataSet resDS = FanHai.Hemera.Utils.Common.Utils.ExecuteEngineMethod("FanHai.Hemera.Modules.EMS.EquipmentCheckListEngine, FanHai.Hemera.Modules.EMS", "UpdateCheckList", 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);
            }
        }
示例#4
0
        protected override void InitUIControls()
        {
            #region Initial Check List Type ComboBox

            DataTable dataTable = new DataTable();

            dataTable.Columns.Add("CHECKLIST_TYPE");

            dataTable.Rows.Add("日检查");
            dataTable.Rows.Add("周检查");
            dataTable.Rows.Add("月检查");
            dataTable.Rows.Add("季检查");
            dataTable.Rows.Add("年检查");

            dataTable.AcceptChanges();

            this.cmbCheckListType.Properties.Columns.Clear();

            this.cmbCheckListType.Properties.Columns.Add(new LookUpColumnInfo("CHECKLIST_TYPE"));

            this.cmbCheckListType.Properties.ShowHeader = false;

            this.cmbCheckListType.Properties.DisplayMember = "CHECKLIST_TYPE";
            this.cmbCheckListType.Properties.ValueMember   = "CHECKLIST_TYPE";

            this.cmbCheckListType.Properties.DataSource = dataTable;

            #endregion

            #region Initial Check List Item List Grid

            dataTable = GetEmptyCheckListItemsDataTable();

            ControlUtils.InitialGridView(this.grvCheckListItemsList, dataTable);

            GridColumn gridColumn = this.grvCheckListItemsList.Columns.ColumnByFieldName(EMS_CHECKLIST_ITEM_FIELDS.FIELD_STANDARD);

            if (gridColumn != null)
            {
                RepositoryItemTextEdit textEdit = new RepositoryItemTextEdit();

                textEdit.MaxLength = 50;

                gridColumn.ColumnEdit = textEdit;
            }

            gridColumn = this.grvCheckListItemsList.Columns.ColumnByFieldName(EMS_CHECKLIST_ITEM_FIELDS.FIELD_OPTIONAL);

            if (gridColumn != null)
            {
                RepositoryItemCheckEdit checkEdit = new RepositoryItemCheckEdit();

                checkEdit.QueryCheckStateByValue += new QueryCheckStateByValueEventHandler(ControlUtils.QueryCheckStateByValue);

                gridColumn.ColumnEdit = checkEdit;
            }

            #endregion

            #region Initial Check List Grid

            dataTable = EMS_CHECKLIST_FIELDS.CreateDataTable(true);

            ControlUtils.InitialGridView(this.grvCheckList, dataTable);

            #endregion
        }