Пример #1
0
        /// <summary>
        /// 充值
        /// </summary>
        /// <param name="totalamount"></param>
        /// <param name="CompanyID"></param>
        /// <param name="resultMsg"></param>
        /// <returns></returns>
        public static int updatetotalamount(decimal totalamount, int CompanyID, int userid, ref string resultMsg)
        {
            if (userid <= 0)
            {
                resultMsg = "无效的操作员ID";
                return(-1);
            }
            UserInfo userinfo = UsersBLL.GetModel(userid);

            if (userinfo == null || userinfo.UserID != userid)
            {
                resultMsg = "无效的操作员ID";
                return(-1);
            }
            if (userinfo.UserType != Common.enumUserType.host.ToString() && userinfo.UserType != Common.enumUserType.admin.ToString())
            {
                resultMsg = "当前帐号不是管理员帐号";
                return(-1);
            }
            if (CompanyID <= 0)
            {
                resultMsg = "无效的代理商id";
                return(-1);
            }
            if (totalamount == 0)
            {
                resultMsg = "充值金额不能为0";
                return(-1);
            }
            if (totalamount > 100000)
            {
                resultMsg = "充值金额不能大于100000";
                return(-1);
            }
            if (totalamount < -100000)
            {
                resultMsg = "充值金额不能小于-100000";
                return(-1);
            }
            return(dal.updatetotalamount(totalamount, CompanyID, ref resultMsg));
        }
Пример #2
0
        public static int Update(int sellerid, string name, string address, string description
                                 , string ctype, string tel, string fax, string qq, string wx
                                 , string wxqrcode, string business
                                 , int curruserid
                                 , int category_id
                                 , bool islock
                                 , bool recommend
                                 , int orderby
                                 , int distid
                                 , string lng, string lat
                                 , ref string resultMsg)
        {
            if (curruserid <= 0)
            {
                resultMsg = "userid错误";
                return(-1);
            }
            if (sellerid <= 0)
            {
                resultMsg = "sellerid错误";
                return(-1);
            }
            if (name.Trim().Length == 0)
            {
                resultMsg = "商家名称不能为空";
                return(-1);
            }
            if (tel.Trim().Length == 0)
            {
                resultMsg = "商家电话不能为空";
                return(-1);
            }
            UserInfo userinfo = UsersBLL.GetModel(curruserid);

            if (userinfo == null || userinfo.UserID != curruserid)
            {
                resultMsg = "userid错误";
                return(-1);
            }
            if (userinfo.UserType != Common.enumUserType.admin.ToString() &&
                userinfo.UserType != Common.enumUserType.host.ToString() &&
                userinfo.UserType != Common.enumUserType.company.ToString())
            {
                resultMsg = "当前帐号不是系统管理员帐号";
                return(-1);
            }

            //memberInfo minfo = memberBLL.GetModel(uid);
            //minfo.mobile = "";
            //minfo.identitycard = "";
            //minfo.email = "";

            SellerInfo model = GetModel(sellerid);

            if (model == null || model.sellerid != sellerid)
            {
                resultMsg = "id error";
                return(-1);
            }
            model.islock      = islock;
            model.orderby     = orderby;
            model.recommend   = recommend;
            model.name        = name;
            model.address     = address;
            model.description = description;
            model.ctype       = ctype;
            model.tel         = tel;
            model.fax         = fax;
            model.qq          = qq;
            model.wx          = wx;
            model.wxqrcode    = wxqrcode;
            model.business    = business;
            model.category_id = category_id;
            model.distid      = distid;
            model.lng         = lng;
            model.lat         = lat;
            return(dal.UpdateTran(model, ref resultMsg));
        }
Пример #3
0
        /// <summary>
        /// 添加商家
        /// </summary>
        /// <param name="uname">帐号</param>
        /// <param name="password">明码</param>
        /// <param name="name">商家名称</param>
        /// <param name="address">地址</param>
        /// <param name="ctype">商家类型</param>
        /// <param name="companyid">所属代理商</param>
        /// <param name="tel">电话</param>
        /// <param name="fax">传真</param>
        /// <param name="qq">QQ</param>
        /// <param name="wx">微信公众号</param>
        /// <param name="wxqrcode">公众号二维码</param>
        /// <param name="business">主要经营范围</param>
        /// <param name="curruserid">添加人userid</param>
        /// <param name="resultMsg"></param>
        /// <returns></returns>
        public static int AddTran(string uname, string password, string name, string address, string description
                                  , string ctype, int companyid, string tel, string fax, string qq, string wx
                                  , string wxqrcode, string business
                                  , int curruserid
                                  , int category_id
                                  , bool islock
                                  , bool recommend
                                  , int orderby
                                  , int distid
                                  , string lng, string lat
                                  , ref string resultMsg)
        {
            if (curruserid <= 0)
            {
                resultMsg = "userid错误";
                return(-1);
            }
            UserInfo userinfo = UsersBLL.GetModel(curruserid);

            if (userinfo == null || userinfo.UserID != curruserid)
            {
                resultMsg = "userid错误";
                return(-1);
            }
            if (userinfo.UserType != Common.enumUserType.admin.ToString() &&
                userinfo.UserType != Common.enumUserType.host.ToString() &&
                userinfo.UserType != Common.enumUserType.site.ToString())
            {
                resultMsg = "只有系统管理员或者代理商管理员才可以操作";
                return(-1);
            }
            //if (distid.Trim().Length == 0)
            //{
            //    resultMsg = "distid错误!";
            //    return 0;
            //}
            //if (companyid <= 0)
            //{
            //    resultMsg = "请选择对应的代理商代理商";
            //    return -1;
            //}
            if (uname.Trim().Length < 3)
            {
                resultMsg = "帐号必须为3位以上的英文或数字";
                return(-1);
            }
            if (password.Trim().Length < 6)
            {
                resultMsg = "密码必须为6位以上";
                return(-1);
            }
            if (name.Trim().Length == 0)
            {
                resultMsg = "商家名称不能为空";
                return(-1);
            }
            if (tel.Trim().Length == 0)
            {
                resultMsg = "商家电话不能为空";
                return(-1);
            }
            //memberInfo minfo = new memberInfo();
            //minfo.companyid = companyid;
            //minfo.uname = uname;
            //minfo.password = Common.Utility.MD5Encrypt(password.Trim());
            //minfo.mobile = "";
            //minfo.identitycard = "";
            //minfo.email = "";
            //minfo.displayname = name;
            //minfo.addtime = DateTime.Now;
            //minfo.utype = (int)Common.enumutype.merchant;
            //minfo.address = "";
            //minfo.tel = tel;
            SellerInfo info = new SellerInfo();

            //info.uid = uid;
            info.uname       = uname;
            info.password    = Common.Utility.MD5Encrypt(password.Trim());
            info.name        = name;
            info.address     = address;
            info.description = description;
            info.ctype       = ctype;
            info.companyid   = companyid;
            info.tel         = tel;
            info.fax         = fax;
            info.qq          = qq;
            info.wx          = wx;
            info.wxqrcode    = wxqrcode;
            info.business    = business;
            info.category_id = category_id;
            info.distid      = distid;
            info.lng         = lng;
            info.lat         = lat;
            return(dal.AddTran(info, ref resultMsg));
        }