2015-10-26 21:58:12 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Web;
|
|
|
|
|
using System.Web.Mvc;
|
|
|
|
|
using Infrastructure;
|
|
|
|
|
using OpenAuth.App;
|
2015-10-29 23:51:10 +08:00
|
|
|
|
using OpenAuth.Domain;
|
2015-10-26 21:58:12 +08:00
|
|
|
|
|
|
|
|
|
namespace OpenAuth.Mvc.Controllers
|
|
|
|
|
{
|
|
|
|
|
public class OrgManagerController : BaseController
|
|
|
|
|
{
|
|
|
|
|
private OrgManagerApp _orgApp;
|
|
|
|
|
|
|
|
|
|
public OrgManagerController()
|
|
|
|
|
{
|
|
|
|
|
_orgApp = (OrgManagerApp) DependencyResolver.Current.GetService(typeof (OrgManagerApp));
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
// GET: /OrgManager/
|
|
|
|
|
public ActionResult Index()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public string LoadOrg()
|
|
|
|
|
{
|
2015-10-29 23:51:10 +08:00
|
|
|
|
return JsonHelper.Instance.Serialize(_orgApp.GetAll());
|
2015-10-26 21:58:12 +08:00
|
|
|
|
}
|
2015-10-28 22:49:59 +08:00
|
|
|
|
|
2015-10-29 23:51:10 +08:00
|
|
|
|
public string LoadChildren(int id)
|
2015-10-28 22:49:59 +08:00
|
|
|
|
{
|
2015-10-31 23:04:01 +08:00
|
|
|
|
return JsonHelper.Instance.Serialize(_orgApp.LoadAllChildren(id));
|
2015-10-28 22:49:59 +08:00
|
|
|
|
}
|
2015-10-29 23:51:10 +08:00
|
|
|
|
|
2015-10-30 23:14:31 +08:00
|
|
|
|
public void DelOrg(string json)
|
|
|
|
|
{
|
|
|
|
|
var delObj = JsonHelper.Instance.Deserialize<Org[]>(json);
|
|
|
|
|
foreach (var obj in delObj)
|
|
|
|
|
{
|
|
|
|
|
_orgApp.DelOrg(obj.Id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2015-10-26 21:58:12 +08:00
|
|
|
|
}
|
|
|
|
|
}
|