Example #1
0
 /// <summary>
 /// 修改品PM组信息
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public virtual ProductManagerGroupInfo UpdateProductManagerGroupInfo(ProductManagerGroupInfo entity)
 {
     if (entity != null)
     {
         CheckProductManagerProcessor.CheckProductManagerrGroupInfoSysNo(entity.SysNo);
     }
     CheckProductManagerProcessor.CheckProductManagerrGroupInfo(entity);
     return(_productManagerGroupDA.UpdateProductManagerGroupInfo(entity));
 }
Example #2
0
        /// <summary>
        /// 修改PM组
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public ProductManagerGroupInfo UpdateProductManagerGroupInfo(ProductManagerGroupInfo entity)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("UpdateProductManagerGroupInfo");

            cmd.SetParameterValue("@SysNo", entity.SysNo);
            cmd.SetParameterValue("@TLSysNo", entity.UserInfo.SysNo);
            cmd.SetParameterValue("@Status", entity.Status);
            cmd.SetParameterValue("@CompanyCode", "8601");
            cmd.ExecuteNonQuery();
            return(entity);
        }
Example #3
0
        /// <summary>
        /// 创建PM组
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public ProductManagerGroupInfo CreateProductManagerGroupInfo(ProductManagerGroupInfo entity)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("CreateProductManagerGroupInfo");

            cmd.SetParameterValue("@PMGroupName", entity.PMGroupName.Content.Trim());
            cmd.SetParameterValue("@TLSysNo", entity.UserInfo.SysNo);
            cmd.SetParameterValue("@Status", entity.Status);
            cmd.SetParameterValue("@CompanyCode", "8601");
            cmd.ExecuteNonQuery();
            entity.SysNo = (int)cmd.GetParameterValue("@SysNo");
            return(entity);
        }
Example #4
0
        private ProductManagerGroupInfo CovertVMtoEntity(PMGroupVM data)
        {
            ProductManagerGroupInfo msg = new ProductManagerGroupInfo();

            msg.SysNo       = data.SysNo;
            msg.PMGroupName = new LanguageContent(data.PMGroupName);
            msg.UserInfo    = new UserInfo()
            {
                SysNo = Convert.ToInt32(data.PMUserSysNo)
            };
            msg.ProductManagerInfoList = data.PMList;
            msg.Status = data.Status == "有效" ? PMGroupStatus.Active : PMGroupStatus.DeActive;

            return(msg);
        }
Example #5
0
            /// <summary>
            /// 检查PM实体
            /// </summary>
            /// <param name="entity"></param>
            public static void CheckProductManagerrGroupInfo(ProductManagerGroupInfo entity)
            {
                if (entity == null)
                {
                    throw new BizException(ResouceManager.GetMessageString("IM.ProductManagerGroup", "ProductManagerGroupIsNull"));
                }
                if (entity.UserInfo == null || entity.UserInfo.SysNo < 0)
                {
                    throw new BizException(ResouceManager.GetMessageString("IM.ProductManagerGroup", "ProductManagerGroupuserSysNoIsNull"));
                }
                //var languageCode = Thread.CurrentThread.CurrentUICulture.Name;
                var localName = entity.PMGroupName.Content;

                if (String.IsNullOrEmpty(localName))
                {
                    throw new BizException(ResouceManager.GetMessageString("IM.ProductManagerGroup", "ProductManagerGroupNameIsNull"));
                }

                ChecPMGroupName(localName, entity.SysNo);
            }
Example #6
0
        /// <summary>
        /// 根据SysNO获取PM组信息
        /// </summary>
        /// <param name="productManagerGroupInfoSysNo"></param>
        /// <returns></returns>
        public ProductManagerGroupInfo GetProductManagerGroupInfoBySysNo(int productManagerGroupInfoSysNo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("GetProductManagerGroupInfoBySysNo");

            cmd.SetParameterValue("@SysNo", productManagerGroupInfoSysNo);
            var sourceEntity = cmd.ExecuteEntity <ProductManagerGroupInfo>();

            if (sourceEntity == null)
            {
                sourceEntity = new ProductManagerGroupInfo {
                    SysNo = productManagerGroupInfoSysNo
                };
            }
            else
            {
                var productmanagergroupQueryDA = ObjectFactory <IProductManagerGroupQueryDA> .Instance;
                var pms = productmanagergroupQueryDA.QueryAllProductManagerInfoByPMGroupSysNo(productManagerGroupInfoSysNo);
                sourceEntity.ProductManagerInfoList = pms;
            }
            return(sourceEntity);
        }
Example #7
0
        /// <summary>
        /// 根据用户编号获取PM组信息
        /// </summary>
        /// <param name="userSysNo"></param>
        /// <returns></returns>
        public ProductManagerGroupInfo GetPMListByUserSysNo(int userSysNo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("GetPMListByUserSysNo");

            cmd.SetParameterValue("@UserSysNo", userSysNo);
            var sourceEntity = cmd.ExecuteEntity <ProductManagerGroupInfo>();

            if (sourceEntity == null)
            {
                sourceEntity = new ProductManagerGroupInfo();
            }
            else
            {
                var productmanagergroupQueryDA = ObjectFactory <IProductManagerGroupQueryDA> .Instance;
                if (sourceEntity.SysNo != null && sourceEntity.SysNo > 0)
                {
                    var pms = productmanagergroupQueryDA.QueryAllProductManagerInfoByPMGroupSysNo(sourceEntity.SysNo.Value);
                    sourceEntity.ProductManagerInfoList = pms;
                }
            }
            return(sourceEntity);
        }
        /// <summary>
        /// 创建PM组
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public ProductManagerGroupInfo CreateProductManagerGroupInfo(ProductManagerGroupInfo entity)
        {
            ProductManagerGroupInfo result = new ProductManagerGroupInfo();

            using (TransactionScope scope = new TransactionScope())
            {
                //创建组信息
                result = productmanagergroupProcessor.CreateProductManagerGroupInfo(entity);

                //创建组内PM信息
                if (entity.ProductManagerInfoList.Count > 0)
                {
                    foreach (ProductManagerInfo item in entity.ProductManagerInfoList)
                    {
                        productmanagergroupProcessor.UpdatePMMasterGroupSysNo(item.UserInfo.SysNo.Value, result.SysNo.Value);
                    }
                }

                scope.Complete();
            }

            return(result);
        }
        /// <summary>
        /// 修改PM组
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public ProductManagerGroupInfo UpdateProductManagerGroupInfo(ProductManagerGroupInfo entity)
        {
            ProductManagerGroupInfo result = new ProductManagerGroupInfo();

            using (TransactionScope scope = new TransactionScope())
            {
                //修改组信息
                result = ObjectFactory <ProductManagerGroupProcessor> .Instance.UpdateProductManagerGroupInfo(entity);

                //清空原来选择该组的PM
                productmanagergroupProcessor.ClearPMMasterGroupSysNo(entity.SysNo.Value);
                //创建组内PM信息
                if (entity.ProductManagerInfoList.Count > 0)
                {
                    foreach (ProductManagerInfo item in entity.ProductManagerInfoList)
                    {
                        productmanagergroupProcessor.UpdatePMMasterGroupSysNo(item.UserInfo.SysNo.Value, result.SysNo.Value);
                    }
                }
                scope.Complete();
            }

            return(result);
        }
        public ProductManagerGroupInfo CreateProductManagerGroupInfo(ProductManagerGroupInfo request)
        {
            var entity = ObjectFactory <ProductManagerGroupAppService> .Instance.CreateProductManagerGroupInfo(request);

            return(entity);
        }
Example #11
0
 /// <summary>
 /// 创建PM组信息
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public virtual ProductManagerGroupInfo CreateProductManagerGroupInfo(ProductManagerGroupInfo entity)
 {
     CheckProductManagerProcessor.CheckProductManagerrGroupInfo(entity);
     return(_productManagerGroupDA.CreateProductManagerGroupInfo(entity));
 }