public ActionResult SaveOrgGroup(string groupIds, string orgid)
        {
            try
            {
                int count = groupLogic.GetSysOrgGroupCount(" and orgid='" + orgid + "'");
                if (count > 0)
                {
                    string json = JsonHelper.RtnJson("300", "此机构初始菜单已经维护!");
                    return(Json(json));
                }

                List <SysOrgGroupEntity> groupList = new List <SysOrgGroupEntity>();
                string[] list = groupIds.Split(',');

                for (int i = 0; i < list.Length; i++)
                {
                    if (list[i] != "")//报错角色模块集合
                    {
                        SysOrgGroupEntity group = new SysOrgGroupEntity();
                        group.OrgId   = orgid;
                        group.GroupID = list[i].Trim();
                        SysGroupEntity entity = groupLogic.Load(group.GroupID);
                        if (entity != null)
                        {
                            group.BeginDate   = DateTime.Now;
                            group.EndDate     = DateTime.Now;
                            group.ChargePrice = 0;
                            group.ChargeUrl   = "";
                            group.CreateDate  = DateTime.Now;
                            group.CreateUser  = "******";
                            group.UpdateDate  = DateTime.Now;
                            group.BeginDate   = DateTime.Now;
                            group.EndDate     = DateTime.Now.AddYears(1);
                            groupList.Add(group);
                        }
                    }
                }
                bool isOk = groupLogic.SaveSysOrgGroup(groupList);
                if (isOk == true)
                {
                    string json = JsonHelper.RtnJson("100", "维护成功!");
                    return(Json(json));
                }
                else
                {
                    string json = JsonHelper.RtnJson("200", "维护失败!");
                    return(Json(json));
                }
            }
            catch (Exception ex)
            {
                return(Json("no"));
            }
        }
Exemplo n.º 2
0
 public SysOrgGroupEntity LoadSysGroup(string orgid, string groupid)
 {
     try
     {
         SysOrgGroupEntity orgGroup = new SysOrgGroupEntity();
         orgGroup.OrgId   = orgid;
         orgGroup.GroupID = groupid;
         SysOrgGroupEntity orgInfo = QueryForObject <SysOrgGroupEntity>("SysOrgGroupMap.Load", orgGroup);
         return(orgInfo);
     }
     catch (Exception)
     {
         throw;
     }
 }