public string getPartsPower(UsersModel um)
    {
        string result = "";

        if (roleList == null)
        {
            roleList = new List<RolePowerModel>();
            IList<QueryModel> qmlist = new List<QueryModel>();
            string[] arr = um.RoleId.Split('|');
            string roleid = MakeUtil.SetSQLByIn(arr);
            qmlist.Add(MakeUtil.getQueryModel("RoleId", "'", SqlWhere.WhereOperator.In, roleid));
            roleList = bllRE.getDtlModelList(qmlist, -1);
        }

        if (roleList.Count > 0)
        {
            IList<string> PartsPower = new List<string>();
            PartsPower = roleList.Select(p => p.Modules).Distinct().ToList();
            result = string.Join(",", PartsPower.ToArray());
        }
        return result;
    }
예제 #2
0
 public bool update(SqlConnection cn, SqlTransaction tc, UsersModel Po)
 {
     return DbHelperSQL.updateModel<UsersModel>(Po, "Users", "UserID", Po.UserID, "'", cn, tc);
 }
 protected bool checkMAC(UsersModel um, string mac)
 {
     bool mACCheck = true;
     if (um.MACRestrict)
     {
         if (mac == "")
         {
             return false;
         }
         if (mac.Trim() != um.MAC1.Trim() && mac.Trim() != um.MAC2 && mac.Trim() != um.MAC3 && mac.Trim() != um.MAC4 &&
             mac.Trim() != um.MAC5)
         {
             mACCheck = false;
         }
     }
     return mACCheck;
 }
예제 #4
0
 public bool add(SqlConnection cn, SqlTransaction tc, UsersModel Po)
 {
     return DbHelperSQL.insertModel<UsersModel>(Po, "Users", cn, tc);
 }