Example #1
0
 public ActionResult Org_CommonEdit(OrgnizationEdit_M model)
 {
     try
     {
         var result = _orgnization.Update(model.ToModel());
         if (model.father_id == "0") //根节点
         {
             return(result
          ? Redirect("/QxJzxt/Org/OrgnizationList")
          : Alert("编辑失败"));
         }
         else
         {
             return(result
          ? Redirect("/QxJzxt/Org/Org_Common?Params=" + model.father_id)
          : Alert("编辑失败"));
         }
     }
     catch (FormValitationException ex)
     {
         FormValitation = ex;
         InitForm("编辑");
         var childOrg    = _orgnization.Find(model.orgnization_id);
         var fatherOrg   = _orgnization.Find(childOrg.father_id);
         var typeSelect  = _orgnization_type.ToSelectItems();
         var levelSelect = _organization_level.ToSelectItems();
         return(View(OrgnizationEdit_M.ToViewModel(childOrg, fatherOrg, typeSelect, levelSelect)));
     }
 }
Example #2
0
 public ActionResult Org_CommonEdit(string orgnization_id)
 {
     if (orgnization_id.HasValue())
     {
         InitForm("编辑");
         var childOrg    = _orgnization.Find(orgnization_id);
         var fatherOrg   = _orgnization.Find(childOrg.father_id);
         var typeSelect  = _orgnization_type.ToSelectItems();
         var levelSelect = _organization_level.ToSelectItems();
         return(View(OrgnizationEdit_M.ToViewModel(childOrg, fatherOrg, typeSelect, levelSelect)));
     }
     else
     {
         return(Alert("参数请求错误"));
     }
 }