Esempio n. 1
0
        /// <summary>
        /// 获取已激活且不重复的工序名称。
        /// </summary>
        /// <returns>
        /// 包含工序名称的数据集对象。
        /// [ROUTE_OPERATION_NAME]
        /// </returns>
        public DataSet GetDistinctOperationNameList()
        {
            string  msg      = string.Empty;
            DataSet dsReturn = null;

            try
            {
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                if (null != factor)
                {
                    dsReturn = factor.CreateIOperationEngine().GetDistinctOperationNameList();
                    msg      = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                }
                this.ErrorMsg = msg;
            }
            catch (Exception ex)
            {
                this.ErrorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Esempio n. 2
0
        /// <summary>
        /// 获取版本号最大的工序基础数据和参数数据。
        /// </summary>
        /// <param name="operationName">工序名称。</param>
        /// <returns>包含工序参数数据的数据集对象。</returns>
        public DataSet GetOperationBaseAndParamInfo(string operationName)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                this.ErrorMsg = string.Empty;
                string            msg    = string.Empty;
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                dsReturn = factor.CreateIOperationEngine().GetOperationBaseAndParamInfo(operationName);
                msg      = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                if (msg != string.Empty)
                {
                    this.ErrorMsg = msg;
                }
            }
            catch (Exception ex)
            {
                this.ErrorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Esempio n. 3
0
        /// <summary>
        /// 根据主键获取工序记录。
        /// </summary>
        /// <param name="operationKey">工序主键。</param>
        private void GetOperationByKey(string operationKey)
        {
            try
            {
                string            msg      = string.Empty;
                IServerObjFactory factor   = CallRemotingService.GetRemoteObject();
                DataSet           dsReturn = factor.CreateIOperationEngine().GetOperationByKey(operationKey);
                msg = ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                if (msg != string.Empty)
                {
                    this.ErrorMsg = msg;
                    MessageService.ShowError(msg);
                }
                else
                {
                    SetOperationProperties(dsReturn.Tables[POR_ROUTE_OPERATION_VER_FIELDS.DATABASE_TABLE_NAME]);

                    this._params = dsReturn.Tables[POR_ROUTE_OPERATION_PARAM_FIELDS.DATABASE_TABLE_NAME];
                    if (null != dsReturn.Tables[POR_ROUTE_OPERATION_ATTR_FIELDS.DATABASE_TABLE_NAME])
                    {
                        SetOperationUDAs(dsReturn.Tables[POR_ROUTE_OPERATION_ATTR_FIELDS.DATABASE_TABLE_NAME]);
                    }
                }
            }
            catch (Exception ex)
            {
                this.ErrorMsg = ex.Message;
                MessageService.ShowError(ex);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
        }
Esempio n. 4
0
 /// <summary>
 /// 获取最大版本号的工序信息。
 /// </summary>
 /// <param name="list">包含工序实体类的列表。</param>
 /// <param name="dsQueryParams">包含查询条件的数据集对象。</param>
 public void GetMaxVerOperation(ref List <OperationEntity> list, DataSet dsQueryParams)
 {
     try
     {
         string            msg      = string.Empty;
         DataSet           dsReturn = null;
         IServerObjFactory factor   = CallRemotingService.GetRemoteObject();
         dsReturn = factor.CreateIOperationEngine().GetMaxVerOperation(dsQueryParams);
         msg      = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
         if (msg != string.Empty)
         {
             MessageService.ShowError(msg);
         }
         else
         {
             AddOperationDataToList(dsReturn, ref list);
         }
     }
     catch (Exception ex)
     {
         MessageService.ShowError(ex);
     }
     finally
     {
         CallRemotingService.UnregisterChannel();
     }
 }
Esempio n. 5
0
        /// <summary>
        /// 删除工序记录。
        /// </summary>
        /// <returns>true:删除成功。false:删除失败。</returns>
        public override bool Delete()
        {
            try
            {
                string            msg      = string.Empty;
                DataSet           dsReturn = null;
                IServerObjFactory factor   = CallRemotingService.GetRemoteObject();
                if (null != factor)
                {
                    dsReturn = factor.CreateIOperationEngine().OperationDelete(_operationVerKey);
                    msg      = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                    if (msg != string.Empty)
                    {
                        this.ErrorMsg = msg;
                        MessageService.ShowError(msg);
                        return(false);
                    }
                    else
                    {
                        MessageService.ShowMessage("${res:Global.SuccessMessage}", "${res:Global.SystemInfo}");
                    }
                }
            }
            catch (Exception ex)
            {
                this.ErrorMsg = ex.Message;
                MessageService.ShowError(ex);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }

            return(true);
        }
Esempio n. 6
0
        /// <summary>
        /// 查询按钮事件。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnQuery_Click(object sender, EventArgs e)
        {
            try
            {
                Hashtable htParams = new Hashtable();
                DataSet   dsParams = new DataSet();

                string operationName = this.txtOperationName.Text.Trim();

                if (operationName.Length > 0)
                {
                    htParams.Add(POR_ROUTE_OPERATION_VER_FIELDS.FIELD_ROUTE_OPERATION_NAME, operationName);
                }

                DataTable dtParams = FanHai.Hemera.Share.Common.CommonUtils.ParseToDataTable(htParams);
                dtParams.TableName = POR_ROUTE_OPERATION_VER_FIELDS.DATABASE_TABLE_NAME;
                dsParams.Tables.Add(dtParams);

                string            msg           = string.Empty;
                DataSet           dsReturn      = new DataSet();
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                dsReturn = serverFactory.CreateIOperationEngine().OperationSearch(dsParams);
                msg      = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                if (msg != string.Empty)
                {
                    MessageService.ShowError(msg);
                }
                else
                {
                    if (dsReturn.Tables[POR_ROUTE_OPERATION_VER_FIELDS.DATABASE_TABLE_NAME].Rows.Count < 1)
                    {
                        MessageService.ShowMessage("没有找到相关数据!", "系统提示");
                    }

                    grdCtrlOperation.MainView   = gridViewOperation;
                    grdCtrlOperation.DataSource = dsReturn.Tables[POR_ROUTE_OPERATION_VER_FIELDS.DATABASE_TABLE_NAME];
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Load Operations Data
        /// </summary>
        /// <param name="operationName"></param>
        /// Owner:Andy Gao 2010-08-11 11:19:37
        private void LoadOperationsData(string operationName)
        {
            #region Variables

            DataSet reqDS = new DataSet();
            DataSet resDS = new DataSet();

            #endregion

            #region Call Remoting Interface

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();

                if (serverFactory != null)
                {
                    int pages;
                    int records;
                    int pageNo   = this.paginationOperations.PageNo;
                    int pageSize = this.paginationOperations.PageSize;

                    if (pageNo <= 0)
                    {
                        pageNo = 1;
                    }

                    if (pageSize <= 0)
                    {
                        pageSize = PaginationControl.DEFAULT_PAGESIZE;
                    }

                    resDS = serverFactory.CreateIOperationEngine().GetOperations(reqDS, operationName, pageNo, pageSize, out pages, out records);

                    if (pages > 0 && records > 0)
                    {
                        this.paginationOperations.PageNo   = pageNo > pages ? pages : pageNo;
                        this.paginationOperations.PageSize = pageSize;
                        this.paginationOperations.Pages    = pages;
                        this.paginationOperations.Records  = records;
                    }
                    else
                    {
                        this.paginationOperations.PageNo   = 0;
                        this.paginationOperations.PageSize = PaginationControl.DEFAULT_PAGESIZE;
                        this.paginationOperations.Pages    = 0;
                        this.paginationOperations.Records  = 0;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex);

                return;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }

            #endregion

            #region Process Output Parameters

            string returnMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(resDS);

            if (string.IsNullOrEmpty(returnMsg))
            {
                BindDataToOperationsGrid(resDS.Tables[POR_ROUTE_OPERATION_VER_FIELDS.DATABASE_TABLE_NAME]);
            }
            else
            {
                MessageService.ShowError(returnMsg);
            }

            #endregion
        }
Esempio n. 8
0
        /// <summary>
        /// 更新工序记录。
        /// </summary>
        /// <returns>true:更新成功。false:更新失败。</returns>
        public override bool Update()
        {
            if (IsDirty)
            {
                DataSet   dsParams = new DataSet();
                Hashtable htCommon = new Hashtable();
                htCommon.Add(COMMON_FIELDS.FIELD_COMMON_EDIT_TIMEZONE, this.EditTimeZone);
                htCommon.Add(COMMON_FIELDS.FIELD_COMMON_EDITOR, this.Editor);
                htCommon.Add(COMMON_FIELDS.FIELD_COMMON_EDIT_TIME, this.EditTime);
                DataTable dtCommon = CommonUtils.ParseToDataTable(htCommon);
                dtCommon.TableName = TRANS_TABLES.TABLE_MAIN_DATA;
                dsParams.Tables.Add(dtCommon);
                //组织工序数据
                if (this.DirtyList.Count > 0)
                {
                    Hashtable htOpeartion = new Hashtable();
                    htOpeartion.Add(POR_ROUTE_OPERATION_VER_FIELDS.FIELD_ROUTE_OPERATION_VER_KEY, _operationVerKey);
                    foreach (string Key in this.DirtyList.Keys)
                    {
                        htOpeartion.Add(Key, this.DirtyList[Key].FieldNewValue);
                    }
                    DataTable dtOperation = CommonUtils.ParseToDataTable(htOpeartion);
                    dtOperation.TableName = POR_ROUTE_OPERATION_VER_FIELDS.DATABASE_TABLE_NAME;
                    dsParams.Tables.Add(dtOperation);
                }
                //组织自定义属性。
                if (_operationUDAs.IsDirty)
                {
                    DataTable operationUdaTable = DataTableHelper.CreateDataTableForUDA
                                                      (POR_ROUTE_OPERATION_ATTR_FIELDS.DATABASE_TABLE_NAME, POR_ROUTE_OPERATION_ATTR_FIELDS.FIELD_OPERATION_VER_KEY);
                    _operationUDAs.ParseUpdateDataToDataTable(ref operationUdaTable);
                    DealUdaTable(operationUdaTable, "I");
                    dsParams.Tables.Add(operationUdaTable);
                }
                //组织工序参数数据表。
                DataTable dtOperationParams = this._params.GetChanges();
                if (dtOperationParams != null)
                {
                    dtOperationParams.TableName = POR_ROUTE_OPERATION_PARAM_FIELDS.DATABASE_TABLE_NAME;
                    foreach (DataRow dr in dtOperationParams.Rows)
                    {
                        dr[POR_ROUTE_OPERATION_PARAM_FIELDS.FIELD_EDITOR]        = this.Editor;
                        dr[POR_ROUTE_OPERATION_PARAM_FIELDS.FIELD_EDIT_TIME]     = DBNull.Value;
                        dr[POR_ROUTE_OPERATION_PARAM_FIELDS.FIELD_EDIT_TIMEZONE] = this.EditTimeZone;
                    }
                    dsParams.Tables.Add(dtOperationParams);
                }
                try
                {
                    string            msg      = string.Empty;
                    DataSet           dsReturn = null;
                    IServerObjFactory factor   = CallRemotingService.GetRemoteObject();
                    if (null != factor)
                    {
                        dsReturn = factor.CreateIOperationEngine().OperationUpdate(dsParams);
                        msg      = ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                        if (msg != string.Empty)
                        {
                            this.ErrorMsg = msg;
                            MessageService.ShowError(msg);
                            return(false);
                        }
                        else
                        {
                            foreach (UserDefinedAttr uda in _operationUDAs.UserDefinedAttrList)
                            {
                                uda.OperationAction = OperationAction.Update;
                            }
                            foreach (DataRow dr in this._params.Rows)
                            {
                                int isDeleted = Convert.ToInt32(dr[POR_ROUTE_OPERATION_PARAM_FIELDS.FIELD_IS_DELETED]);
                                if (isDeleted == 1)
                                {
                                    dr.Delete();
                                }
                            }
                            this._params.AcceptChanges();
                            this.ResetDirtyList();
                            MessageService.ShowMessage("${res:Global.SuccessMessage}", "${res:Global.SystemInfo}");
                        }
                    }
                }
                catch (Exception ex)
                {
                    this.ErrorMsg = ex.Message;
                    MessageService.ShowError(ex);
                }
                finally
                {
                    CallRemotingService.UnregisterChannel();
                }
            }
            else
            {
                MessageService.ShowMessage
                    ("${res:Global.UpdateItemDataMessage}", "${res:Global.SystemInfo}");
            }

            return(true);
        }
Esempio n. 9
0
        /// <summary>
        /// 新增工序记录。
        /// </summary>
        /// <returns>true:新增成功。false:新增失败。</returns>
        public override bool Insert()
        {
            DataSet dsParams = new DataSet();
            POR_ROUTE_OPERATION_VER_FIELDS fields = new POR_ROUTE_OPERATION_VER_FIELDS();
            DataTable dtOperation = CommonUtils.CreateDataTable(fields);
            //组织工序数据。
            DataRow drOperation = dtOperation.NewRow();

            dtOperation.Rows.Add(drOperation);
            drOperation[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_ROUTE_OPERATION_VER_KEY] = _operationVerKey;
            drOperation[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_ROUTE_OPERATION_NAME]    = _operationName;
            drOperation[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_DURATION]                        = _osDuration;
            drOperation[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_SORT_SEQ]                        = _sortSequence;
            drOperation[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_OPERATION_STATUS]                = Convert.ToInt32(_operationStatus);
            drOperation[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_DESCRIPTIONS]                    = _osDescription;
            drOperation[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_PARAM_ORDER_TYPE]                = Convert.ToInt32(_paramOrderType);
            drOperation[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_PARAM_COUNT_PER_ROW]             = _paramCountPerRow;
            drOperation[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_SCRAP_REASON_CODE_CATEGORY_KEY]  = _scrapCodesKey;
            drOperation[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_DEFECT_REASON_CODE_CATEGORY_KEY] = _defectCodesKey;
            drOperation[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_CREATOR]         = this.Creator;
            drOperation[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_EDITOR]          = this.Editor;
            drOperation[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_EDIT_TIMEZONE]   = this.EditTimeZone;
            drOperation[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_CREATE_TIMEZONE] = this.CreateTimeZone;
            drOperation[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_CREATE_TIME]     = DBNull.Value;
            drOperation[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_EDIT_TIME]       = DBNull.Value;
            dsParams.Tables.Add(dtOperation);
            //组织自定义属性数据。
            DataTable operationUdaTable = DataTableHelper.CreateDataTableForUDA(POR_ROUTE_OPERATION_ATTR_FIELDS.DATABASE_TABLE_NAME,
                                                                                POR_ROUTE_OPERATION_ATTR_FIELDS.FIELD_OPERATION_VER_KEY);

            _operationUDAs.ParseInsertDataToDataTable(ref operationUdaTable);
            if (operationUdaTable.Rows.Count > 0)
            {
                //如果有LINED_EDC类型的,则将参数名称转换为参数主键存储到数据库中。
                DealUdaTable(operationUdaTable, "I");
                dsParams.Tables.Add(operationUdaTable);
            }
            //组织工序参数数据。
            DataTable dtOperationParams = this._params.GetChanges();

            if (dtOperationParams != null)
            {
                dtOperationParams.TableName = POR_ROUTE_OPERATION_PARAM_FIELDS.DATABASE_TABLE_NAME;
                foreach (DataRow dr in dtOperationParams.Rows)
                {
                    dr[POR_ROUTE_OPERATION_PARAM_FIELDS.FIELD_EDITOR]        = this.Editor;
                    dr[POR_ROUTE_OPERATION_PARAM_FIELDS.FIELD_EDIT_TIME]     = DBNull.Value;
                    dr[POR_ROUTE_OPERATION_PARAM_FIELDS.FIELD_EDIT_TIMEZONE] = this.EditTimeZone;
                }
                dsParams.Tables.Add(dtOperationParams);
            }
            try
            {
                int               code     = 0;
                string            msg      = string.Empty;
                IServerObjFactory factor   = CallRemotingService.GetRemoteObject();
                DataSet           dsReturn = factor.CreateIOperationEngine().OperationInsert(dsParams);
                msg = ReturnMessageUtils.GetServerReturnMessage(dsReturn, ref code);
                if (code == -1)
                {
                    this.ErrorMsg = msg;
                    MessageService.ShowError(msg);
                    return(false);
                }
                else
                {
                    this.OperationVersion = msg;
                    foreach (UserDefinedAttr uda in _operationUDAs.UserDefinedAttrList)
                    {
                        uda.OperationAction = OperationAction.Update;
                    }
                    this._params.AcceptChanges();
                    this.ResetDirtyList();
                    MessageService.ShowMessage("${res:Global.SuccessMessage}", "${res:Global.SystemInfo}");
                }
            }
            catch (Exception ex)
            {
                this.ErrorMsg = ex.Message;
                MessageService.ShowError(ex);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(true);
        }
Esempio n. 10
0
        /// <summary>
        /// 将调用远程对象查出的结果赋值给下拉框
        /// </summary>
        private void BindDataToLoopUpEdit()
        {
            DataSet        dsLocation = new DataSet();
            LocationEntity location   = new LocationEntity();

            //根据区域名称和区域类型查询区域信息
            location.LocalLevel = "5";//只查询车间数据
            dsLocation          = location.SearchLocation();
            if (location.ErrorMsg != "")
            {
                //提示“获取区域出错!”
                MessageService.ShowError("${res:FanHai.Hemera.Addins.FMM.StoreCtrl.Msg.GetLocationError}");
            }
            else
            {
                //若结果集中包含“FMM_LOCATION”表
                if (dsLocation.Tables.Contains(FMM_LOCATION_FIELDS.DATABASE_TABLE_NAME))
                {
                    //为界面上的“区域”下拉框赋值
                    this.lueLocation.Properties.DataSource    = dsLocation.Tables[FMM_LOCATION_FIELDS.DATABASE_TABLE_NAME];
                    this.lueLocation.Properties.DisplayMember = FMM_LOCATION_FIELDS.FIELD_LOCATION_NAME;
                    this.lueLocation.Properties.ValueMember   = FMM_LOCATION_FIELDS.FIELD_LOCATION_KEY;
                }
            }

            string[] columns = new string[] { "CODE", "NAME" };
            KeyValuePair <string, string> category = new KeyValuePair <string, string>("CATEGORY_NAME", "Store_Type");
            //得到线边仓类型的基础数据
            DataTable dataTable = BaseData.Get(columns, category);

            //为界面上的“类型”下拉框赋值
            this.lueType.Properties.DataSource    = dataTable;
            this.lueType.Properties.DisplayMember = "NAME";
            this.lueType.Properties.ValueMember   = "CODE";
            //?????
            this.lueStoreType.DataSource    = dataTable;
            this.lueStoreType.DisplayMember = "NAME";
            this.lueStoreType.ValueMember   = "CODE";

            try
            {
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                //调用远程对象的方法,得到最新版本的工序
                DataSet dsReturn = factor.CreateIOperationEngine().GetMaxVerOperation(null);
                string  msg      = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                if (msg == string.Empty)
                {
                    if (dsReturn != null && dsReturn.Tables.Count > 0 && dsReturn.Tables.Contains(POR_ROUTE_OPERATION_VER_FIELDS.DATABASE_TABLE_NAME))
                    {
                        DataTable operationTable = dsReturn.Tables[POR_ROUTE_OPERATION_VER_FIELDS.DATABASE_TABLE_NAME];
                        foreach (DataRow dataRow in operationTable.Rows)
                        {
                            //设置界面上的“工序”内容为POR_ROUTE_OPERATION_VER表的工序名称
                            cmbOperation.Properties.Items.Add(dataRow[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_ROUTE_OPERATION_NAME].ToString());
                        }
                    }
                }
                else
                {
                    throw new Exception(msg);
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex.Message);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
        }
Esempio n. 11
0
        /// <summary>
        /// gvUdaList_CustomRowCellEdit
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gvUdaList_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            if (e.RowHandle >= 0)
            {
                string attributeDataType = gridUDAsView.GetRowCellValue(e.RowHandle, COLUMN_ATTRIBUTE_DATA_TYPE).ToString();
                string attributeName     = gridUDAsView.GetRowCellValue(e.RowHandle, COLUMN_ATTRIBUTE_NAME).ToString();
                if (attributeDataType == string.Empty)
                {
                    return;
                }
                AttributeDataType dateType = (AttributeDataType)Convert.ToInt32(attributeDataType);
                switch (dateType)
                {
                case AttributeDataType.DATE:
                    RepositoryItemDateEdit dateEdit = new RepositoryItemDateEdit();
                    dateEdit.DisplayFormat.FormatString = "yyyy-MM-dd";
                    dateEdit.EditMask = "yyyy-MM-dd";
                    e.RepositoryItem  = dateEdit;
                    break;

                case AttributeDataType.DATETIME:
                    RepositoryItemDateEdit dateEditTime = new RepositoryItemDateEdit();
                    dateEditTime.Properties.VistaDisplayMode = DevExpress.Utils.DefaultBoolean.True;
                    dateEditTime.Properties.VistaEditTime    = DevExpress.Utils.DefaultBoolean.True;

                    dateEditTime.VistaTimeProperties.DisplayFormat.FormatString = "yyyy-MM-dd HH:mm:ss";
                    dateEditTime.VistaTimeProperties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.DateTime;
                    dateEditTime.VistaTimeProperties.EditFormat.FormatString    = "yyyy-MM-dd HH:mm:ss";
                    dateEditTime.VistaTimeProperties.EditFormat.FormatType      = DevExpress.Utils.FormatType.DateTime;
                    e.RepositoryItem = dateEditTime;
                    break;

                case AttributeDataType.BOOLEAN:
                    RepositoryItemComboBox cmbBoolean = new RepositoryItemComboBox();
                    cmbBoolean.Items.Add("true");
                    cmbBoolean.Items.Add("false");
                    cmbBoolean.TextEditStyle = TextEditStyles.DisableTextEditor;
                    e.RepositoryItem         = cmbBoolean;
                    break;

                case AttributeDataType.LINKED:
                    if (attributeName == "OnLineStore")
                    {
                        RepositoryItemCheckedComboBoxEdit cmbLinked = new RepositoryItemCheckedComboBoxEdit();
                        DataTable storeTable = _crmAttr.GetStoreName();
                        storeTable.DefaultView.RowFilter = "STORE_TYPE=0";        //只保留返工类型的线上仓。
                        foreach (DataRowView dataRow in storeTable.DefaultView)
                        {
                            cmbLinked.Items.Add(dataRow[WST_STORE_FIELDS.FIELD_STORE_NAME]);
                        }

                        cmbLinked.TextEditStyle = TextEditStyles.DisableTextEditor;
                        e.RepositoryItem        = cmbLinked;
                    }
                    else if (attributeName == COMMON_NAMES.LINKED_ITEM_EDC)
                    {
                        RepositoryItemComboBox comboBox = new RepositoryItemComboBox();
                        DataTable edcTable = _crmAttr.GetEDC();
                        foreach (DataRow dataRow in edcTable.Rows)
                        {
                            comboBox.Items.Add(dataRow[EDC_MAIN_FIELDS.FIELD_EDC_NAME]);
                        }

                        comboBox.TextEditStyle = TextEditStyles.DisableTextEditor;
                        e.RepositoryItem       = comboBox;
                    }
                    else if (attributeName == "FutureHold" || attributeName == "DependSampStep")
                    {
                        try
                        {
                            RepositoryItemComboBox cbFutureHold = new RepositoryItemComboBox();
                            IServerObjFactory      factor       = CallRemotingService.GetRemoteObject();
                            DataSet dsReturn = factor.CreateIOperationEngine().GetMaxVerOperation(null);
                            string  msg      = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                            if (msg == string.Empty)
                            {
                                if (dsReturn != null && dsReturn.Tables.Count > 0 && dsReturn.Tables.Contains(POR_ROUTE_OPERATION_VER_FIELDS.DATABASE_TABLE_NAME))
                                {
                                    DataTable operationTable = dsReturn.Tables[POR_ROUTE_OPERATION_VER_FIELDS.DATABASE_TABLE_NAME];
                                    foreach (DataRow dataRow in operationTable.Rows)
                                    {
                                        cbFutureHold.Items.Add(dataRow[POR_ROUTE_OPERATION_VER_FIELDS.FIELD_ROUTE_OPERATION_NAME].ToString());
                                    }

                                    cbFutureHold.TextEditStyle = TextEditStyles.DisableTextEditor;
                                    e.RepositoryItem           = cbFutureHold;
                                }
                            }
                            else
                            {
                                throw new Exception(msg);
                            }
                        }
                        catch (Exception ex)
                        {
                            MessageService.ShowError(ex.Message);
                        }
                        finally
                        {
                            CallRemotingService.UnregisterChannel();
                        }
                    }
                    else if (attributeName == "ReturnCode")
                    {
                        try
                        {
                            RepositoryItemComboBox cbResonCode = new RepositoryItemComboBox();
                            IServerObjFactory      factor      = CallRemotingService.GetRemoteObject();
                            DataSet   _dataDsFrom = new DataSet();
                            Hashtable _hsTable    = new Hashtable();
                            _hsTable.Add("REASON_CODE_CATEGORY_TYPE", "TK");
                            DataTable _dtTable = FanHai.Hemera.Share.Common.CommonUtils.ParseToDataTable(_hsTable);
                            _dtTable.TableName = TRANS_TABLES.TABLE_MAIN_DATA;
                            _dataDsFrom.Tables.Add(_dtTable);
                            //get return dataset
                            DataSet dsReturn = factor.CreateIReasonCodeEngine().GetReasonCodeByNameAndType(_dataDsFrom);
                            string  msg      = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                            if (msg == string.Empty)
                            {
                                if (dsReturn != null && dsReturn.Tables.Count > 0 && dsReturn.Tables.Contains(FMM_REASON_CODE_CATEGORY_FIELDS.DATABASE_TABLE_NAME))
                                {
                                    DataTable operationTable = dsReturn.Tables[FMM_REASON_CODE_CATEGORY_FIELDS.DATABASE_TABLE_NAME];
                                    foreach (DataRow dataRow in operationTable.Rows)
                                    {
                                        cbResonCode.Items.Add(dataRow[FMM_REASON_CODE_CATEGORY_FIELDS.FIELD_REASON_CODE_CATEGORY_NAME].ToString());
                                    }

                                    cbResonCode.TextEditStyle = TextEditStyles.DisableTextEditor;
                                    e.RepositoryItem          = cbResonCode;
                                }
                            }
                            else
                            {
                                throw new Exception(msg);
                            }
                        }
                        catch (Exception ex)
                        {
                            MessageService.ShowError(ex.Message);
                        }
                        finally
                        {
                            CallRemotingService.UnregisterChannel();
                        }
                    }
                    break;

                default:
                    break;
                }
            }
        }