Example #1
0
        //加载尺码表详细信息
        public JsonResult BugCodeSize(string Size_Code, string Action)
        {
            using (var db = new MySqlServer())
                try
                {
                    switch (Action)
                    {
                    case "XF_SY_NAN":

                        return(Json(new { state = 1, msg = XF_SY_NAN_ChiMa.Query(T => T.Status == 1 && T.Size_Code == Size_Code, o => o.Id, false).ToList() }, JsonRequestBehavior.AllowGet));

                    case "XF_SY_NU":

                        return(Json(new { state = 1, msg = XF_SY_NU_ChiMa.Query(T => T.Status == 1 && T.Size_Code == Size_Code, o => o.Id, false).ToList() }, JsonRequestBehavior.AllowGet));

                    case "XF_KZ_NAN":
                        return(Json(new { state = 1, msg = XF_KZ_Service.Query(T => T.Status == 1 && T.Size_Code == Size_Code, o => o.Id, false).ToList() }, JsonRequestBehavior.AllowGet));

                    case "XF_KZ_NU":
                        return(Json(new { state = 1, msg = XF_KZ_Service.Query(T => T.Status == 1 && T.Size_Code == Size_Code, o => o.Id, false).ToList() }, JsonRequestBehavior.AllowGet));

                    default:
                        throw new Exception("系统出错:没有对应的Action");
                    }
                }
                catch (Exception ex)
                {
                    return(Json(new { state = -1, msg = ex.Message }, JsonRequestBehavior.AllowGet));
                }
        }
Example #2
0
        public JsonResult Manage(string Code, string Action)
        {
            using (var db = new MySqlServer())
                try
                {
                    switch (Action)
                    {
                    case "XF_SY_NAN":    //西服上衣  男

                        return(Json(new { state = 1, msg = XF_SY_NAN_ChiMa.Query(T => T.Size_Code == Code && T.IsDeleted == false, O => O.Id, false) }, JsonRequestBehavior.AllowGet));

                    case "XF_SY_NU":
                        return(Json(new { state = 1, msg = XF_SY_NU_ChiMa.Query(T => T.Size_Code == Code && T.IsDeleted == false, O => O.Id, false) }, JsonRequestBehavior.AllowGet));

                    case "XF_KZ_NAN":
                    case "XF_KZ_NU":

                        return(Json(new { state = 1, msg = XF_KZ_CodeSizeService.Query(T => T.Size_Code == Code && T.IsDeleted == false, O => O.Id, false), HeightKuChang = HeightKuChangService.Query(T => T.Size_Code == Code && T.IsDeleted == false, O => O.Id, false) }, JsonRequestBehavior.AllowGet));

                    default:
                        throw new Exception("系统出错:没有对应的Action");
                    }
                }
                catch (Exception ex)
                {
                    return(Json(new { state = 1, msg = ex.Message }, JsonRequestBehavior.AllowGet));
                }
        }
Example #3
0
        public JsonResult Examine(string Action)
        {
            using (var db = new MySqlServer())
                try
                {
                    List <Examine> list = new List <Examine>();
                    switch (Action)
                    {
                    case "XF_SY_NAN":

                        var qudate = XF_SY_NAN_ChiMa.Query(c => c.Status == 1, o => o.Id, false);


                        foreach (var item in qudate.GroupBy(it => it.Size_Code).Select(s => new { CreateDateTime = s.Max(l => l.CreateDateTime), Size_Code = s.Key }))
                        {
                            Examine ex = new Examine();

                            ex.CreateTime = item.CreateDateTime.ToString("yyyy-MM-dd");
                            ex.Code       = item.Size_Code;
                            list.Add(ex);
                        }

                        return(Json(new { state = 1, msg = list }, JsonRequestBehavior.AllowGet));

                    case "XF_SY_NU":

                        var qudatenu = XF_SY_NU_ChiMa.Query(c => c.Status == 1, o => o.Id, false);

                        foreach (var item in qudatenu.GroupBy(it => it.Size_Code).Select(s => new { CreateDateTime = s.Max(l => l.CreateDateTime), Size_Code = s.Key }))
                        {
                            Examine ex = new Examine();

                            ex.CreateTime = item.CreateDateTime.ToString("yyyy-MM-dd");
                            ex.Code       = item.Size_Code;
                            list.Add(ex);
                        }

                        return(Json(new { state = 1, msg = list }, JsonRequestBehavior.AllowGet));

                    case "XF_KZ_NAN":

                        var qudatekznan = XF_KZ_Service.Query(c => c.Status == 1, o => o.Id, false);

                        foreach (var item in qudatekznan.GroupBy(it => it.Size_Code).Select(s => new { CreateDateTime = s.Max(l => l.CreateDateTime), Size_Code = s.Key }))
                        {
                            Examine ex = new Examine();

                            ex.CreateTime = item.CreateDateTime.ToString("yyyy-MM-dd");
                            ex.Code       = item.Size_Code;
                            list.Add(ex);
                        }

                        return(Json(new { state = 1, msg = list }, JsonRequestBehavior.AllowGet));

                    case "XF_KZ_NU":

                        var qudatekznu = XF_KZ_Service.Query(c => c.Status == 1, o => o.Id, false);

                        foreach (var item in qudatekznu.GroupBy(it => it.Size_Code).Select(s => new { CreateDateTime = s.Max(l => l.CreateDateTime), Size_Code = s.Key }))
                        {
                            Examine ex = new Examine();

                            ex.CreateTime = item.CreateDateTime.ToString("yyyy-MM-dd");
                            ex.Code       = item.Size_Code;
                            list.Add(ex);
                        }

                        return(Json(new { state = 1, msg = list }, JsonRequestBehavior.AllowGet));

                    default:
                        throw new Exception("系统出错:没有对应的Action");
                    }
                }
                catch (Exception ex)
                {
                    return(Json(new { state = -1, msg = ex.Message }, JsonRequestBehavior.AllowGet));
                }
        }