Esempio n. 1
0
        private bool DoEdit()
        {
            int _id = MyCommFun.Str2Int(lblid.Text);
            //地区
            string prov = ddlProvince.SelectedItem.Value;
            string city = ddlCity.SelectedItem.Value;
            string dist = txtArea.Text.Trim();


            bool result = false;
            var managerService = new ManagerInfoService();
            var model = managerService.GetModel(_id);


            model.RealName = txtRealName.Text.Trim();
            model.Telephone = txtTelephone.Text.Trim();
            model.Email = txtEmail.Text.Trim();
            model.QQ = txtqq.Text;
            model.Email = txtEmail.Text;

            model.Province = prov;
            model.City = city;
            model.County = dist;


            if (managerService.Update(model))
            {
                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改个人资料:" + model.UserName); //记录日志
                result = true;
            }

            return result;
        }
Esempio n. 2
0
 /// <summary>
 /// 判断管理员是否已经登录(解决Session超时问题)
 /// </summary>
 public bool IsAdminLogin()
 {
     //如果Session为Null
     if (Session[SystemKeys.SESSION_ADMIN_INFO] != null)
     {
         return true;
     }
     else
     {
         //检查Cookies
         var adminname = Utils.GetCookie("AdminName", "WeiXinPF");
         var adminpwd = Utils.GetCookie("AdminPwd", "WeiXinPF");
         if (adminname != "" && adminpwd != "")
         {
             var service = new ManagerInfoService();
             var model = service.GetModel(adminname, adminpwd);
             if (model != null)
             {
                 Session[SystemKeys.SESSION_ADMIN_INFO] = model;
                 return true;
             }
         }
     }
     return false;
 }
        public void GetManagerInfo()
        {
            var managerService = new ManagerInfoService();
            var model = managerService.GetModel(1);

            Assert.IsTrue(true);
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            uid = MyCommFun.RequestInt("uid", 0);

            //添加,则需要判断可以添加的微信号数量
            if (uid == 0)
            {
                JscriptMsg("参数不正确!", "back", "Error");
                return;
            }
            if (IsChaoGuoWxNum())
            {
                JscriptMsg("该用户微账号的数量已满,无法添加!", "back", "Error");
                return;
            }
            if (!Page.IsPostBack)
            {
                ChkAdminLevel("wcodemgr", MXEnums.ActionEnum.View.ToString()); //检查权限
                txtEndData.Text = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd");
                var mBll = new ManagerInfoService();
                var user = mBll.GetModel(uid);
                lblUserName.Text = user.UserName + " " + user.RealName;

            }
        }
Esempio n. 5
0
 private void ShowInfo(int _id)
 {
     var bll = new ManagerInfoService();
     var model = bll.GetModel(_id);
    lblUserName.Text = model.UserName;
     
 }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
#if DEBUG
            var bll = new ManagerInfoService();
            var model = bll.GetModel("ht", "123456", true);
            if (model == null)
            {
                //msgtip.InnerHtml = "用户名或密码有误,请重试!";
                return;
            }
            Session[SystemKeys.SESSION_ADMIN_INFO] = model;
            Session.Timeout = 45;
#endif

            hotelid = this.GetHotelId();
            wid = 1;//this.GetWeiXinCode().id;
            confirmnumber.CausesValidation = true;
        }
Esempio n. 7
0
        private void ShowInfo(int _id)
        {
            lblid.Text = _id.ToString();

            var managerService = new ManagerInfoService();
            var model = managerService.GetModel(_id);

            lblUserName.Text = model.UserName;


            txtRealName.Text = model.RealName;
            txtTelephone.Text = model.Telephone;
            txtEmail.Text = model.Email;
            txtqq.Text = model.QQ;
            ddlProvince.SelectedValue = model.Province;
            ddlCity.SelectedValue = model.City;
            txtArea.Text = model.County;
           

        }
Esempio n. 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            bll = new AppInfoService();
            this.keywords = MXRequest.GetQueryString("keywords");
            this.uid = MyCommFun.RequestInt("id", 0);
            if (this.uid == 0)
            {
                JscriptMsg("传输参数不正确!", "back", "Error");
                return;
            }
            this.pageSize = GetPageSize(10); //每页数量
            if (!Page.IsPostBack)
            {
                var mBll = new ManagerInfoService();
                var user = mBll.GetModel(uid);
                lblUserName.Text = "[" + user.UserName + " " + user.RealName + "]";

                ChkAdminLevel("wcodemgr", MXEnums.ActionEnum.View.ToString()); //检查权限
                RptBind(CombSqlTxt(keywords), "wStatus desc, createDate desc");
            }
        }
Esempio n. 9
0
        private void ShowInfo(int _id)
        {
            litpwdtip.Text = "不填则不修改密码";
            var bll = new ManagerInfoService();
         
            var model = bll.GetModel(_id);

            ddlRoleId.SelectedValue = model.RoleId.ToString();
            if (model.IsLock == 0)
            {
                cbIsLock.Checked = true;
            }
            else
            {
                cbIsLock.Checked = false;
            }
            txtUserName.Text = model.UserName;
            txtUserName.ReadOnly = true;
            txtUserName.Attributes.Remove("ajaxurl");
           
            txtRealName.Text = model.RealName;
            txtTelephone.Text = model.Telephone;
            txtEmail.Text = model.Email;
            ddlMaxNum.SelectedValue = model.WxNum.ToString();
            hidOldMaxNum.Value = model.WxNum.ToString();
            ddlProvince.SelectedValue = model.Province;
            ddlCity.SelectedValue = model.City;
            txtArea.Text = model.County;
            txtqq.Text = model.QQ;
            txtEmail.Text = model.Email;
            txtSortid.Text = MyCommFun.ObjToStr(model.SortId);  // model.sort_id;
            txtRemark.Text = model.Remark;
           

          }
Esempio n. 10
0
        private bool DoEdit(int _id)
        {
            int oldMaxNum = MyCommFun.Str2Int(hidOldMaxNum.Value);
            int newMaxNum = MyCommFun.Str2Int(ddlMaxNum.SelectedItem.Value);
            int addNewNum = newMaxNum - oldMaxNum; //新增的帐号
         

            var adminEntity = GetAdminInfo(); //取得管理员信息
            var agent = new AgentInfo();
            bool isAgent = false;
            if (adminEntity.AgentLevel < 0)
            {
                return false;
            }
            if (adminEntity.AgentLevel > 0)
            {
                agent = aBll.GetAgentModel(adminEntity.Id);
                isAgent = true;
                if (agent.RemainMony < agent.AgentPrice * addNewNum)
                {
                    JscriptMsg("余额不足,请联系管理员充值!", "", "Error");
                    return false;
                }
            }
            

            //地区
            string prov = ddlProvince.SelectedItem.Value;
            string city = ddlCity.SelectedItem.Value;
            string dist = txtArea.Text.Trim();


            bool result = false;
            var bll = new ManagerInfoService();
            var model = bll.GetModel(_id);

            model.RoleId = int.Parse(ddlRoleId.SelectedValue);
            model.RoleType = new ManagerRoleService().GetModel(model.RoleId).RoleType;
            if (cbIsLock.Checked == true)
            {
                model.IsLock = 0;
            }
            else
            {
                model.IsLock = 1;
            }
            //判断密码是否更改
            if (txtPassword.Text.Trim() != "")
            {
                //获取用户已生成的salt作为密钥加密
                model.Password = DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.Salt);
            }
            model.RealName = txtRealName.Text.Trim();
            model.Telephone = txtTelephone.Text.Trim();
            model.Email = txtEmail.Text.Trim();
            model.WxNum = int.Parse(ddlMaxNum.SelectedItem.Value);

            model.QQ = txtqq.Text;
            model.Email = txtEmail.Text;
          
            model.Province = prov;
            model.City = city;
            model.County = dist;
            model.SortId = MyCommFun.Str2Int(txtSortid.Text);
            model.Remark = txtRemark.Text;
          
            bool updateRet = bll.Update(model);

            if (updateRet && isAgent && addNewNum > 0)
            {
                int xfjine = addNewNum * agent.AgentPrice.Value;//消费金额

                agent.RemainMony -= xfjine;
                agent.WcodeNum += newMaxNum;

                bool updateRet2 = aBll.Update(agent);
                if (updateRet2)
                {
                    var bBll = new WXManagerBillService(new ManagerBillRepository());
                    var bill = new ManagerBillInfo
                    {
                        BillMoney = xfjine,
                        ManagerId = agent.ManagerId,
                        OperPersonId = agent.ManagerId,
                        OperDate = DateTime.Now,
                        BillUsed = "原用户" + model.UserName + "新增了" + addNewNum + "个微帐号",
                        MoneyType = "扣减"
                    };
                    int addBillId = bBll.Add(bill);

                }
                else
                {
                    bll.Delete(_id);
                    updateRet=false;
                }
 
            }

            if (updateRet)
            {
                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改用户:" + model.UserName); //记录日志
                result = true;
            }

            return result;
        }
Esempio n. 11
0
        /// <summary>
        /// 获取订单状态
        /// </summary>
        /// <param name="order"></param>
        private void GetOrderStatusMsg(GetHotelOrderResponse order)
        {
            orderStatus = order.OrderStatus;
            //支付状态下默认退款金额为订单总额
            if (orderStatus == HotelStatusManager.OrderStatus.Payed.StatusId)
            {
                var result = GetPrice(order);

                txtAmount.Text = result.ToString();
                if (isAdmin)
                {
                    hidConfirmStr.Value = "确定执行【退款】操作吗?";

//                    WHEN 0 THEN ''未支付''
//                    WHEN 1 THEN ''已支付''
//                    WHEN 2 THEN ''已使用''
//                    WHEN 3 THEN ''申请退款''
//                    WHEN 4 THEN ''已退款''
                    if (_listCode != null && _listCode.Any(c => c.Status == 2))//订单中有验证码已使用
                    {
                        hidConfirmStr.Value = string.Format("{0},{1}", "订单中有验证码已使用", hidConfirmStr.Value);
                    }
                }
            }
            else if (orderStatus == HotelStatusManager.OrderStatus.Refunding.StatusId
                     || orderStatus == HotelStatusManager.OrderStatus.Refunded.StatusId)
            {
                var request = new GetRefundOrderRequest()
                {
                    OrderId = order.Id,
                    HotelId = order.HotelId
                };
                var response = BusHelper.Send<GetRefundOrderResponse>(request);
                RefundOrder = response.RefundOrder;
                if (RefundOrder != null && RefundOrder.OperateUser > 0)
                {
                    var managerInfoService = new ManagerInfoService();
                    var manager = managerInfoService.GetModel(RefundOrder.OperateUser);
                    
                    uName = manager.RealName;
                    var managerRoleService = new ManagerRoleService();
                    roleName = managerRoleService.GetTitle(manager.RoleId); 
                }
            }
        }
Esempio n. 12
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string userName = txtUserName.Value.Trim();
            string userPwd = txtPassword.Value.Trim();

            if (userName.Equals("") || userPwd.Equals(""))
            {
                msgtip.InnerHtml = "请输入用户名或密码";
                return;
            }
            if (Session["AdminLoginSun"] == null)
            {
                Session["AdminLoginSun"] = 1;
            }
            else
            {
                Session["AdminLoginSun"] = Convert.ToInt32(Session["AdminLoginSun"]) + 1;
            }
            //判断登录错误次数
            if (Session["AdminLoginSun"] != null && Convert.ToInt32(Session["AdminLoginSun"]) > 5)
            {
                msgtip.InnerHtml = "错误超过5次,关闭浏览器重新登录!";
                return;
            }

            var managerService = new ManagerInfoService();
            var model = managerService.GetModel(userName, userPwd, true);

            //BLL.manager bll = new BLL.manager();
            //Model.manager model = bll.GetModel(userName, userPwd, true);

            if (model == null)
            {
                msgtip.InnerHtml = "用户名或密码有误,请重试!";
                return;
            }
            Session[SystemKeys.SESSION_ADMIN_INFO] = model;
            Session.Timeout = 45;
            //写入登录日志
            //Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig();
            if (this.siteConfig.logstatus > 0)
            {
                new ManagerLogService().Add(model.Id, Session.SessionID, model.UserName, MXEnums.ActionEnum.Login.ToString(), "用户登录");
            }
            //写入Cookies
            Utils.WriteCookie("DTRememberName", model.UserName, 14400);
            //            if (chkRemember.Checked)
            //            {
            //                Utils.WriteCookie("DTRememberPwd", model.password, 14400);
            //            }

            Utils.WriteCookie("AdminName", "WeiXinPF", model.UserName);
            Utils.WriteCookie("AdminPwd", "WeiXinPF", model.Password);
            if (model.AgentLevel > 0)
            {
                //说明为代理商
                Response.Redirect("index.aspx");
            }
            else
            {
                //餐饮||酒店管理员
                if (IsShopAdmin(model.Id) || IsHotelAdmin(model.Id))
                {
                    Response.Redirect("index.aspx");
                }
                Response.Redirect("wxIndex.aspx");
            }
        }
Esempio n. 13
0
        private bool DoAdd()
        {
            string strErr = "";
            if (this.txtwxName.Text.Trim().Length == 0)
            {
                strErr += "公众帐号名称不能为空!";
            }
            if (this.txtwxId.Text.Trim().Length == 0)
            {
                strErr += "公众号原始id不能为空!";
            }

            if (this.txtweixinCode.Text.Trim().Length == 0)
            {
                strErr += "微信号不能为空!";
            }
            if (this.txtwxToken.Text.Trim().Length == 0)
            {
                strErr += "TOKEN值不能为空!";
            }
            if (this.txtEndData.Text.Trim().Length == 0)
            {
                strErr += "到期时间不能为空!";
            }

            if (strErr != "")
            {
                JscriptMsg(strErr, "back", "Error");

                return false;
            }

            var manager = GetAdminInfo();
            int uId = manager.Id;
            string wxName = this.txtwxName.Text;
            string wxId = this.txtwxId.Text;

            string weixinCode = this.txtweixinCode.Text;
            string wxPwd = "";
            string headerpic = this.txtImgUrl.Text;
            string apiurl = "";
            string wxToken = this.txtwxToken.Text;
            string wxProvince = "";
            string wxCity = "";
            string AppId = this.txtAppId.Text;
            string AppSecret = this.txtAppSecret.Text;
            DateTime createDate = DateTime.Now;
            DateTime endDate = MyCommFun.Obj2DateTime(txtEndData.Text);


            var model = new AppInfo
            {
                UId = this.uid,
                WxName = wxName,
                WxId = wxId,
                YixinId = "",
                WxCode = weixinCode,
                WxPwd = wxPwd,
                Headerpic = headerpic,
                Apiurl = apiurl,
                WxToken = wxToken,
                WxProvince = wxProvince,
                WxCity = wxCity,
                AppId = AppId,
                AppSecret = AppSecret,
                AccessToken = "",
                OpenIdStr = "",
                CreateDate = createDate,
                EndDate = endDate,
                WenziMaxNum = -1,
                TuwenMaxNum = -1,
                YuyinMaxNum = -1,
                WenziDefineNum = 0,
                TuwenDefineNum = 0,
                YuyinDefineNum = 0,
                RequestTtNum = 0,
                RequestUsedNum = 0,
                SmsTtNum = 0,
                SmsUsedNum = 0,
                IsDelete = false,
                WStatus = true,
                Remark = "",
                Seq = 99
            };

            //-1为无限制

            if (IsChaoGuoWxNum())
            {
                return false;
            }
            int wId = bll.Add(model);
            if (wId > 0)
            {
                Object obj = ConfigurationManager.AppSettings["industry_defaultAdd"];
                if (obj != null && obj.ToString() == "true")
                {
                    //为微账户添加行业默认模块
                    var mBll = new ManagerInfoService();
                    var idBll = new IndustryDefaultModuleService(new IndustryDefaultModuleRepository());
                    var user = mBll.GetModel(uid);
                    int roleid = user.RoleId;
                    idBll.addMouduleByRoleid(roleid, wId, new ArticleCategoryRepository(siteConfig.sysdatabaseprefix));
                }

                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加微信号,主键为:" + model.Id + ",微信号为:" + model.WxCode); //记录日志
                return true;
            }
            return false;
        }
Esempio n. 14
0
        /// <summary>
        ///  判断已经有的微信个数,若超过,则不能添加
        /// </summary>
        /// <returns>超过为true,未超过为false</returns>
        private bool IsChaoGuoWxNum()
        {
            var mBll = new ManagerInfoService();
            var manager = mBll.GetModel(this.uid);

            int hasNum = bll.GetUserWxNumCount(this.uid);
            if (hasNum >= manager.WxNum)
            {
                JscriptMsg("该用户只能添加" + manager.WxNum + "个微信公众帐号,若想添加多个,请联系管理员!", "weixin_list.aspx?id=" + uid, "Error");
                return true;
            }
            else
            {
                return false;
            }
        }