Esempio n. 1
0
        /// <summary>
        /// 新增实体
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">实体</param>
        /// <param name="statusCode">返回状态码信息</param>
        /// <param name="statusMessage">返回狀態訊息</param>
        /// <returns>主鍵</returns>
        public string Add(UserInfo userInfo, PiOrganizeEntity entity, out string statusCode, out string statusMessage)
        {
            string returnValue   = string.Empty;
            string returnCode    = string.Empty;
            string returnMessage = string.Empty;
            var    parameter     = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.OrganizeService_Add);

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var manager   = new PiOrganizeManager(dbProvider, userInfo);
                returnValue   = manager.AddEntity(entity, out returnCode);
                returnMessage = manager.GetStateMessage(returnCode);
            });
            statusCode    = returnCode;
            statusMessage = returnMessage;
            return(returnValue);
        }