コード例 #1
0
        /// <summary>
        /// 转换分类视图和分类实体
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        private CategoryProperty CovertQueryVMtoEntity(CategoryPropertyQueryVM data)
        {
            if (data == null)
            {
                return(null);
            }
            var tempCategoryProperty = new CategoryProperty
            {
                Property = new PropertyInfo {
                    SysNo = data.PropertySysNo
                },
                PropertyGroup =
                    new PropertyGroupInfo {
                    PropertyGroupName = new LanguageContent(data.GroupName)
                }
            };

            tempCategoryProperty.EditUser = new UserInfo {
                SysNo = CPApplication.Current.LoginUser.userSysNo
            };
            tempCategoryProperty.EditDate     = DateTime.Now;
            tempCategoryProperty.CategoryInfo = new CategoryInfo {
                SysNo = data.CategorySysNo
            };
            tempCategoryProperty.PropertyType = data.PropertyType;
            tempCategoryProperty.CompanyCode  = CPApplication.Current.CompanyCode;
            tempCategoryProperty.LanguageCode = CPApplication.Current.LanguageCode;
            return(tempCategoryProperty);
        }
コード例 #2
0
        /// <summary>
        /// 查询分类属性
        /// </summary>
        /// <param name="model"></param>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="SortField"></param>
        /// <param name="callback"></param>
        public void QueryCategoryProperty(CategoryPropertyQueryVM model, int PageSize, int PageIndex, string SortField, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            CategoryPropertyQueryFilter filter = model.ConvertVM <CategoryPropertyQueryVM, CategoryPropertyQueryFilter>();

            filter.PagingInfo = new PagingInfo
            {
                PageSize  = PageSize,
                PageIndex = PageIndex,
                SortBy    = SortField
            };

            const string relativeUrl = "/IMService/CategoryProperty/QueryCategoryProperty";

            restClient.QueryDynamicData(relativeUrl, filter,
                                        (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                if (!(args.Result == null || args.Result.Rows == null))
                {
                    foreach (var item in args.Result.Rows)
                    {
                        item.IsChecked = false;
                    }
                }
                callback(obj, args);
            }
                                        );
        }
コード例 #3
0
 public override void OnPageLoad(object sender, EventArgs e)
 {
     base.OnPageLoad(sender, e);
     model = new CategoryPropertyQueryVM {
         PropertyList = new List <KeyValuePair <int?, string> >()
     };
     this.DataContext = model;
     this.CmbPropertyTypeList.SelectedIndex = 0;
 }
コード例 #4
0
        /// <summary>
        /// 复制类别属性
        /// </summary>
        /// <param name="model"></param>
        /// <param name="callback"></param>
        public void CopyCategoryOutputTemplateProperty(CategoryPropertyQueryVM model, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            CategoryProperty info = new CategoryProperty()
            {
                SourceCategorySysNo = model.SourceCategorySysNo,
                TargetCategorySysNo = model.CategorySysNo
            };

            _restClient.Create(CopyCategoryOutputTemplatePropertyUrl, info, callback);
        }
コード例 #5
0
 /// <summary>
 /// 创建分类属性
 /// </summary>
 /// <param name="data"></param>
 /// <param name="callback"></param>
 public void CreateCategoryProperty(CategoryPropertyQueryVM data, EventHandler <RestClientEventArgs <CategoryProperty> > callback)
 {
     restClient.Create(CreateRelativeUrl, CovertQueryVMtoEntity(data), callback);
 }