Esempio n. 1
0
        protected override IEnumerable <SoftVersionTrackBO> SearchData()
        {
            if (UpdateSection == null)
            {
                return(null);
            }

            var tracks    = _linqOP.GetDataContext <SoftVersionTrack>();
            var softs     = _linqOP.Search <SoftToUpdate>(o => o.IdentificationKey == UpdateSection.SoftKey);
            var customers = _linqOP.Search <Customer>(o => o.IdentificationKey == UpdateSection.CustomerKey);
            var mappings  = _linqOP.GetDataContext <SoftVersionCustomerMapping>();
            var query     = from t in tracks
                            from s in softs
                            where t.SoftID == s.ID
                            from map in mappings
                            where t.ID == map.SoftVersionID
                            from c in customers
                            where map.CustomerID == c.ID
                            select new SoftVersionTrack
            {
                CreateTime       = t.CreateTime,
                ID               = t.ID,
                IsCoerciveUpdate = t.IsCoerciveUpdate,
                SoftID           = t.SoftID,
                UpdatedFileList  = t.UpdatedFileList,
                VersionCode      = t.VersionCode
            };
            var data = query.Select(o => new SoftVersionTrackBO(o)).ToList().OrderByDescending(o => o.CreateTime);

            return(data);
        }
Esempio n. 2
0
        protected override IEnumerable <CustomerBO> SearchData()
        {
            var softs = _linqOP.Search <Customer>().ToList();
            var bos   = softs.Select(o => (CustomerBO)o).ToList();

            return(bos);
        }
Esempio n. 3
0
        protected override IEnumerable <SoftToUpdateBO> SearchData()
        {
            var softs = _linqOP.Search <SoftToUpdate>().ToList();
            var bos   = softs.Select(o => (SoftToUpdateBO)o).ToList();

            return(bos);
        }
Esempio n. 4
0
        private string CheckData(string columnName)
        {
            string errorInfo = null;

            switch (columnName)
            {
            case "StyleCode":
            {
                if (string.IsNullOrEmpty(StyleCode))
                {
                    errorInfo = "不能为空";
                }
                else
                {
                    var style = _distributionLinqOP.Search <ProStyle>(o => o.Code == StyleCode).FirstOrDefault();
                    if (style == null)
                    {
                        errorInfo = "款号不正确";
                        StyleID   = default(int);
                        StyleName = "";
                        BrandName = "";
                        Price     = 0;
                    }
                    else
                    {
                        StyleID   = style.ID;
                        StyleName = VMGlobalBase.ProNames.Find(o => o.ID == style.NameID).Name;
                        var brandID = _distributionLinqOP.GetById <ProBYQ>(style.BYQID).BrandID;
                        var brand   = VMGlobalBase.PoweredBrands.Find(o => o.ID == brandID);
                        BrandName = brand == null ? "" : brand.Name;
                    }
                }
            }
            break;

            case "ColorID":
                if (ColorID == default(int))
                {
                    errorInfo = "不能为空";
                }
                break;

            case "SizeID":
                if (SizeID == default(int))
                {
                    errorInfo = "不能为空";
                }
                break;
            }

            return(errorInfo);
        }
Esempio n. 5
0
        public CertificationMakeVM()
            : base(VMGlobal.SysProcessQuery.LinqOP)
        {
            Entities = this.SearchData();
            var sizes    = _linqOP.Search <BusiDataDictionary>(o => o.Name == "合格证尺寸");
            var children = _linqOP.GetDataContext <BusiDataDictionary>();
            var query    = from child in children
                           from size in sizes
                           where child.ParentCode == size.Code
                           select child;
            var data = query.ToList();

            _width  = data.FirstOrDefault(o => o.Name == "宽度");
            _height = data.FirstOrDefault(o => o.Name == "高度");
        }
        protected override IEnumerable <OrganizationArea> SearchData()
        {
            var result = _linqOP.Search <OrganizationArea>(o => o.OrganizationID == VMGlobal.CurrentUser.OrganizationID).ToList();

            return(result);
        }