public ActionResult Edit(RegistrationAuthorityModel model)
 {
     if (ModelState.IsValid)
     {
         if (model.RegistrationAuthorityType.ToString().ToLower() == "f9dfd136-3c5d-e711-9354-0023248142a5" && model.ExecutiveStreet == null)
         {
             ModelState.AddModelError("ExecutiveStreet", "行政街道必填");
             return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
         }
         var info = service.GetById(model.Id);
         if (info != null)
         {
             info.RegistrationAuthorityType = model.RegistrationAuthorityType;
             info.ExecutiveStreet           = model.ExecutiveStreet;
             info.Address      = model.Address;
             info.lng          = model.lng;
             info.lat          = model.lat;
             info.Telephone    = model.Telephone;
             info.WorkingHours = model.WorkingHours;
             info.UpdateDate   = DateTime.Now;
             service.Update(info);
             return(Json(new AjaxResult()
             {
                 Result = Result.Success, Message = "操作成功"
             }));
         }
     }
     return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
 }
        public ActionResult Delete(Guid id)
        {
            RegistrationAuthorityModel model = new RegistrationAuthorityModel();
            var info = service.GetById(id);

            if (info != null)
            {
                info.IsDelete = true;
                service.Update(info);
                return(Json(new AjaxResult()
                {
                    Result = Result.Success, Message = "操作成功"
                }));
            }
            return(View(PluginHelper.GetViewPath(this.GetType(), "Delete"), model));
        }
 public ActionResult Create(RegistrationAuthorityModel model)
 {
     if (ModelState.IsValid)
     {
         if (model.RegistrationAuthorityType.ToString().ToLower() == "f9dfd136-3c5d-e711-9354-0023248142a5" && model.ExecutiveStreet == null)
         {
             ModelState.AddModelError("ExecutiveStreet", "行政街道必填");
             return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
         }
         service.Add(Mapper.Map <RegistrationAuthorityModel, RegistrationAuthorityInfo>(model));
         return(Json(new AjaxResult()
         {
             Result = Result.Success, Message = "操作成功"
         }));
     }
     return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
 }
        public ActionResult Create()
        {
            var model = new RegistrationAuthorityModel();

            return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
        }