Ejemplo n.º 1
0
        /// <summary>
        /// Load Check Items Data
        /// </summary>
        /// <param name="checkItemName"></param>
        /// Owner:Andy Gao 2011-07-12 08:48:53
        private void LoadCheckItemsData(string checkItemName)
        {
            string msg;

            int pageNo, pageSize, pages, records;

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

            DataTable dataTable = this.equipmentCheckItemEntity.LoadCheckItemsData(checkItemName, pageNo, pageSize, out pages, out records, out msg);

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

                this.grdCheckItemList.DataSource = dataTable;
            }
            else
            {
                this.grdCheckItemList.DataSource = EMS_CHECKITEMS_FIELDS.CreateDataTable(true);

                MessageService.ShowError(msg);
            }

            this.grvCheckItemList.BestFitColumns();

            State = ControlState.Read;
        }
Ejemplo n.º 2
0
        protected override void InitUIControls()
        {
            #region Initial Check Item Type ComboBox

            DataTable dataTable = new DataTable();

            dataTable.Columns.Add("CHECKITEM_TYPE");

            dataTable.Rows.Add("DATA");
            dataTable.Rows.Add("STRING");
            dataTable.Rows.Add("Y/N");

            dataTable.AcceptChanges();

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

            this.cmbCheckItemType.Properties.Columns.Add(new LookUpColumnInfo("CHECKITEM_TYPE"));

            this.cmbCheckItemType.Properties.ShowHeader = false;

            this.cmbCheckItemType.Properties.DisplayMember = "CHECKITEM_TYPE";
            this.cmbCheckItemType.Properties.ValueMember   = "CHECKITEM_TYPE";

            this.cmbCheckItemType.Properties.DataSource = dataTable;

            #endregion

            #region Initial Check Item Grid

            dataTable = EMS_CHECKITEMS_FIELDS.CreateDataTable(true);

            ControlUtils.InitialGridView(this.grvCheckItemList, dataTable);

            #endregion
        }
Ejemplo n.º 3
0
        public override bool Insert()
        {
            DataSet reqDS = new DataSet();

            DataTable checkItemsDataTable = EMS_CHECKITEMS_FIELDS.CreateDataTable(false);

            Dictionary <string, string> dataRow = new Dictionary <string, string>()
            {
                { EMS_CHECKITEMS_FIELDS.FIELD_CHECKITEM_KEY, checkItemKey },
                { EMS_CHECKITEMS_FIELDS.FIELD_CHECKITEM_NAME, checkItemName },
                { EMS_CHECKITEMS_FIELDS.FIELD_CHECKITEM_TYPE, checkItemType },
                { EMS_CHECKITEMS_FIELDS.FIELD_DESCRIPTION, description },

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

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

            checkItemsDataTable.AcceptChanges();

            reqDS.Tables.Add(checkItemsDataTable);

            string msg;

            DataSet resDS = FanHai.Hemera.Utils.Common.Utils.ExecuteEngineMethod("FanHai.Hemera.Modules.EMS.EquipmentCheckItemsEngine, FanHai.Hemera.Modules.EMS", "InsertCheckItem", 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);
            }
        }
Ejemplo n.º 4
0
        public override bool Update()
        {
            DataSet reqDS = new DataSet();

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

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

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

            DataTable checkItemsDataTable = EMS_CHECKITEMS_FIELDS.CreateDataTable(false);

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

            checkItemsDataTable.AcceptChanges();

            reqDS.Tables.Add(checkItemsDataTable);

            string msg;

            DataSet resDS = FanHai.Hemera.Utils.Common.Utils.ExecuteEngineMethod("FanHai.Hemera.Modules.EMS.EquipmentCheckItemsEngine, FanHai.Hemera.Modules.EMS", "UpdateCheckItem", 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);
            }
        }