Exemplo n.º 1
0
        List <DataFeedColumn> BuildBasicColumns(int c3SysNo)
        {
            List <DataFeedColumn> list = new List <DataFeedColumn>();

            if (m_dataFeed != null)
            {
                int number = 1;
                foreach (var header in m_dataFeed.Headers)
                {
                    DataFeedColumn column = new DataFeedColumn();
                    column.Number           = number;
                    column.Name             = header.Name;
                    column.Width            = header.Width;
                    column.IsMustInput      = header.IsMustInput;
                    column.Type             = DataType.ANY;
                    column.HeaderGroupIndex = header.HeaderGroupIndex;
                    if (header.Type == "List")
                    {
                        column.Type = DataType.LIST;
                        column.List = new List <string>();

                        if (header.Name == "生产商")
                        {
                            List <ManufacturerInfo> manufactures = ExternalDomainBroker.GetManufacturerList(m_companyCode);
                            foreach (var item in manufactures)
                            {
                                column.List.Add(!string.IsNullOrEmpty(item.ManufacturerNameLocal.Content)
                                                ? item.ManufacturerNameLocal.Content
                                                : item.ManufacturerNameGlobal);
                            }
                        }
                        else if (header.Name == "品牌")
                        {
                            var brands     = ExternalDomainBroker.GetBrandList(m_companyCode);
                            var brandsList = brands.Select(p => !string.IsNullOrEmpty(p.BrandNameLocal.Content)
                                                ? p.BrandNameLocal.Content
                                                : p.BrandNameGlobal);
                            column.List.AddRange(brandsList);
                        }
                        else if (header.Name == "PM")
                        {
                            var pmList = ExternalDomainBroker.GetAllValidPMList(m_companyCode);
                            foreach (var item in pmList)
                            {
                                column.List.Add(item.UserInfo.UserName);
                            }
                        }

                        else if (header.Name == "版本")
                        {
                            column.List.Add("零售版");
                            column.List.Add("OEM版");
                        }
                        else if (header.Name == "航空禁运")
                        {
                            column.List.Add("是");
                            column.List.Add("否");
                        }
                        //是否拍照
                        else if (header.Name == DataFeedConstString.EXCEL_COLUMNNAME_ITEM_HASPHOTO)
                        {
                            column.List.Add("是");
                            column.List.Add("否");
                        }
                        //是否代销
                        else if (header.Name == DataFeedConstString.EXCEL_COLUMNNAME_ITEM_SALEBYPROXY)
                        {
                            column.List.Add("代销");
                            column.List.Add("非代销");
                            column.List.Add("临时代销");
                        }
                        //是否虚库
                        else if (header.Name == DataFeedConstString.EXCEL_COLUMNNAME_ITEM_ISVIRTUALINVENTORY)
                        {
                            column.List.Add("是");
                            column.List.Add("否");
                        }

                        //商品类型
                        else if (header.Name == DataFeedConstString.EXCEL_COLUMNNAME_ITEM_PRODUCTTYPE)
                        {
                            column.List.Add("正常品");
                            column.List.Add("二手品");
                            column.List.Add("坏品");
                        }
                    }
                    list.Add(column);

                    number++;
                }
            }
            return(list);
        }