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)); }
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)); }
public ActionResult TypeEdit(PD_TYPE model) { PdTypeBll bll = new PdTypeBll(); PD_TYPE bType = bll.Query(t => t.Id == model.Id).FirstOrDefault(); if (bType == null) { bType = model; bll.Add(bType); } else { bType.Tid = model.Tid; bType.TypeId = model.TypeId; bType.Name = model.Name; bType.Remark = model.Remark; bll.Update(bType); } ViewBag.Success = true; ViewBag.Message = "修改成功!"; ViewBag.BaseType = new PdBasetypeBll().Query(t => true).ToDictionary(t => t.Id, t => t.Name); return(View(bType)); }
public ActionResult TypeList(int?page, int?count, string keyword, int?baseTypeId) { page = page.ToInt() == 0 ? 1 : page; count = count.ToInt() == 0 ? 10 : count; var predicate = PredicateBuilder.New <PD_TYPE>(true); if (!string.IsNullOrEmpty(keyword)) { ViewBag.Keyword = keyword; predicate = predicate.And(t => t.Name.Contains(keyword)); } if (baseTypeId.ToInt() > 0) { ViewBag.baseTypeId = baseTypeId; predicate = predicate.And(t => t.TypeId == baseTypeId); } PdTypeBll bll = new PdTypeBll(); int total = 0; List <PD_TYPE> allKefu = bll.QueryByPage(page.ToInt(), count.ToInt(), out total, predicate, t => t.Id, false); ViewBag.Total = total; ViewBag.PageIndex = page; ViewBag.PageCount = count; ViewBag.BaseType = new PdBasetypeBll().Query(t => true).ToDictionary(t => t.Id, t => t.Name); return(View(allKefu)); }
public ActionResult TypeDel(int id) { PdTypeBll bll = new PdTypeBll(); PD_TYPE model = bll.Query(t => t.Id == id).FirstOrDefault(); if (model != null) { bll.Delete(model, true); } return(Json(BaseModels.OK("成功!"))); }
public ActionResult TypeEdit(int?id) { PD_TYPE bType = new PD_TYPE(); if (id.ToInt() > 0) { PdTypeBll bll = new PdTypeBll(); bType = bll.Query(t => t.Id == id).FirstOrDefault(); } ViewBag.BaseType = new PdBasetypeBll().Query(t => true).ToDictionary(t => t.Id, t => t.Name); return(View(bType)); }
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)); }