Exemple #1
0
        public STUserVP GetParam(UserModelsViewParam prm)
        {
            STUserVP ret = new STUserVP();
            string   msg;

            CCondition  clCondition  = new CCondition();
            CPermission clPermission = new CPermission();

            try
            {
                ret.strdata = null;

                if (prm.UserName != null)
                {
                    ret.maskusername = prm.UserName;
                    ret.strdata     += string.Format("<UserName={0}>", ret.maskusername);
                }
                if (prm.Permission != null)
                {
                    ret.permission = clPermission.GetId(prm.Permission);
                    ret.strdata   += string.Format("<Permission={0}>", prm.Permission);
                }
                if (prm.Condition != null)
                {
                    ret.condition = clCondition.GetId(prm.Condition);
                    ret.strdata  += string.Format("<Condition={0}>", prm.Condition);
                }

                if (prm.Email != null)
                {
                    ret.maskemail = prm.Email;
                    ret.strdata  += string.Format("<Email={0}>", ret.maskemail);
                }

                if (prm.Login != null)
                {
                    ret.masklogin = prm.Login;
                    ret.strdata  += string.Format("<Login={0}>", ret.masklogin);
                }
                if (prm.IsAll)
                {
                    ret.isall = true;
                }
                else
                {
                    ret.isall = false;
                }
            }
            catch (Exception ex) { msg = ex.Message; }
            return(ret);
        }
Exemple #2
0
        public UserModelsViewParam SetParam(STUserVP param)
        {
            UserModelsViewParam ret = new UserModelsViewParam();
            string msg;

            CCondition  clCondition  = new CCondition();
            CPermission clPermission = new CPermission();

            try
            {
                if (param.condition != null)
                {
                    ret.Condition = clCondition.GetName((int)param.condition);
                }
                else
                {
                    ret.Condition = null;
                }
                ret.Email = param.maskemail;
                ret.Login = param.masklogin;
                if (param.permission != null)
                {
                    ret.Permission = clPermission.GetName((int)param.permission);
                }
                else
                {
                    ret.Permission = null;
                }
                ret.UserName = param.maskusername;
                if (!param.isall)
                {
                    ret.IsAll = false;
                }
                else
                {
                    ret.IsAll = true;
                }
            }
            catch (Exception ex) { msg = ex.Message; }
            return(ret);
        }