Пример #1
0
        public string OrgLogin(string strJsonParam)
        {
            RequestModelString reqinfo = JsonStrObjConver.JsonStr2Obj(strJsonParam, typeof(RequestModelString))
                                         as RequestModelString;

            if (reqinfo == null)
            {
                return(ServerHlper.MakeInfoByStatus(false, ConstDefineWs.HttpParamError));
            }

            LoginNamePassModel mod = JsonStrObjConver.JsonStr2Obj(reqinfo.Info, typeof(LoginNamePassModel))
                                     as LoginNamePassModel;

            if (reqinfo == null)
            {
                return(ServerHlper.MakeInfoByStatus(false, ConstDefineWs.HttpParamError));
            }

            OrgLoginedUserModel userInfo = LoginBll.OrgLogin(mod.UserName, mod.Password);

            if (userInfo != null)
            {
                JsonResutlModelString result = new JsonResutlModelString()
                {
                    ErrorDesc = "success",
                    Info      = JsonStrObjConver.Obj2JsonStr(userInfo, typeof(OrgLoginedUserModel)),
                    Status    = true,
                    StatusInt = 1
                };

                return(JsonStrObjConver.Obj2JsonStr(result, typeof(JsonResutlModelString)));
            }
            return(ServerHlper.MakeInfoByStatus(false, ConstDefineWs.LoginNameOrPassword));
        }
Пример #2
0
        public string AddGroupUser(string strParams)
        {
            string             strError;
            RequestModelString reqinfo = ServerHlper.GetRequestModelString(System.Reflection.MethodBase.GetCurrentMethod().Name,
                                                                           strParams, out strError);

            if (reqinfo == null)
            {
                return(strError);
            }

            if (!LoginBll.CheckLoginId(reqinfo.TockId))
            {
                return(ServerHlper.MakeInfoByStatus(false, ConstDefineWs.LoginInfoError));
            }

            GroupUser mod = JsonStrObjConver.JsonStr2Obj(reqinfo.Info, typeof(GroupUser)) as GroupUser;

            if (mod == null)
            {
                return(ServerHlper.MakeInfoByStatus(false, ConstDefineWs.HttpParamError));
            }

            if (GroupUserBll.IsNameExist(mod.Name))
            {
                return(ServerHlper.MakeInfoByStatus(false, ConstDefineBll.NameExist));
            }
            bool result = GroupUserBll.AddUser(ref mod, out strError);

            return(ServerHlper.MakeInfoByStatus(result, strError));
        }
Пример #3
0
        public string AddSuperUser(string strParams)
        {
            string             strError;
            RequestModelString reqinfo = ServerHlper.GetRequestModelString(System.Reflection.MethodBase.GetCurrentMethod().Name,
                                                                           strParams, out strError);

            if (reqinfo == null)
            {
                return(strError);
            }

            SuperUser mod = JsonStrObjConver.JsonStr2Obj(reqinfo.Info, typeof(SuperUser))
                            as SuperUser;

            if (mod == null)
            {
                return(ServerHlper.MakeInfoByStatus(false, "需要添加的用户参数不对"));
            }

            if (SuperUserBll.IsUserNameExist(mod.Name))
            {
                return(ServerHlper.MakeInfoByStatus(false, "需要添加的用户名已经存在"));
            }
            bool result = SuperUserBll.AddUser(ref mod, out strError);

            return(ServerHlper.MakeInfoByStatus(result, strError));
        }
Пример #4
0
        public string Logout(string strJsonParam)
        {
            RequestModelString reqinfo = JsonStrObjConver.JsonStr2Obj(strJsonParam, typeof(RequestModelString))
                                         as RequestModelString;

            if (reqinfo == null)
            {
                return(ServerHlper.MakeInfoByStatus(false, ConstDefineWs.HttpParamError));
            }

            LoginBll.Logout(reqinfo.TockId);
            return(ServerHlper.MakeInfoByStatus(true, "success"));
        }
Пример #5
0
        public string UpdateLoginTimeByUuid(string strJsonParam)
        {
            RequestModelString reqinfo = JsonStrObjConver.JsonStr2Obj(strJsonParam, typeof(RequestModelString))
                                         as RequestModelString;

            if (reqinfo == null)
            {
                return(ServerHlper.MakeInfoByStatus(false, "刷新登录信息,参数不对"));
            }

            bool bRsult = true;

            LoginBll.UpdateLoginStatus(reqinfo.TockId);
            return(ServerHlper.MakeInfoByStatus(bRsult, bRsult.ToString()));
        }
Пример #6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="strFun">函数名</param>
        /// <param name="strJsonParam"></param>
        /// <param name="strErrorString"></param>
        /// <returns></returns>
        public static RequestModelString GetRequestModelString(string strFun, string strJsonParam,
                                                               out string strErrorString)
        {
            strErrorString = "";
            RequestModelString reqinfo = JsonStrObjConver.JsonStr2Obj(strJsonParam, typeof(RequestModelString))
                                         as RequestModelString;

            if (reqinfo == null)
            {
                strErrorString = MakeInfoByStatus(false,
                                                  string.Format("{0}_{1}", ConstDefineWs.WebMethodParamError, strFun));
                return(null);
            }

            if (!LoginUserEnableMgr.Get().IsLoginIdEnable(reqinfo.TockId))
            {
                strErrorString = MakeInfoByStatus(false,
                                                  string.Format("{0}_{1}", ConstDefineWs.LoginInfoError, strFun));
            }

            return(reqinfo);
        }
        public string AddProject(string strParams)
        {
            string             strError;
            RequestModelString reqinfo = ServerHlper.GetRequestModelString(System.Reflection.MethodBase.GetCurrentMethod().Name,
                                                                           strParams, out strError);

            if (reqinfo == null)
            {
                return(strError);
            }

            ProjectInfo mod = JsonStrObjConver.JsonStr2Obj(reqinfo.Info, typeof(ProjectInfo))
                              as ProjectInfo;

            if (mod == null)
            {
                return(ServerHlper.MakeInfoByStatus(false, ConstDefineWs.HttpParamError));
            }

            bool bResult = ProjectBll.AddAProject(ref mod, out strError);

            if (!bResult)
            {
                return(ServerHlper.MakeInfoByStatus(false, ConstDefineWs.LoginNameOrPassword));
            }

            // 成功返回成功标志及新增加的ID
            JsonResutlModelString result = new JsonResutlModelString()
            {
                ErrorDesc = "success",
                Info      = mod.Id.ToString(),
                Status    = true,
                StatusInt = 1
            };

            return(JsonStrObjConver.Obj2JsonStr(result, typeof(JsonResutlModelString)));
        }