public string GetAllCards(string strJsonParam)
        {
            string             strError;
            RequestModelString reqinfo = ServerHlper.GetRequestModelString(System.Reflection.MethodBase.GetCurrentMethod().Name,
                                                                           strJsonParam, out strError);

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

            List <GasCardWithCommInfo> lsts = CardWithCommDevBll.GetAllDevList();

            if (lsts == null)
            {
                return(ServerHlper.MakeInfoByStatus(false, ConstDefineWs.LoginNameOrPassword));
            }

            // 成功返回成功标志及新增加的ID
            JsonResutlModelString result = new JsonResutlModelString()
            {
                ErrorDesc = "success",
                Info      = JsonStrObjConver.Obj2JsonStr(lsts, typeof(List <GasCardWithCommInfo>)),
                Status    = true,
                StatusInt = 1
            };

            return(JsonStrObjConver.Obj2JsonStr(result, typeof(JsonResutlModelString)));
        }
        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));
        }
        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));
        }
        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));
        }
        public void GetAllProjectHtml()
        {
            string jsonCallBackFunName;
            string strJsonParam;

            ServerHlper.MakeHead(out jsonCallBackFunName, out strJsonParam);
            string strRet = GetAllProject(strJsonParam);

            ServerHlper.MakeResponse(jsonCallBackFunName, strRet);
        }
        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"));
        }
        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()));
        }
        public string DelADevById(string strJsonParam)
        {
            string             strError;
            RequestModelString reqinfo = ServerHlper.GetRequestModelString(System.Reflection.MethodBase.GetCurrentMethod().Name,
                                                                           strJsonParam, out strError);

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

            int id = 0;

            int.TryParse(reqinfo.Info, out id);

            if (id <= 0)
            {
                return(ServerHlper.MakeInfoByStatus(false, ConstDefineWs.HttpParamError));
            }

            bool bResult = CardWithCommDevBll.DelDev(id);

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

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

            return(JsonStrObjConver.Obj2JsonStr(result, typeof(JsonResutlModelString)));
        }
        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)));
        }