Esempio n. 1
0
 public static string ClearClassMember(string UserGroup_Id)
 {
     try
     {
         string strSql            = string.Empty;
         int    inum              = 0;
         BLL_UserGroup_Member bll = new BLL_UserGroup_Member();
         inum = bll.ClearUserGroupMember(UserGroup_Id.Filter());
         if (inum > 0)
         {
             return(JsonConvert.SerializeObject(new
             {
                 msg = "操作成功:清除“" + inum + "”条",
                 err = "null"
             }));
         }
         else
         {
             return(JsonConvert.SerializeObject(new
             {
                 msg = "操作成功:清除“" + inum + "”条",
                 err = "0"
             }));
         }
     }
     catch (Exception ex)
     {
         return(JsonConvert.SerializeObject(new
         {
             msg = "操作失败:" + ex.Message.ToString(),
             err = "error",
         }));
     }
 }
Esempio n. 2
0
 public static string ClearSchoolMember(string UserGroup_Id)
 {
     UserGroup_Id = UserGroup_Id.Filter();
     try
     {
         string strSql = string.Empty;
         strSql = "select count(1) from UserGroup_Member where UserGroup_Id in(select USER_ID from UserGroup_Member where UserGroup_Id='" + UserGroup_Id + "' and MembershipEnum='grade')";
         if (Rc.Common.DBUtility.DbHelperSQL.GetSingle(strSql).ToString() != "0")
         {
             return(JsonConvert.SerializeObject(new
             {
                 msg = "操作失败:年级下存在数据,清空失败",
                 err = "error"
             }));
         }
         else
         {
             int inum = 0;
             BLL_UserGroup_Member bll = new BLL_UserGroup_Member();
             inum = bll.ClearUserGroupMember(UserGroup_Id.Filter());
             if (inum > 0)
             {
                 return(JsonConvert.SerializeObject(new
                 {
                     msg = "操作成功:清除“" + inum + "”条",
                     err = "null"
                 }));
             }
             else
             {
                 return(JsonConvert.SerializeObject(new
                 {
                     msg = "操作成功:清除“" + inum + "”条",
                     err = "0"
                 }));
             }
         }
     }
     catch (Exception ex)
     {
         return(JsonConvert.SerializeObject(new
         {
             msg = "操作失败:" + ex.Message.ToString(),
             err = "error"
         }));
     }
 }