Example #1
0
        public string GetProductSList()
        {
            ListObj result = new ListObj();

            int sid         = QueryString.IntSafeQ("sid");
            int pageindex   = QueryString.IntSafeQ("pageindex");
            int pagesize    = CommonKey.PageSizeProductMobile;
            int isactive    = 1;
            int recordcount = 0;

            IList <VWProductSpecialDetailsEntity> sdlist = ProductSpecialDetailsBLL.Instance.GetProductSpecialDetailsList(pageindex, pagesize, ref recordcount, sid, isactive);
            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                ViewBag.MemId     = member.MemId;
                ViewBag.MemStatus = member.Status;
                if (sdlist != null && sdlist.Count > 0)
                {
                    foreach (VWProductSpecialDetailsEntity entity in sdlist)
                    {
                        if (entity.ProductDetail != null && entity.ProductDetail.ProductId > 0)
                        {
                            entity.Price = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, entity.ProductDetail.TradePrice, entity.ProductDetail.Price, entity.ProductDetail.IsBP, entity.ProductDetail.DealerPrice);
                        }
                    }
                }
            }
            result.Total = recordcount;
            result.List  = sdlist;
            string liststr = JsonJC.ObjectToJson(result);

            return(liststr);
        }
Example #2
0
    static void Main(string[] args)
    {
        DataTable dt = new DataTable();

        dt.Columns.Add("ID");
        dt.Columns.Add("Name");
        dt.Rows.Add("1", "AAA");
        dt.Rows.Add("2", "BBB");
        dt.Rows.Add("3", "CCC");
        ListObj objListObj = new ListObj();

        //to fill the list / collection
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            objListObj.Add(new Obj()
            {
                ID = Convert.ToInt16(dt.Rows[i][0]), Name = dt.Rows[i][1].ToString()
            });
        }
        //To verify if the collection is filled.
        foreach (var item in objListObj)
        {
            Console.WriteLine(item.ID + " : " + item.Name);
        }
        Console.Read();
    }
        public string InquiryOrderListJeson()
        {
            ListObj result    = new ListObj();
            int     _status   = FormString.IntSafeQ("s", -1);
            int     pagesize  = CommonKey.PageSizeCGOrderMobile;
            int     pageindex = FormString.IntSafeQ("px");

            if (pageindex == 0)
            {
                pageindex = 1;
            }
            string key = FormString.SafeQ("k");

            if (pageindex == 0)
            {
                pageindex = 1;
            }
            int record = 0;
            IList <VWInquiryOrderEntity> list = InquiryOrderBLL.Instance.GetInquiryOrderList(pagesize, pageindex, ref record, memid, _status, -1, key);

            result.Total   = record;
            result.List    = list;
            ViewBag.Status = _status;
            return(JsonJC.ObjectToJson(result));
        }
Example #4
0
        public string GetSearchJsonList()
        {
            ListObj result    = new ListObj();
            int     classid   = QueryString.IntSafeQ("cl");
            int     brandid   = QueryString.IntSafeQ("bd");
            int     siteid    = QueryString.IntSafeQ("s");
            int     pageindex = QueryString.IntSafeQ("pi");
            int     jishi     = QueryString.IntSafeQ("js", -1);

            if (jishi == -1)
            {
                jishi = (int)JiShiSongEnum.Normal;
            }

            if (pageindex < 1)
            {
                pageindex = 1;
            }
            int    pagesize = CommonKey.PageSizeList;
            string querykey = QueryString.SafeQ("key");

            string liststr = JsonJC.ObjectToJson(result);

            return(liststr);
        }
        public string GetProductFine()
        {
            int _finetype  = FormString.IntSafeQ("ft", (int)ProductFineTypeEnum.MobileHome);//精选类型
            int _pageindex = FormString.IntSafeQ("pageindex");
            int _pagesize  = CommonKey.PageSizeList;
            int total      = 0;
            IList <VWProductFineEntity> list = ProductFineBLL.Instance.GetProductFineList(_pagesize, _pagesize, ref total, _finetype);
            ListObj listobj = new ListObj();

            listobj.Total = total;
            listobj.List  = list;
            string liststr = JsonJC.ObjectToJson(listobj);

            return(liststr);
        }
        public string GetOrderListJson()
        {
            ListObj result       = new ListObj();
            int     _pagesize    = CommonKey.PageSizeOrderMobile;
            int     _pageindex   = QueryString.IntSafeQ("pageindex", 1);
            int     _recordCount = 0;

            string _keyword   = QueryString.SafeQ("k");
            int    _status    = QueryString.IntSafeQ("s", 0);
            int    _term      = QueryString.IntSafeQ("t", 0);
            int    orderstyle = QueryString.IntSafeQ("os", 0);

            if (orderstyle == 0)
            {
                orderstyle = (int)OrderStyleEnum.Normal;
            }


            IList <ConditionUnit> _wherelist = new List <ConditionUnit>();

            _wherelist.Add(new ConditionUnit {
                FieldName = SearchFieldName.SeachDefault, CompareValue = _keyword
            });
            _wherelist.Add(new ConditionUnit {
                FieldName = SearchFieldName.OrderStatus, CompareValue = _status
            });
            _wherelist.Add(new ConditionUnit {
                FieldName = SearchFieldName.OrderTerm, CompareValue = _term
            });
            _wherelist.Add(new ConditionUnit {
                FieldName = SearchFieldName.MemId, CompareValue = memid
            });
            _wherelist.Add(new ConditionUnit {
                FieldName = SearchFieldName.OrderStyle, CompareValue = orderstyle
            });


            IList <VWOrderEntity> _Orderlist = OrderBLL.Instance.GetVWOrderList(_pagesize, _pageindex, ref _recordCount, _wherelist);

            result.Total = _recordCount;
            result.List  = _Orderlist;

            string liststr = JsonJC.ObjectToJson(result);

            return(liststr);
        }
        public string GetIntegralDetails()
        {
            ListObj result     = new ListObj();
            int     _pagesize  = CommonKey.PageSizeIntegralChange;
            int     _pageindex = QueryString.IntSafeQ("pageindex");

            if (_pageindex == 0)
            {
                _pageindex = 1;
            }
            int recordCount = 0;
            IList <IntegralChangeEntity> _changelist = IntegralChangeBLL.Instance.GetIntegralChangeList(_pagesize, _pageindex, ref recordCount, memid);

            result.Total = recordCount;
            result.List  = _changelist;
            string liststr = JsonJC.ObjectToJson(result);

            return(liststr);
        }
Example #8
0
        public string GetCGMemListJson()
        {
            ResultObj result               = new ResultObj();
            string    contactname          = FormString.SafeQ("contactname");
            string    contactphone         = FormString.SafeQ("contactphone");
            string    companyname          = FormString.SafeQ("companyname");
            string    status               = FormString.SafeQ("s", -1);
            int       pageindex            = FormString.IntSafeQ("pageindex", 1);
            int       pagesize             = CommonKey.PageSizeCheck;
            int       record               = 0;
            ListObj   _listobj             = new ListObj();
            IList <VWMemAutoTemplete> list = MemberBLL.Instance.GetMemBasicInfoList(pagesize, pageindex, ref record, contactname, contactphone, companyname, -1, 1, -1);

            result.Status  = (int)CommonStatus.Success;
            _listobj.Total = record;
            _listobj.List  = list;
            result.Obj     = _listobj;
            return(JsonJC.ObjectToJson(result));
        }
Example #9
0
        /// <summary>
        /// 查询价订单指派的供应商列表
        /// </summary>
        /// <returns></returns>
        public string GetInquiryCGMemListJson()
        {
            ResultObj result    = new ResultObj();
            string    ordercode = FormString.SafeQ("ordercode");
            int       status    = FormString.IntSafeQ("s", -1);
            int       hasread   = FormString.IntSafeQ("r", -1);
            int       hasquote  = FormString.IntSafeQ("q", -1);
            int       cgmemid   = FormString.IntSafeQ("cgmemid", -1);
            int       pageindex = FormString.IntSafeQ("pageindex", 1);
            int       pagesize  = CommonKey.PageSizeCheck;
            int       record    = 0;
            ListObj   _listobj  = new ListObj();
            IList <VWCGMemQuotedEntity> list = CGMemQuotedBLL.Instance.GetInquiryCGMemQuotedList(pagesize, pageindex, ref record, ordercode, hasread, hasquote, status, cgmemid);

            result.Status  = (int)CommonStatus.Success;
            _listobj.Total = record;
            _listobj.List  = list;
            result.Obj     = _listobj;
            return(JsonJC.ObjectToJson(result));
        }
        /// <summary>
        /// 获取产品详情
        /// </summary>
        /// <returns></returns>
        public string GetCommentByStyle()
        {
            int _styleId                = FormString.IntSafeQ("styleid");
            int _pageindex              = FormString.IntSafeQ("pageindex");
            int _pagesize               = CommonKey.PageSizeCommentShow;
            int _recordcount            = 0;
            IList <CommentEntity> _list = new List <CommentEntity>();

            IList <ConditionUnit> where = new List <ConditionUnit>();
            where.Add(new ConditionUnit {
                FieldName = "StyleId", CompareValue = _styleId.ToString()
            });
            _list = CommentBLL.Instance.GetCommentList(_pagesize, _pageindex, ref _recordcount, where);
            ListObj listobj = new ListObj();

            listobj.Total = _recordcount;
            listobj.List  = _list;
            string liststr = JsonJC.ObjectToJson(listobj);

            return(liststr);
        }
Example #11
0
        static void Main(string[] args)
        {
            employees = new List <Employee>
            {
                new DeliveryManager("Alina", "Petrosian", new DateTime(1987, 2, 2)),
                new Cooker("Inna", "Kravtsova", new DateTime(1999, 11, 24)),
                new Manager("Igor", "Petrov", new DateTime(2001, 8, 11)),
                new Manager("Igor222", "Petrov", new DateTime(2001, 8, 11)),
                new Manager("Kirill", "Dorn", new DateTime(1995, 3, 10)),
                new Manager("Valentin", "Skorohod", new DateTime(2004, 3, 7)),
                new Cleaner("Sergey", "Vasnetsov", new DateTime(1993, 8, 8))
            };

            ListObj <Employee> list = new ListObj <Employee>(employees, "Available employees");
            var item  = list["Petrov"];
            var item2 = list[0];

            var isCleaned = UrgentTableClean();

            Console.ReadKey();
        }
        /// <summary>
        /// 获取地址列表
        /// </summary>
        /// <returns></returns>
        public string GetPostAddressList()
        {
            int _pageindex = FormString.IntSafeQ("pageindex");

            if (_pageindex == 0)
            {
                _pageindex = 1;                 //获得当前页的页数
            }
            int     _pagesize   = (int)CommonKey.PageSizeAddress;
            int     recordcount = 0;
            ListObj tobj        = new ListObj();//定义实际需要的对象
            IList <ConditionUnit> _seachwhere = new List <ConditionUnit>();

            _seachwhere.Add(new ConditionUnit {
                FieldName = SearchFieldName.MemId, CompareValue = memid
            });
            IList <MemPostAddressEntity> _list = PostAddressBLL.Instance.GetPostAddressList(_pagesize, _pageindex, ref recordcount, _seachwhere);

            tobj.Total = recordcount;
            tobj.List  = _list;
            //tobj.Listjson = JsonJC.ObjectToJson(_list);
            return(JsonJC.ObjectToJson(tobj));
        }
Example #13
0
        public string GetJsonList()
        {
            ListObj result  = new ListObj();
            string  _key    = QueryString.SafeQ("key");
            int     classid = QueryString.IntSafeQ("cid");
            int     brandid = QueryString.IntSafeQ("bd");
            int     siteid  = QueryString.IntSafeQ("s");

            if (siteid <= 0)
            {
                siteid = (int)SiteIdEnum.BathRoom;
            }
            int pageindex = QueryString.IntSafeQ("pageindex");
            int pagesize  = CommonKey.PageSizeList;
            int record    = 0;
            int order_i   = 0;//默认排序

            if (pageindex == 0)
            {
                pageindex = 1;
            }
            ViewBag.SelectClassId = classid;
            ViewBag.SelectBrandId = brandid;
            int    rediclassid = classid;
            string classidstr  = "";//分类子集



            if (classid > 0)
            {
                ClassesFoundEntity _classentity = ClassesFoundBLL.Instance.GetClassesFound(classid, false);
                if (_classentity.RedirectClassId > 0)
                {
                    rediclassid = _classentity.RedirectClassId;
                }
                IList <int> classintlist = new List <int>();
                if (_classentity.RedirectClassId > 0)
                {
                    classintlist = ClassesFoundBLL.Instance.GetSubClassEndList(_classentity.RedirectClassId);
                }
                else
                {
                    classintlist = ClassesFoundBLL.Instance.GetSubClassEndList(classid);
                }
                if (classintlist != null && classintlist.Count > 0)
                {
                    classidstr = string.Join("_", classintlist);
                }
                else if (_classentity.RedirectClassId > 0)
                {
                    classidstr = StringUtils.GetDbString(_classentity.RedirectClassId);
                }
                else
                {
                    classidstr = StringUtils.GetDbString(classid);
                }
            }
            else
            {
                IList <int> classintlist = new List <int>();
                classintlist = ClassesFoundBLL.Instance.GetSubClassEndListBySite(siteid);

                if (classintlist != null && classintlist.Count > 0)
                {
                    classidstr = string.Join("_", classintlist);
                }
            }


            IList <VWProductEntity> _productlist = new List <VWProductEntity>();// ProductBLL.Instance.GetProductListProcCYC(pagesize, pageindex, ref record, classidstr, brandid, "", order_i, producttype,  cartype ,jishi);

            _productlist = ProductBLL.Instance.GetProductListProc(pagesize, pageindex, ref record, classidstr, brandid, "", order_i, _key);

            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                ViewBag.MemId     = member.MemId;
                ViewBag.MemStatus = member.Status;
                foreach (VWProductEntity _entity in _productlist)
                {
                    _entity.ActualPrice = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, _entity.TradePrice, _entity.Price, _entity.IsBP, _entity.DealerPrice);
                }
            }
            else
            {
                foreach (VWProductEntity _entity in _productlist)
                {
                    _entity.ActualPrice = 0;
                }
            }
            result.Total = record;
            result.List  = _productlist;

            string liststr = JsonJC.ObjectToJson(result);

            return(liststr);
        }
        public string GetJsonList()
        {
            ListObj result      = new ListObj();
            int     classid     = QueryString.IntSafeQ("cl");
            int     brandid     = QueryString.IntSafeQ("bd");
            int     cartype     = QueryString.IntSafeQ("ct");
            int     producttype = QueryString.IntSafeQ("pt");
            int     jishi       = QueryString.IntSafeQ("js");

            if (jishi == 0)
            {
                jishi = (int)JiShiSongEnum.Normal;
            }
            if (producttype == 0)
            {
                producttype = (int)ProductType.Normal;
            }
            int siteid = QueryString.IntSafeQ("s");

            if (siteid <= 0)
            {
                siteid = (int)SiteEnum.Default;
            }
            int pageindex  = QueryString.IntSafeQ("pageindex");
            int pagesize   = CommonKey.PageSizeList;
            int record     = 0;
            int order_i    = 0;//默认排序
            int _classtype = -1;

            _classtype        = QueryString.IntSafeQ("clt");
            ViewBag.ClassType = _classtype;
            if (pageindex == 0)
            {
                pageindex = 1;
            }
            ViewBag.SelectClassId = classid;
            ViewBag.SelectBrandId = brandid;
            ViewBag.CarType       = cartype;
            int    _classmenutype = (int)ClassMenuTypeEnum.Normal; //分类列表选择类型
            int    rediclassid    = classid;
            string classidstr     = "";                            //分类子集

            //获取选择的车型
            if (cartype > 0)
            {
                CarTypeModelEntity cartypemodel = CarTypeModelBLL.Instance.GetCarTypeModel(cartype);
                ViewBag.SelectCarTypeName = cartypemodel.ModelName;
            }

            if (classid > 0)
            {
                ClassesFoundEntity _classentity = ClassesFoundBLL.Instance.GetClassesFound(classid, true);
                if (_classentity.RedirectClassId > 0)
                {
                    rediclassid = _classentity.RedirectClassId;
                }
                ViewBag.SelectClassName = _classentity.Name;
                IList <int> classintlist = new List <int>();
                if (_classentity.RedirectClassId > 0)
                {
                    classintlist = ClassesFoundBLL.Instance.GetSubClassEndList(_classentity.RedirectClassId);
                }
                else
                {
                    classintlist = ClassesFoundBLL.Instance.GetSubClassEndList(classid);
                }
                if (classintlist != null && classintlist.Count > 0)
                {
                    classidstr = string.Join("_", classintlist);
                }
                else if (_classentity.RedirectClassId > 0)
                {
                    classidstr = StringUtils.GetDbString(_classentity.RedirectClassId);
                }
                else
                {
                    classidstr = StringUtils.GetDbString(classid);
                }
            }
            else
            {
                IList <int> classintlist = new List <int>();
                classintlist = ClassesFoundBLL.Instance.GetSubClassEndListBySite(siteid);

                if (classintlist != null && classintlist.Count > 0)
                {
                    classidstr = string.Join("_", classintlist);
                }
            }


            IList <VWProductEntity> _productlist = new List <VWProductEntity>();// ProductBLL.Instance.GetProductListProcCYC(pagesize, pageindex, ref record, classidstr, brandid, "", order_i, producttype,  cartype ,jishi);

            MemberLoginEntity member = CookieBLL.GetLoginCookie();

            if (member != null && member.MemId > 0)
            {
                ViewBag.MemId     = member.MemId;
                ViewBag.MemStatus = member.Status;
                foreach (VWProductEntity _entity in _productlist)
                {
                    _entity.ActualPrice = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, _entity.TradePrice, _entity.Price, _entity.IsBP, _entity.DealerPrice);
                }
            }
            else
            {
                foreach (VWProductEntity _entity in _productlist)
                {
                    _entity.ActualPrice = 0;
                }
            }
            result.Total = record;
            result.List  = _productlist;

            string liststr = JsonJC.ObjectToJson(result);

            return(liststr);
        }
Example #15
0
        /// <summary>
        /// 保存,修改后明细的数据JSon需要更新
        /// </summary>
        /// <param name="MonthReportID">月报ID</param>
        /// <param name="CurrentRpt"></param>
        /// <param name="ListObj"></param>
        private void SaveJsonData(Guid MonthReportID, ReportInstance CurrentRpt)
        {
            B_MonthlyReportJsonData Update_JsonData;

            try
            {
                Update_JsonData = B_MonthlyReportJsonDataOperator.Instance.GetMonthlyReportJsonData(MonthReportID);
            }
            catch (Exception ex)//去Json 表中查看下数据
            {
                Update_JsonData = null;
            }

            if (Update_JsonData != null)
            {
                Update_JsonData.SystemID   = CurrentRpt._SystemID;
                Update_JsonData.PlanType   = "M";
                Update_JsonData.FinMonth   = CurrentRpt.FinMonth;
                Update_JsonData.FinYear    = CurrentRpt.FinYear;
                Update_JsonData.ModifyTime = DateTime.Now;

                List <DictionaryVmodel> ListObj;

                if (string.IsNullOrEmpty(Update_JsonData.ReportJsonData))                                              //新增
                {                                                                                                      //这是上报页面的Json 数据
                    ListObj = new List <DictionaryVmodel>();
                    ListObj.Add(new DictionaryVmodel("ReportInstance", CurrentRpt));                                   //
                    ListObj.Add(new DictionaryVmodel("MonthDetail", GetTargetDetailList(CurrentRpt, "Detail", true))); //
                    ListObj.Add(new DictionaryVmodel("Misstarget", GetMissTargetList(CurrentRpt, MonthReportID.ToString(), true)));
                    ListObj.Add(new DictionaryVmodel("MonthReportDescription", GetMonthTRptDescription(CurrentRpt)));
                    ListObj.Add(new DictionaryVmodel("CurrentMisstarget", GetCurrentMissTargetList(CurrentRpt, MonthReportID.ToString(), true)));
                }
                else
                { //编辑数据
                    ListObj = JsonHelper.Deserialize <List <DictionaryVmodel> >(Update_JsonData.ReportJsonData);
                    ListObj.ForEach(p =>
                    {
                        if (p.Name == "Misstarget")
                        {
                            p.ObjValue = GetMissTargetList(CurrentRpt, MonthReportID.ToString(), true);
                        }
                        if (p.Name == "CurrentMisstarget")
                        {
                            p.ObjValue = GetCurrentMissTargetList(CurrentRpt, MonthReportID.ToString(), true);
                        }
                    });
                }

                StringBuilder sb = new StringBuilder();
                sb.Append(JsonHelper.Serialize(ListObj)); // 追加所有的出来的数据
                Update_JsonData.ReportJsonData = sb.ToString();

                //这里记录 上传后的Json数据
                B_MonthlyReportJsonDataOperator.Instance.UpdateMonthlyReportJsonData(Update_JsonData);
            }
            else
            {
                //新增数据
                B_MonthlyReportJsonData JsonData = new B_MonthlyReportJsonData();
                JsonData.ID         = MonthReportID;
                JsonData.SystemID   = CurrentRpt._SystemID;
                JsonData.PlanType   = "M";
                JsonData.FinMonth   = CurrentRpt.FinMonth;
                JsonData.FinYear    = CurrentRpt.FinYear;
                JsonData.CreateTime = DateTime.Now;

                List <DictionaryVmodel> ListObj = new List <DictionaryVmodel>();
                //这是上报页面的Json 数据
                ListObj.Add(new DictionaryVmodel("ReportInstance", CurrentRpt));                                   //
                ListObj.Add(new DictionaryVmodel("MonthDetail", GetTargetDetailList(CurrentRpt, "Detail", true))); //
                ListObj.Add(new DictionaryVmodel("Misstarget", GetMissTargetList(CurrentRpt, MonthReportID.ToString(), true)));
                ListObj.Add(new DictionaryVmodel("MonthReportDescription", GetMonthTRptDescription(CurrentRpt)));
                ListObj.Add(new DictionaryVmodel("CurrentMissTargetList", GetCurrentMissTargetList(CurrentRpt, MonthReportID.ToString(), true)));

                StringBuilder sb = new StringBuilder();
                sb.Append(JsonHelper.Serialize(ListObj)); // 追加所有的出来的数据
                JsonData.ReportJsonData = sb.ToString();

                //这里记录 上传后的Json数据
                B_MonthlyReportJsonDataOperator.Instance.AddMonthlyReportJsonData(JsonData);
            }
        }