Ejemplo n.º 1
0
        public ActionResult ApplyerList(int?page, int?count, string keyword, string userId, string kefuId, string status,
                                        string nationality, string type, string begin, string end)
        {
            page  = page.ToInt() == 0 ? 1 : page;
            count = count.ToInt() == 0 ? 10 : count;

            var predicate = PredicateBuilder.New <TT_Trademark_Applyer>(true);

            if (!string.IsNullOrEmpty(keyword))
            {
                ViewBag.Keyword = keyword;
                predicate       = predicate.And(t => t.Name.Contains(keyword) || t.TemplateName.Contains(keyword));
            }
            //if (!string.IsNullOrEmpty(parent))
            //{
            //    predicate = predicate.And(t => t.Parent == parent);
            //    ViewBag.Parent = parent;
            //}

            TtTrademarkApplyerBll bll = new TtTrademarkApplyerBll();

            int total = 0;
            List <TT_Trademark_Applyer> allAreas = bll.QueryByPage(page.ToInt(), count.ToInt(), out total, predicate, t => t.Id, false);

            ViewBag.Total     = total;
            ViewBag.PageIndex = page;
            ViewBag.PageCount = count;
            var baseType = new PdTypeBll().Query(t => t.TypeId == 5 || t.TypeId == 6);

            ViewBag.DicNationality = baseType.Where(t => t.TypeId == 5).ToDictionary(t => t.Tid.ToInt(), t => t.Name);
            ViewBag.DicType        = baseType.Where(t => t.TypeId == 6).ToDictionary(t => t.Tid.ToInt(), t => t.Name);

            return(View(allAreas));
        }
Ejemplo n.º 2
0
        public ActionResult ApplyerEdit(TT_Trademark_Applyer model)
        {
            TtTrademarkApplyerBll bll     = new TtTrademarkApplyerBll();
            TT_Trademark_Applyer  applyer = bll.Query(t => t.Id == model.Id).FirstOrDefault();

            var baseType = new PdTypeBll().Query(t => t.TypeId == 5 || t.TypeId == 6 || t.TypeId == 8);

            ViewBag.DicNationality    = baseType.Where(t => t.TypeId == 5).ToDictionary(t => t.Tid.ToInt(), t => t.Name);
            ViewBag.DicType           = baseType.Where(t => t.TypeId == 6).ToDictionary(t => t.Tid.ToInt(), t => t.Name);
            ViewBag.DicCerificateType = baseType.Where(t => t.TypeId == 8).ToDictionary(t => t.Tid.ToInt(), t => t.Name);

            if (applyer == null)
            {
                applyer = model;
                bll.Add(applyer);
            }
            else
            {
                applyer.Name = model.Name;
                //applyer.Remark = model.Remark;
                bll.Update(applyer);

                return(View(applyer));
            }

            ViewBag.Success = true;
            ViewBag.Message = "成功!";

            return(View(applyer));
        }
Ejemplo n.º 3
0
        public ActionResult ApplyerEdit(int?id)
        {
            TT_Trademark_Applyer applyer = new TT_Trademark_Applyer();

            if (id.ToInt() > 0)
            {
                TtTrademarkApplyerBll bll = new TtTrademarkApplyerBll();
                applyer = bll.Query(t => t.Id == id).FirstOrDefault();
            }
            var baseType = new PdTypeBll().Query(t => t.TypeId == 5 || t.TypeId == 6 || t.TypeId == 8);

            ViewBag.DicNationality    = baseType.Where(t => t.TypeId == 5).ToDictionary(t => t.Tid.ToInt(), t => t.Name);
            ViewBag.DicType           = baseType.Where(t => t.TypeId == 6).ToDictionary(t => t.Tid.ToInt(), t => t.Name);
            ViewBag.DicCerificateType = baseType.Where(t => t.TypeId == 8).ToDictionary(t => t.Tid.ToInt(), t => t.Name);

            ViewBag.allArea = new PdAreasBll().Query(t => true);
            //ViewBag.DicProvince = allArea.Where(t => t.Parent == "CN").ToDictionary(t => t.Id, t => t.Name);
            //ViewBag.DicCity = allArea.Where(t => t.Parent == (applyer.Province == null ? "110000" : applyer.Province )).ToDictionary(t => t.Id, t => t.Name);
            //ViewBag.DicDistrict = allArea.Where(t => t.Parent == (applyer.City == null ? "110100" : applyer.City)).ToDictionary(t => t.Id, t => t.Name);

            return(View(applyer));
        }