Exemplo n.º 1
0
 public void GetObjectConfByName(string objectName)
 {
     try
     {
         DataSet           dsReturn      = null;
         IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
         dsReturn = serverFactory.CreateIUdaCommonControlEx().GetLineTypeByName(objectName);
         string returnMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
         if (returnMsg != string.Empty)
         {
             MessageService.ShowError(returnMsg);
         }
         else
         {
             SetAttributeDataToProperty(dsReturn);
         }
     }
     catch (Exception ex)
     {
         MessageService.ShowError(ex.Message);
     }
     finally
     {
         CallRemotingService.UnregisterChannel();
     }
 }
Exemplo n.º 2
0
        public override bool Delete()
        {
            bool bResult = false;

            try
            {
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                if (null != factor)
                {
                    DataSet retDS         = factor.CreateIUdaCommonControlEx().DeleteLineTypeAttribute(_objectKey);
                    string  returnMessage = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(retDS);
                    if (returnMessage.Length < 1)
                    {
                        bResult = true;
                    }
                    else
                    {
                        MessageService.ShowError(returnMessage);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex.Message);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(bResult);
        }
Exemplo n.º 3
0
        public DataSet InitObjectNameByType(string objectType)
        {
            DataSet           dsObjectName  = new DataSet();
            IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();

            dsObjectName = serverFactory.CreateIUdaCommonControlEx().GetUdaObjectNameList(objectType);
            return(dsObjectName);
        }
Exemplo n.º 4
0
 private void UpdateMainTable()
 {
     string            lineName      = this.cboObjectName.Text.ToString();
     string            lineCode      = this.txtLineCode.Text.ToString();
     string            lineDesc      = this.txtDescription.Text.ToString();
     string            lineKey       = this.lblObjectKey.Text.ToString();
     string            edtor         = PropertyService.Get(PROPERTY_FIELDS.USER_NAME);
     string            editTimeZone  = PropertyService.Get(PROPERTY_FIELDS.TIMEZONE);
     DataSet           dsObjectType  = new DataSet();
     IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
     int exeResult = serverFactory.CreateIUdaCommonControlEx().UpdateLineInfo(lineKey, lineName, lineCode, lineDesc, edtor, editTimeZone);
 }
Exemplo n.º 5
0
        /// <summary>
        /// Search button click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btSearch_Click(object sender, EventArgs e)
        {
            Hashtable mainDataHashTable = new Hashtable();
            DataSet   dataSet           = new DataSet();

            mainDataHashTable.Add(FMM_PRODUCTION_LINE_FIELDS.FIELD_LINE_NAME, this.txtAttributeName.Text.Trim());
            DataTable mainDataTable = FanHai.Hemera.Share.Common.CommonUtils.ParseToDataTable(mainDataHashTable);

            mainDataTable.TableName = FMM_PRODUCTION_LINE_FIELDS.DATABASE_TABLE_NAME;
            dataSet.Tables.Add(mainDataTable);
            //Call Remoting Service
            try
            {
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                if (null != factor)
                {
                    DataSet retDS = factor.CreateIUdaCommonControlEx().SearchLineAttribute(dataSet);

                    string returnMessage = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(retDS);
                    if (null == returnMessage || returnMessage.Length > 0)
                    {
                        MessageService.ShowError(returnMessage);
                    }
                    else
                    {
                        BindDataSourceToGrid(retDS.Tables[FMM_PRODUCTION_LINE_FIELDS.DATABASE_TABLE_NAME]);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
        }
Exemplo n.º 6
0
        private bool UdaObjectUpdate()
        {
            bool    bReturn = false;
            DataSet dataSet = new DataSet();

            if (IsDirty)
            {
                if (DirtyList.Count > 0)
                {
                    DataTable entityTable = DataTableHelper.CreateDataTableForUpdateBasicData(FMM_PRODUCTION_LINE_FIELDS.DATABASE_TABLE_NAME);

                    foreach (string Key in this.DirtyList.Keys)
                    {
                        Dictionary <string, string> rowData = new Dictionary <string, string>()
                        {
                            { COMMON_FIELDS.FIELD_COMMON_UPDATE_KEY, _objectKey },
                            { COMMON_FIELDS.FIELD_COMMON_UPDATE_NAME, Key },
                            { COMMON_FIELDS.FIELD_COMMON_UPDATE_OLD_VALUE, this.DirtyList[Key].FieldOriginalValue },
                            { COMMON_FIELDS.FIELD_COMMON_UPDATE_NEW_VALUE, this.DirtyList[Key].FieldNewValue }
                        };
                        FanHai.Hemera.Utils.Common.Utils.AddRowDataToDataTable(ref entityTable, rowData);
                    }
                    if (entityTable.Rows.Count > 0)
                    {
                        dataSet.Tables.Add(entityTable);
                    }
                }
                if (_UDAs.IsDirty)
                {
                    DataTable dtUDAs = DataTableHelper.CreateDataTableForUDAEx(BASE_ATTRIBUTE_VALUE_FIELDS.DATABASE_TABLE_NAME, BASE_ATTRIBUTE_VALUE_FIELDS.FIELD_OBJECT_KEY, BASE_ATTRIBUTE_VALUE_FIELDS.FIELD_OBJECT_TYPE);
                    _UDAs.ParseUpdateDataToDataTable(ref dtUDAs);
                    dataSet.Tables.Add(dtUDAs);
                }
                try
                {
                    DataSet           dsReturn      = null;
                    IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                    dsReturn = serverFactory.CreateIUdaCommonControlEx().UpdateLineTypeAttribute(dataSet);
                    string returnMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                    if (returnMsg.Length < 1)
                    {
                        foreach (UserDefinedAttrEx uda in _UDAs.UserDefinedAttrList)
                        {
                            uda.OperationAction = OperationAction.Update;
                        }
                        this.ResetDirtyList();
                        bReturn = true;
                    }
                    else
                    {
                        MessageService.ShowError(returnMsg);
                    }
                }
                catch (Exception ex)
                {
                    MessageService.ShowError(ex.Message);
                }
                finally
                {
                    CallRemotingService.UnregisterChannel();
                }
            }

            else
            {
                //MessageService.ShowMessage
                // ("${res:Global.UpdateItemDataMessage}", "${res:Global.SystemInfo}");
                MessageService.ShowMessage("自定义属性没有更新!");
            }
            return(bReturn);
        }
Exemplo n.º 7
0
        public override bool Insert()
        {
            bool    bResult = false;
            DataSet dataSet = new DataSet();

            DataTable dtAttributeConf           = CreateDataTableForInsert();
            Dictionary <string, string> dataRow = new Dictionary <string, string>()
            {
                { FMM_PRODUCTION_LINE_FIELDS.FIELD_PRODUCTION_LINE_KEY, _objectKey },
                { FMM_PRODUCTION_LINE_FIELDS.FIELD_LINE_NAME, _objectName.ToUpper() },
                { FMM_PRODUCTION_LINE_FIELDS.FIELD_LINE_CODE, _line_code },
                { FMM_PRODUCTION_LINE_FIELDS.FIELD_DESCRIPTIONS, _description },
                { FMM_PRODUCTION_LINE_FIELDS.FIELD_EDITOR, PropertyService.Get(PROPERTY_FIELDS.USER_NAME) }
            };

            FanHai.Hemera.Utils.Common.Utils.AddRowDataToDataTable(ref dtAttributeConf, dataRow);
            if (dtAttributeConf.Rows.Count > 0)
            {
                dataSet.Tables.Add(dtAttributeConf);
            }

            //  UDAs
            if (_UDAs.UserDefinedAttrList.Count > 0)
            {
                DataTable dtUDAs = DataTableHelper.CreateDataTableForUDAEx(BASE_ATTRIBUTE_VALUE_FIELDS.DATABASE_TABLE_NAME, BASE_ATTRIBUTE_VALUE_FIELDS.FIELD_OBJECT_KEY, BASE_ATTRIBUTE_VALUE_FIELDS.FIELD_OBJECT_TYPE);
                _UDAs.ParseInsertDataToDataTable(ref dtUDAs);

                if (dtUDAs.Rows.Count > 0)
                {
                    dataSet.Tables.Add(dtUDAs);
                }
            }
            try
            {
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                if (null != factor)
                {
                    if (dataSet.Tables.Count > 0)
                    {
                        DataSet retDS  = factor.CreateIUdaCommonControlEx().AddLineAttributeValue(dataSet);
                        string  strMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(retDS);
                        if (strMsg.Length < 1)
                        {
                            foreach (UserDefinedAttrEx uda in _UDAs.UserDefinedAttrList)
                            {
                                uda.OperationAction = OperationAction.Update;
                            }
                            this.ResetDirtyList();
                            bResult = true;
                        }
                        else
                        {
                            MessageService.ShowError(strMsg);
                        }
                    }
                    else
                    {
                        MessageService.ShowWarning("No dataTable in input parameter");
                    }
                }
            }
            catch (Exception e)
            {
                MessageService.ShowError(e.Message);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(bResult);
        }