Ejemplo n.º 1
0
 public override bool OnActionExecuting(ActionContext context)
 {
     RoleBLL rolebll = new RoleBLL();
     UserBLL userbll = new UserBLL();
     string userid = userbll.GetCurrentUser().User.ID;
     var list = rolebll.GetUserSubUserIDs(userid);
     //MonitorCache.GetInstance().PushMessage(new CacheMessage { Message = "id:"+ userid + " count:" + list.Count.ToString() }, SOAFramework.Library.CacheEnum.FormMonitor);
     context.Parameters[Common.DataAuthorityKey] = list;
     return true;
 }
Ejemplo n.º 2
0
 public UserInitResultForm Init(FullUserQueryForm form)
 {
     var list = bll.Query(form);
     PagingEntity<FullUser> users = new PagingEntity<FullUser>
     {
         Record = list,
         PageCount = form.PageCount,
         RecordCount = form.RecordCount,
     };
     RoleBLL rolebll = new RoleBLL();
     var role = rolebll.Query(new RoleQueryForm { });
     UserInitResultForm resultform = new UserInitResultForm
     {
         User = users,
         Role = role,
     };
     return resultform;
 }
Ejemplo n.º 3
0
 private void button25_Click(object sender, EventArgs e)
 {
     Workflow wf = new Workflow();
     RoleBLL bll = new RoleBLL();
     bll.UpdateRole(new AddRoleServiceForm
     {
         Authority = new List<AuthorityNodeForCheck>
         {
             new AuthorityNodeForCheck
             {
                 ID = "1",
                 Checked = true,
             },
             new AuthorityNodeForCheck
             {
                 ID="2",
                 Checked = true,
             }
         },
         ID = "3",
     });
     var roles = bll.Query(new RoleQueryForm { ID = "3" });
 }
Ejemplo n.º 4
0
 private void button22_Click(object sender, EventArgs e)
 {
     Workflow wf = new Workflow();
     RoleBLL bll = new RoleBLL();
     bll.UpdateRole(new AddRoleServiceForm
     {
         ID = "be7c181f2e194a57bc66abcf1cd1e374",
     });
     var roles = bll.Query(new RoleQueryForm { ID = "be7c181f2e194a57bc66abcf1cd1e374" });
 }
Ejemplo n.º 5
0
 private void button21_Click(object sender, EventArgs e)
 {
     Workflow wf = new Workflow();
     //RoleBLL bll = new RoleBLL();
     //bll.AddRole(new AddRoleServiceForm
     //{
     //    Name = "testrole",
     //    ParentID = "2",
     //    CanManageEmployeeAndAuth = true,
     //    CanApply = true,
     //    CanManageAsset = true,
     //});
     //var roles = bll.Query(new RoleQueryForm { Name = "testrole" });
     RoleBLL rolebll = new RoleBLL();
     var roles = rolebll.Query(new RoleQueryForm { ID="14" }).ToList<Role>();
     Role_Module_ActionDao dao = new Role_Module_ActionDao();
     string actionID = "3";
     string moduleID = "4";
     Role_Module_ActionQueryForm query = new Role_Module_ActionQueryForm
     {
         ActionID = actionID,
         ModuleID = moduleID
     };
     var role_module_action = dao.Query(query);
     bool hasRight = false;
     foreach (var item in role_module_action)
     {
         if (roles != null && roles.Exists(t => t.ID == item.RoleID))
         {
             hasRight = true;
             break;
         }
     }
 }
Ejemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            //string dt = "{\"dt\":\"2010-01-01\"}";
            //string dt1 = "{\"2010-01-01\"}";
            //jsonTest t = JsonHelper.Deserialize<jsonTest>(dt);
            //var t1 = JsonHelper.Deserialize<DateTime?>(dt1);
            Workflow wf = new Workflow();
            RoleBLL rolebll = new RoleBLL();
            //AssetBLL assetbll = new AssetBLL();

            //var list = rolebll.GetUserSubUserIDs("13");
            //var roles = assetbll.Query(new AssetQueryForm
            //{
            //    Creators = list,
            //});
            //LogonRequest request = new LogonRequest();
            //request.form = new LogonServiceForm
            //{
            //    username = "******",
            //    password = "******",
            //};
            //var response = SDKFactory.Client.Execute(request);
            //token = response.form.token;
            //MessageBox.Show(response.ResponseBody);
            LogonBLL bll = new LogonBLL();
            var result = bll.Logon("admin", "123456");
            token = result.token;
        }
Ejemplo n.º 7
0
 private void button16_Click(object sender, EventArgs e)
 {
     Workflow workflow = new Workflow();
     RoleBLL rolebll = new RoleBLL();
     CustomerBLL customerbll = new CustomerBLL();
     List<string> ids = rolebll.GetUserSubUserIDs("13");
     CustomerQueryForm form = new CustomerQueryForm();
     form.Creators = ids;
     var list = customerbll.Query(form);
     PagingEntity<Customer> paggingList = new PagingEntity<Customer>();
     paggingList.Record = list;
     paggingList.PageCount = form.PageCount;
     paggingList.RecordCount = form.RecordCount;
 }
Ejemplo n.º 8
0
 private void button12_Click(object sender, EventArgs e)
 {
     //QueryMyApplyRequest request = new QueryMyApplyRequest();
     //request.token = token;
     //var response = SDKFactory.Client.Execute(request);
     //MessageBox.Show(response.ResponseBody);
     Workflow workflow = new Workflow();
     RoleBLL rolebll = new RoleBLL();
     ProjectBLL projectbll = new ProjectBLL();
     var list = rolebll.GetUserSubUserIDs("14");
     var data = projectbll.QueryMyApply(new QueryMyApplyServiceForm { Creators = list });
 }