Beispiel #1
0
        public string DeleteData2()
        {
            var responseData = new ResponseData();
            LoggingSessionInfo loggingSessionInfo = null;

            if (CurrentUserInfo != null)
            {
                loggingSessionInfo = CurrentUserInfo;
            }
            else
            {
                if (string.IsNullOrEmpty(Request("CustomerID")))
                {
                    responseData.success = false;
                    responseData.msg     = "缺少商户标识";
                    return(responseData.ToString());
                }
                else if (string.IsNullOrEmpty(Request("CustomerUserID")))
                {
                    responseData.success = false;
                    responseData.msg     = "缺少登陆员工的标识";
                    return(responseData.ToString());
                }
                else if (string.IsNullOrEmpty(Request("CustomerUserID")))
                {
                    responseData.success = false;
                    responseData.msg     = "缺少登陆员工的标识";
                    return(responseData.ToString());
                }
                else
                {
                    loggingSessionInfo = Default.GetBSLoggingSession(Request("CustomerID"), Request("CustomerUserID"));
                }
            }

            var service = new cUserService(loggingSessionInfo);//使用兼容模式

            string content = string.Empty;
            string error   = "";
            //   var responseData = new ResponseData();

            string key = string.Empty;

            if (FormatParamValue(Request("ids")) != null && FormatParamValue(Request("ids")) != string.Empty)
            {
                key = FormatParamValue(Request("ids")).ToString().Trim();
            }

            if (key == null || key.Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "ID不能为空";
                return(responseData.ToJSON());
            }


            string[] ids = key.Split(',');
            foreach (var id in ids)
            {
                //  service.SetUserStatus(key, status, CurrentUserInfo);
                service.physicalDeleteUser(id);
            }

            responseData.success = true;
            responseData.msg     = error;

            content = responseData.ToJSON();
            return(content);
        }