Ejemplo n.º 1
0
        private bool DoEdit(int _id)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();
            Model.wx_wq_chezhu  model  = bll.GetModel(_id);
            bool result = false;

            model.cpNum         = this.txtCpNum.Text;
            model.cxid          = MyCommFun.Str2Int(this.ddlChexi.SelectedItem.Value);
            model.cxingid       = MyCommFun.Str2Int(this.ddlChexing.SelectedItem.Value);
            model.gcdate        = MyCommFun.Obj2DateTime(this.txtGcTime.Text);
            model.Name          = this.txtName.Text;
            model.ppid          = MyCommFun.Str2Int(this.ddlPinpai.SelectedItem.Value);
            model.prevBxdate    = MyCommFun.Obj2DateTime(this.txtPrevBxdate.Text);
            model.prevBxmoney   = MyCommFun.Str2Decimal(this.txtPrevBxMoney.Text);
            model.prevBydate    = MyCommFun.Obj2DateTime(this.txtPrevByDate.Text);
            model.prevBylicheng = MyCommFun.Str2Decimal(this.txtPrevByLicheng.Text);
            model.prevBymoney   = MyCommFun.Str2Decimal(this.txtPrevByMoney.Text);
            model.prevNjdate    = MyCommFun.Obj2DateTime(this.txtPrevNjtime.Text);
            model.spdate        = MyCommFun.Obj2DateTime(this.txtSpTime.Text);
            model.teltephone    = this.txtTel.Text;
            model.sort_id       = MyCommFun.Str2Int(this.txtSort_id.Text);


            if (bll.Update(model))
            {
                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改车主id:" + model.Id); //记录日志
                result = true;
            }
            return(result);
        }
Ejemplo n.º 2
0
        private void ShowInfo(int _id)
        {
            BLL.wx_wq_pinpai    ppBll = new BLL.wx_wq_pinpai();
            BLL.wx_wq_chexi     cxBll = new BLL.wx_wq_chexi();
            Model.wx_wq_yyOrder model = bll.GetModel(_id);
            if (type == 1)//保养
            {
                this.pelShow.Visible = true;
                this.lblCarnum.Text  = model.carnum;
                this.lblKm.Text      = model.km.ToString();
            }
            else       //试驾
            {
                this.pelShow.Visible = false;
            }
            string pinpai = ppBll.GetModel(MyCommFun.Obj2Int(model.pid)).name;
            string chexi  = cxBll.GetModel(MyCommFun.Obj2Int(model.xid)).Name;

            this.lblObj.Text             = pinpai + "/" + chexi;
            this.lblremark.Text          = model.remark;
            this.lblTelephone.Text       = model.telephone.ToString();
            this.lblYYPerson.Text        = model.Name;
            this.lblYytime.Text          = MyCommFun.Obj2DateTime(model.yydate).ToString("yyyy-MM-dd") + "/" + model.yytime;
            this.lblXdtime.Text          = MyCommFun.Obj2DateTime(model.createdate).ToString("yyyy年MM月dd日 hh:mm:ss点");
            this.txtfSummary.InnerText   = model.kfremark;
            this.ddlStatus.SelectedValue = model.ddstatus;
        }
Ejemplo n.º 3
0
        void showInfo()
        {
            BLL.wx_wq_pinpai ppBll = new BLL.wx_wq_pinpai();

            BLL.wx_wq_chezhu           czBll  = new BLL.wx_wq_chezhu();
            IList <Model.wx_wq_chezhu> czList = czBll.GetModelList(" openid='" + openid + "'");

            if (czList.Count > 0)
            {
                czModel = czList[0];
            }
            else
            {
                czModel = new Model.wx_wq_chezhu();
            }
            this.rptPinpai.DataSource = ppBll.GetModelList("wid=" + wid);
            this.rptPinpai.DataBind();
            if (czModel.gcdate != null)
            {
                gcdate = MyCommFun.Obj2DateTime(czModel.gcdate).ToString("yyyy-MM-dd");
            }
            else
            {
                gcdate = DateTime.Now.ToString("yyyy-MM-dd");
            }

            if (czModel.spdate != null)
            {
                spdate = MyCommFun.Obj2DateTime(czModel.spdate).ToString("yyyy-MM-dd");
            }
            else
            {
                spdate = DateTime.Now.ToString("yyyy-MM-dd");
            }
        }
Ejemplo n.º 4
0
        private bool DoAdd()
        {
            bool result = false;

            Model.wx_my_tijian  model  = new Model.wx_my_tijian();
            Model.manager       mModel = GetAdminInfo();
            Model.wx_userweixin uModel = GetWeiXinCode();
            model.adminname = mModel.user_name;
            model.wid       = uModel.id;
            DateTime tjDate = MyCommFun.Obj2DateTime(this.txtDate.Text);

            model.tijianluru    = DateTime.Now;
            model.tijiandate    = tjDate;
            model.tijianmonth   = MyCommFun.Str2Int(tjDate.ToString("MM"));
            model.tijiandetails = this.txtDetail.Text;
            model.tijianfu      = MyCommFun.Str2Decimal(this.txtFu.Text);
            model.tijiangao     = MyCommFun.Str2Decimal(this.txtGao.Text);
            model.tijianzhong   = MyCommFun.Str2Decimal(this.txtZhong.Text);
            model.tijianxiong   = MyCommFun.Str2Decimal(this.txtXiong.Text);
            model.tijiantou     = MyCommFun.Str2Decimal(this.txtTou.Text);
            model.userid        = uid;
            if (bll.Add(model) > 0)
            {
                result = true;
            }
            return(result);
        }
Ejemplo n.º 5
0
        private void ShowInfo(int id)
        {
            hidid.Value = id.ToString();
            Model.wx_ucard_users user = uBll.GetModel(id);
            txtrealName.Text = user.realName;
            lblcardNo.Text   = user.cardNo;
            lblopenid.Text   = user.openid;
            //等级
            BLL.wx_ucard_udegree           degreeBll  = new wx_ucard_udegree();
            IList <Model.wx_ucard_udegree> degreelist = degreeBll.GetModelList("sid=" + sid);

            int    degreeNum = 0;
            string jibie     = "";

            jibie = BLL.wx_ucard_fun.userDegree(id, MyCommFun.Obj2Int(user.ttScore), jibie, out degreeNum);

            lblDegree.Text = jibie;

            rblSex.SelectedValue = user.sex == null ? "3" : user.sex.Value.ToString();
            txtwxName.Text       = user.wxName;
            txtage.Text          = user.age == null?"0":user.age.ToString();
            txtttScore.Text      = MyCommFun.ObjToStr(user.ttScore);
            txtqdScore.Text      = MyCommFun.ObjToStr(user.qdScore);
            txtconsumeScore.Text = MyCommFun.ObjToStr(user.consumeScore);
            txtconsumeMoney.Text = MyCommFun.ObjToStr(user.consumeMoney);
            txtregTime.Text      = MyCommFun.Obj2DateTime(user.regTime).ToString("yyyy-MM-dd HH:mm:ss");
            txtendDate.Text      = MyCommFun.Obj2DateTime(user.endDate).ToString("yyyy-MM-dd HH:mm:ss");
            txtmobile.Text       = MyCommFun.ObjToStr(user.mobile);
            txtaddr.Text         = MyCommFun.ObjToStr(user.addr);
        }
Ejemplo n.º 6
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            int id = MyCommFun.Str2Int(hidid.Value);

            #region  //先判断
            string strErr = "";
            if (this.txtgName.Text.Trim().Length == 0)
            {
                strErr += "名称不能为空!";
            }
            if (this.txtscore.Text.Trim().Length == 0)
            {
                strErr += "积分不能为空,并且为整数!";
            }

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


            #endregion
            Model.wx_ucard_gift gift = new Model.wx_ucard_gift();

            if (id > 0)
            {
                gift = gBll.GetModel(id);
            }

            gift.gName      = txtgName.Text.Trim();
            gift.useContent = txtuseContent.Value.Trim();
            gift.sId        = sid;
            gift.beginDate  = MyCommFun.Obj2DateTime(txtbeginDate.Text);
            gift.endDate    = MyCommFun.Obj2DateTime(txtendDate.Text);
            gift.score      = MyCommFun.Str2Int(txtscore.Text.Trim());
            if (id <= 0)
            {                                                                  //新增
                ChkAdminLevel("ucard_lpq", MXEnums.ActionEnum.Add.ToString()); //检查权限

                //1新增主表
                id = gBll.Add(gift);
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加会员商家礼品券,主键为" + id); //记录日志
                JscriptMsg("添加会员商家礼品券成功!", "gift_list.aspx?id=" + sid, "Success");
            }
            else
            {                                                                   //修改
                ChkAdminLevel("ucard_lpq", MXEnums.ActionEnum.Edit.ToString()); //检查权限

                //1修改主表
                gBll.Update(gift);
                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改会员商家礼品券,主键为" + id); //记录日志
                JscriptMsg("修改会员商家礼品券成功!", "gift_list.aspx?id=" + sid, "Success");
            }
        }
Ejemplo n.º 7
0
        private void RptBind(string _strWhere, string _orderby)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();

            //判断是否已经设置了微留言基本信息
            BLL.wx_sjb_bisai  sbll   = new BLL.wx_sjb_bisai();
            BLL.wx_sjb_qiudui qdBll  = new BLL.wx_sjb_qiudui();
            string            qdName = "";

            _strWhere        = "rcId=" + richengid + " " + _strWhere;
            this.page        = MXRequest.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;
            DataSet ds = gbll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);

            // DataSet ds = gbll.GetList( _strWhere);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataRow  dr;
                DateTime begin = new DateTime();
                DateTime end   = new DateTime();
                int      count = ds.Tables[0].Rows.Count;
                for (int i = 0; i < count; i++)
                {
                    dr = ds.Tables[0].Rows[i];

                    dr["qd1Name"] = qdBll.GetQuiDuiName(MyCommFun.Obj2Int(dr["qd1Id"]));
                    dr["qd2Name"] = qdBll.GetQuiDuiName(MyCommFun.Obj2Int(dr["qd2Id"]));

                    begin = MyCommFun.Obj2DateTime(dr["beginDate"]);
                    end   = MyCommFun.Obj2DateTime(dr["endDate"]);
                    if (begin > DateTime.Now)
                    {
                        dr["status_s"] = "<span class=\"act_before\">未开始</span>";
                    }
                    else if (end <= DateTime.Now)
                    {
                        dr["status_s"] = "<span class=\"act_end\">已结束</span>";
                    }
                    else
                    {
                        dr["status_s"] = "<span class=\"act_in\">进行中</span>";
                    }
                }
                ds.AcceptChanges();
            }
            this.rptList.DataSource = ds;
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("bisai_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Ejemplo n.º 8
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            int id = MyCommFun.Str2Int(hidid.Value);

            #region  //先判断
            string strErr = "";
            if (this.txtrealName.Text.Trim().Length == 0)
            {
                strErr += "姓名不能为空!";
            }

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

            #endregion
            Model.wx_ucard_users user = new Model.wx_ucard_users();

            if (id > 0)
            {
                user = uBll.GetModel(id);
            }

            user.realName     = txtrealName.Text.Trim();
            user.sex          = MyCommFun.Str2Int(rblSex.SelectedItem.Value);
            user.wxName       = txtwxName.Text;
            user.age          = MyCommFun.Str2Int(txtage.Text);
            user.ttScore      = MyCommFun.Str2Int(txtttScore.Text);
            user.qdScore      = MyCommFun.Str2Int(txtqdScore.Text);
            user.consumeScore = MyCommFun.Str2Int(txtconsumeScore.Text);
            user.consumeMoney = MyCommFun.Str2Decimal(txtconsumeMoney.Text);
            user.regTime      = MyCommFun.Obj2DateTime(txtregTime.Text);
            user.endDate      = MyCommFun.Obj2DateTime(txtendDate.Text);
            user.mobile       = txtmobile.Text;
            user.addr         = txtaddr.Text;

            if (id <= 0)
            {  //新增
                ////1新增主表
                //id = uBll.Add(user);
                //AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加会员,主键为" + id); //记录日志
                //JscriptMsg("添加会员成功!", "gift_list.aspx?id=" + sid, "Success");
            }
            else
            {   //修改
                //1修改主表
                uBll.Update(user);
                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改会员卡--会员信息,主键为" + id); //记录日志
                JscriptMsg("修改会员卡--会员信息成功!", "user_list.aspx?id=" + sid, "Success");
            }
        }
Ejemplo n.º 9
0
        private void RptBind(string _strWhere, string _orderby)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();
            _strWhere        = "wId=" + weixin.id + " " + _strWhere;
            this.page        = MXRequest.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;
            DataSet ds = gbll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataRow  dr;
                DateTime begin = new DateTime();
                DateTime end   = new DateTime();
                int      count = ds.Tables[0].Rows.Count;
                var      table = ds.Tables[0];
                table.Columns.Add("couponUrl");
                for (int i = 0; i < count; i++)
                {
                    dr    = table.Rows[i];
                    begin = MyCommFun.Obj2DateTime(dr["beginDate"]);
                    end   = MyCommFun.Obj2DateTime(dr["endDate"]);
                    if (begin > DateTime.Now)
                    {
                        dr["status_s"] = "<span class=\"act_before\">未开始</span>";
                    }
                    else if (end <= DateTime.Now)
                    {
                        dr["status_s"] = "<span class=\"act_end\">已结束</span>";
                    }
                    else
                    {
                        dr["status_s"] = "<span class=\"act_in\">进行中</span>";
                    }
                    dr["url"] = MyCommFun.getWebSite() + "/weixin/shakeLuckyMoney/shakeLuckyMoney.html?wid=" + dr["wid"].ToString() + "&aid=" + dr["id"].ToString();

                    dr["couponUrl"] = MyCommFun.getWebSite() + "/weixin/coupons/MyCoupons.html?wid=" + dr["wid"].ToString() + "&aid=" + dr["id"].ToString();
                }
                ds.AcceptChanges();
            }
            this.rptList.DataSource = ds;
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("luckyMoneylist.aspx", "keywords={0}&page={1}", this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Ejemplo n.º 10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     id  = MyCommFun.RequestInt("id");
     fid = MyCommFun.RequestInt("fid");
     if (!IsPostBack)
     {
         DataRow dr = yiBll.GetList("id=" + id).Tables[0].Rows[0];
         lblObj.Text                  = dr["hxname"].ToString();
         lblPerson.Text               = dr["name"].ToString();
         lblRemark.Text               = dr["remark"].ToString();
         lblTelephone.Text            = dr["telephone"].ToString();
         lblxddate.Text               = MyCommFun.Obj2DateTime(dr["createdate"]).ToString("yyyy年MM月dd日 hh:mm:ss点");
         lblyydate.Text               = MyCommFun.Obj2DateTime(dr["yydate"]).ToString("yyyy-MM-dd") + " / " + dr["yydatepart"].ToString();
         this.ddlStatus.SelectedValue = dr["orderStatus"].ToString();
         this.txtkfremark.Text        = dr["kfRemark"].ToString();
     }
 }
Ejemplo n.º 11
0
 public PhotoService()
 {
     Mapper.CreateMap <photoActionInfo, photoActionDTO>().ForMember(
         dest => dest.beginDate,
         opt => opt.ResolveUsing(src => src.beginDate.ToString("yyyy-MM-dd HH:mm:ss"))
         )
     .ForMember(dest => dest.endDate,
                opt => opt.ResolveUsing(src => src.endDate.ToString("yyyy-MM-dd HH:mm:ss"))
                ).ForMember(dest => dest.createTime,
                            opt => opt.ResolveUsing(src => src.createTime.ToString("yyyy-MM-dd HH:mm:ss"))
                            );
     Mapper.CreateMap <photoActionDTO, photoActionInfo>().ForMember(
         dest => dest.beginDate,
         opt => opt.ResolveUsing(src => MyCommFun.Obj2DateTime(src.beginDate))
         )
     .ForMember(dest => dest.endDate,
                opt => opt.ResolveUsing(src => MyCommFun.Obj2DateTime(src.endDate))
                ).ForMember(x => x.createTime, opt => opt.Ignore());
 }
Ejemplo n.º 12
0
        private void RptBind(string _strWhere, string _orderby)
        {
            Model.manager model = GetAdminInfo(); //取得当前管理员信息
            _strWhere        = "isDelete=0 " + _strWhere;
            this.page        = MXRequest.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;

            Model.manager adminEntity = GetAdminInfo(); //取得当前管理员信息
            _strWhere += " and (agentId=" + adminEntity.id + " or uId=" + adminEntity.id + " )";

            DataSet ds = bll.GetUserWeiXinList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataRow dr;
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    dr = ds.Tables[0].Rows[i];
                    DateTime endDate = MyCommFun.Obj2DateTime(dr["endDate"]);
                    if (endDate < DateTime.Now)
                    {
                        dr["daoqistr"] = "<span class='guoqi'>" + endDate.ToString("yyyy-MM-dd") + "[已过期]</span>";
                    }
                    else if (endDate < DateTime.Now.AddDays(20))
                    {
                        dr["daoqistr"] = "<span class='kuaidaoqi'>" + endDate.ToString("yyyy-MM-dd") + "[需尽快充值]</span>";
                    }
                    else
                    {
                        dr["daoqistr"] = "<span class='weiguoqi'>" + endDate.ToString("yyyy-MM-dd") + "</span>";
                    }
                }
            }

            this.rptList.DataSource = ds;
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("wxcodemgr.aspx", "keywords={0}&page={1}", this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Ejemplo n.º 13
0
    private void RptBind(string _strWhere, string _orderby)
    {
        this.page        = DTRequest.GetQueryInt("page", 1);
        txtKeywords.Text = this.keywords;
        DataSet ds = gbll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);

        if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
        {
            DataRow  dr;
            DateTime begin = new DateTime();
            DateTime end   = new DateTime();
            int      count = ds.Tables[0].Rows.Count;
            for (int i = 0; i < count; i++)
            {
                dr    = ds.Tables[0].Rows[i];
                begin = MyCommFun.Obj2DateTime(dr["beginDate"]);
                end   = MyCommFun.Obj2DateTime(dr["endDate"]);
                if (begin > DateTime.Now)
                {
                    dr["status_s"] = "<span class=\"act_before\">未开始</span>";
                }
                else if (end <= DateTime.Now)
                {
                    dr["status_s"] = "<span class=\"act_end\">已结束</span>";
                }
                else
                {
                    dr["status_s"] = "<span class=\"act_in\">进行中</span>";
                }
                dr["url"] = MyCommFun.getWebSite() + "/shop/dzp/index.aspx?aid=" + dr["id"].ToString();
            }
            ds.AcceptChanges();
        }
        this.rptList.DataSource = ds;
        this.rptList.DataBind();

        //绑定页码
        txtPageNum.Text = this.pageSize.ToString();
        string pageUrl = Utils.CombUrlTxt("dzplist.aspx", "keywords={0}&page={1}", this.keywords, "__id__");

        PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
Ejemplo n.º 14
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            Model.wx_my_tijian model  = bll.GetModel(_id);
            DateTime           tjDate = MyCommFun.Obj2DateTime(this.txtDate.Text);

            model.tijiandate    = tjDate;
            model.tijianmonth   = MyCommFun.Str2Int(tjDate.ToString("MM"));
            model.tijiandetails = this.txtDetail.Text;
            model.tijianfu      = MyCommFun.Str2Decimal(this.txtFu.Text);
            model.tijiangao     = MyCommFun.Str2Decimal(this.txtGao.Text);
            model.tijianzhong   = MyCommFun.Str2Decimal(this.txtZhong.Text);
            model.tijianxiong   = MyCommFun.Str2Decimal(this.txtXiong.Text);
            model.tijiantou     = MyCommFun.Str2Decimal(this.txtTou.Text);

            if (bll.Update(model))
            {
                result = true;
            }
            return(result);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 获得投票信息
        /// </summary>
        /// <param name="wid"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Model.wx_vote_base GetVoteBaseByWid(int wid, int id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select top 1");
            strSql.Append(" * ");
            strSql.Append(" from wx_vote_base  where   id=@id  and wId=@wId");
            SqlParameter[] parameters =
            {
                new SqlParameter("@id",  SqlDbType.Int, 4),
                new SqlParameter("@wId", SqlDbType.Int, 4)
            };
            parameters[0].Value = id;
            parameters[1].Value = wid;
            SqlDataReader sr = DbHelperSQL.ExecuteReader(strSql.ToString(), parameters);

            Model.wx_vote_base category = new Model.wx_vote_base();
            while (sr.Read())
            {
                category                = new Model.wx_vote_base();
                category.id             = MyCommFun.Obj2Int(sr["id"]);
                category.title          = MyCommFun.ObjToStr(sr["title"]);
                category.votepic        = MyCommFun.ObjToStr(sr["votepic"]);
                category.picdisplay     = MyCommFun.ObjBool(sr["picdisplay"]);
                category.votecontent    = MyCommFun.ObjToStr(sr["votecontent"]);
                category.isRadio        = MyCommFun.ObjBool(sr["isRadio"]);
                category.beginTime      = MyCommFun.Obj2DateTime(sr["beginTime"]);
                category.endTime        = MyCommFun.Obj2DateTime(sr["endTime"]);
                category.resultShowtype = MyCommFun.Obj2Int(sr["resultShowtype"]);
                category.actUrl         = MyCommFun.ObjToStr(sr["actUrl"]);
                category.voteType       = MyCommFun.Obj2Int(sr["voteType"]);
                category.sort_id        = MyCommFun.Obj2Int(sr["sort_id"]);
                category.creatDate      = MyCommFun.Obj2DateTime(sr["creatDate"]);
            }
            sr.Close();

            return(category);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 取购物车里的商品信息
        /// </summary>
        /// <param name="openid"></param>
        /// <param name="wid"></param>
        /// <returns></returns>
        public List <Model.cartProduct> GetCartList(string openid, int wid)
        {
            DataSet ds = dal.GetCartList(openid, wid);
            List <Model.cartProduct> cartlist = new List <cartProduct>();

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                int count = ds.Tables[0].Rows.Count;
                Model.cartProduct cproduct = new cartProduct();
                DataRow           dr;
                for (int i = 0; i < count; i++)
                {
                    dr                   = ds.Tables[0].Rows[i];
                    cproduct             = new cartProduct();
                    cproduct.id          = MyCommFun.Obj2Int(dr["id"]);
                    cproduct.openid      = MyCommFun.ObjToStr(dr["openid"]);
                    cproduct.productId   = MyCommFun.Obj2Int(dr["productId"]);
                    cproduct.productName = MyCommFun.ObjToStr(dr["productName"]);
                    cproduct.productNum  = MyCommFun.Obj2Int(dr["productNum"]);
                    cproduct.productPic  = MyCommFun.ObjToStr(dr["pic"]);
                    cproduct.skuId       = MyCommFun.Obj2Int(dr["skuId"]);
                    cproduct.skuInfo     = MyCommFun.ObjToStr(dr["skuInfo"]);
                    cproduct.totPrice    = MyCommFun.Str2Decimal(dr["totPrice"].ToString());
                    cproduct.totPrice100 = cproduct.totPrice * 100;
                    cproduct.avgPrice    = MyCommFun.decimalF2(cproduct.totPrice / (cproduct.productNum == 0?1:cproduct.productNum));
                    cproduct.avgPrice100 = cproduct.avgPrice * 100;
                    cproduct.createDate  = MyCommFun.Obj2DateTime(dr["createDate"]);
                    cproduct.wid         = MyCommFun.Obj2Int(dr["wid"]);
                    cproduct.stock       = MyCommFun.Obj2Int(dr["stock"]);
                    cproduct.productUrl  = "/shop/detail.aspx?wid=" + cproduct.wid + "&pid=" + cproduct.productId + "&openid=" + cproduct.openid;
                    cproduct.seq         = i;
                    cartlist.Add(cproduct);
                }
            }

            return(cartlist);
        }
Ejemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            shopid = MyCommFun.RequestInt("shopid");
            if (!Page.IsPostBack)
            {
                openid = MyCommFun.QueryString("openid");


                //获取所有商家
                DataSet dr = shopBll.GetList();

                if (dr.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < dr.Tables[0].Rows.Count; i++)
                    {
                        shangjia += "<li class=\"dandanb\"><a href=\"caidan_guanyu.aspx?shopid=" + dr.Tables[0].Rows[i]["id"].ToString() + "&openid=" + openid + "\"><span class=\"none shangjia\">";
                        shangjia += "<img src=\"" + dr.Tables[0].Rows[i]["hotelLogo"].ToString() + "\" /><h2>" + dr.Tables[0].Rows[i]["hotelName"].ToString() + "</h2>";
                        shangjia += "<p>区域:" + dr.Tables[0].Rows[i]["sendArea"].ToString() + "</p><p>起送价:¥" + dr.Tables[0].Rows[i]["sendPrice"].ToString() + "</p>";



                        int stats = 0;

                        if (string.Compare(MyCommFun.Obj2DateTime(dr.Tables[0].Rows[i]["hoteltimeEnd"]).ToString("HH:mm"), DateTime.Now.ToShortTimeString().ToString()) < 0 || string.Compare(MyCommFun.Obj2DateTime(dr.Tables[0].Rows[i]["hoteltimeBegin"]).ToString("HH:mm"), DateTime.Now.ToShortTimeString().ToString()) > 0)
                        {
                        }
                        else
                        {
                            stats += 1;
                        }

                        if (dr.Tables[0].Rows[i]["hoteltimeEnd1"].ToString() != null && dr.Tables[0].Rows[i]["hoteltimeBegin1"].ToString() != null)
                        {
                            if (string.Compare(MyCommFun.Obj2DateTime(dr.Tables[0].Rows[i]["hoteltimeEnd1"]).ToString("HH:mm"), DateTime.Now.ToShortTimeString().ToString()) < 0 || string.Compare((MyCommFun.Obj2DateTime(dr.Tables[0].Rows[i]["hoteltimeBegin1"]).ToString("HH:mm")), DateTime.Now.ToShortTimeString().ToString()) > 0)
                            {
                            }
                            else
                            {
                                stats += 1;
                            }
                        }

                        if (dr.Tables[0].Rows[i]["hoteltimeEnd2"].ToString() != null && dr.Tables[0].Rows[i]["hoteltimeBegin2"].ToString() != null)
                        {
                            if (string.Compare((MyCommFun.Obj2DateTime(dr.Tables[0].Rows[i]["hoteltimeEnd2"]).ToString("HH:mm")), DateTime.Now.ToShortTimeString().ToString()) < 0 || string.Compare((MyCommFun.Obj2DateTime(dr.Tables[0].Rows[i]["hoteltimeBegin2"]).ToString("HH:mm")), DateTime.Now.ToShortTimeString().ToString()) > 0)
                            {
                            }
                            else
                            {
                                stats += 1;
                            }
                        }



                        if (stats > 0)
                        {
                            shangjia += "<em class=\"ok\">营业中</em><div class=\"clr\"></div></span></a></li>";
                        }
                        else
                        {
                            shangjia += "<em class=\"no\">未营业</em><div class=\"clr\"></div></span></a></li>";
                        }
                    }
                }



                #region
                DataSet drs = picbll.GetList(shopid);
                if (drs.Tables[0].Rows.Count > 0)
                {
                    int j = 0;
                    for (int i = 0; i < drs.Tables[0].Rows.Count; i++)
                    {
                        image += "<li><p>" + drs.Tables[0].Rows[i]["advertisementName"] + "</p><a href=" + drs.Tables[0].Rows[i]["websetUrl"] + " > <img src=" + drs.Tables[0].Rows[i]["picUrl"] + "></a></li>";
                        j     += 1;
                        if (i == 1)
                        {
                            active += " <li   class=\"active\"  >" + j + "</li>";
                        }
                        else
                        {
                            active += " <li   >" + j + "</li>";
                        }
                    }
                }
                #endregion
            }
        }
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();
            int id = MyCommFun.Str2Int(hidid.Value);

            #region  //先判断
            string strErr = "";
            if (this.txtnName.Text.Trim().Length == 0)
            {
                strErr += "特权名称不能为空!";
            }
            if (this.txtusedContent.Value.Trim().Length == 0)
            {
                strErr += "使用说明的内容不能为空!";
            }

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

            #endregion
            Model.wx_ucard_privileges privileges = new Model.wx_ucard_privileges();

            if (id > 0)
            {
                privileges = pBll.GetModel(id);
            }

            privileges.pName       = txtnName.Text.Trim();
            privileges.usedContent = txtusedContent.Value.Trim();
            privileges.sId         = sid;
            privileges.beginDate   = MyCommFun.Obj2DateTime(txtbeginDate.Text);
            privileges.endDate     = MyCommFun.Obj2DateTime(txtendDate.Text);

            string action_type_str = string.Empty;
            if (cbluserDegree.Items[0].Selected)
            {
                privileges.userDegree = cbluserDegree.Items[0].Value;
            }
            else
            {
                action_type_str = ",";
                for (int i = 0; i < cbluserDegree.Items.Count; i++)
                {
                    if (cbluserDegree.Items[i].Selected)
                    {
                        action_type_str += cbluserDegree.Items[i].Value + ",";
                    }
                }
                privileges.userDegree = action_type_str;
            }
            if (id <= 0)
            {  //新增
                //1新增主表
                id = pBll.Add(privileges);
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加会员特权,主键为" + id); //记录日志
                JscriptMsg("添加会员特权成功!", "privileges_list.aspx?id=" + sid, "Success");
            }
            else
            {   //修改
                //1修改主表
                pBll.Update(privileges);
                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改会员通知,主键为" + id); //记录日志
                JscriptMsg("修改会员特权成功!", "privileges_list.aspx?id=" + sid, "Success");
            }
        }
Ejemplo n.º 19
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Model.wx_userweixin         weixin = GetWeiXinCode();
            Model.wx_requestRuleContent rc     = new Model.wx_requestRuleContent();
            int id = MyCommFun.Str2Int(hidid.Value);

            #region  //先判断
            string   strErr    = "";
            DateTime beginDate = DateTime.Parse(this.txtstatedate.Text);
            if (DateTime.Now >= beginDate)
            {
                JscriptMsg("开始时间必须大于当前时间", "", "Error");
                return;
            }

            if (this.txtKW.Text.Trim().Length == 0)
            {
                strErr += "关键词不能为空!";
            }
            if (this.txtwxTitle.Text.Trim().Length == 0)
            {
                strErr += "喜帖名称不能为空!";
            }
            if (txtmanName.Text.Trim().Length == 0 || txtmanName.Text.Trim().Length == 0)
            {
                strErr += "新郎和新娘名称不能为空!";
            }
            if (this.txtstatedate.Text.Trim().Length == 0 || !MyCommFun.isDateTime(txtstatedate.Text))
            {
                strErr += "婚宴时间不能为空!";
            }
            if (this.txtaddr.Text.Trim().Length == 0)
            {
                strErr += "宴席地点不能为空!";
            }
            if (strErr != "")
            {
                JscriptMsg(strErr, "back", "Error");
                return;
            }
            #endregion

            #region 赋值
            Model.wx_xt_base     xitie = new Model.wx_xt_base();
            Model.wx_requestRule rule  = new Model.wx_requestRule();

            string beginPic = txtImgUrl.Text.Trim();
            string kcdh     = txtKcdh.Text.Trim();

            string kcdh_slt = txtdonghuaSlt.Text.Trim();


            if (id > 0)
            {
                xitie = sstBll.GetModel(id);
            }

            xitie.wxTitle    = txtwxTitle.Text.Trim();
            xitie.manName    = txtmanName.Text.Trim();
            xitie.felmanName = txtfelmanName.Text.Trim();
            xitie.nameSeq    = int.Parse(radNameSeq.SelectedItem.Value);
            xitie.tel        = txttel.Text;
            xitie.statedate  = MyCommFun.Obj2DateTime(txtstatedate.Text);
            xitie.addr       = txtaddr.Text.Trim();

            xitie.video    = txtvideo.Text.Trim();
            xitie.music    = txtMusic.Text.Trim();
            xitie.word     = txtword.Value.Trim();
            xitie.sqrurl   = txtsqrurl.Text.Trim();
            xitie.copyrite = txtcopyrite.Value.Trim();
            xitie.pwd      = txtPwd.Text.Trim();
            //图片
            xitie.fengmian   = beginPic;
            xitie.donghua    = kcdh;
            xitie.donghuaSlt = kcdh_slt;

            //坐标
            decimal xPoint = (decimal)MyCommFun.Str2Float(this.txtLatXPoint.Text);
            decimal yPoint = (decimal)MyCommFun.Str2Float(this.txtLngYPoint.Text);
            xitie.lngX = xPoint;
            xitie.latY = yPoint;

            #endregion

            if (id <= 0)
            {  //新增
                xitie.wid        = weixin.id;
                xitie.createDate = DateTime.Now;
                //1新增主表
                id = sstBll.Add(xitie);


                //2 新增回复规则表
                rBll.AddModeltxtPicRule(weixin.id, "喜帖", id, txtKW.Text.Trim());
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加喜帖,主键为" + id); //记录日志
                JscriptMsg("添加帖成功!", "xitielist.aspx", "Success");
            }
            else
            {   //修改
                //1修改主表
                sstBll.Update(xitie);

                //2 修改回复规则表
                IList <Model.wx_requestRule> rlist = rBll.GetModelList("modelFunctionName = '喜帖' and modelFunctionId=" + id);

                if (rlist != null && rlist.Count > 0)
                {
                    rule             = rlist[0];
                    rule.reqKeywords = txtKW.Text.Trim();
                    rBll.Update(rule);
                }
                else
                {
                    rBll.AddModeltxtPicRule(weixin.id, "喜帖", id, txtKW.Text.Trim());
                }

                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改喜帖,主键为" + id); //记录日志
                JscriptMsg("修改喜帖成功!", "xitielist.aspx", "Success");
            }
        }
Ejemplo n.º 20
0
        protected void save_qiudui_Click(object sender, EventArgs e)
        {
            BLL.wx_sjb_richeng   richengbll   = new BLL.wx_sjb_richeng();
            Model.wx_sjb_richeng richengmodel = new Model.wx_sjb_richeng();

            richengmodel = richengbll.GetModel(richengid);
            DateTime beginDate = MyCommFun.Obj2DateTime(this.beginDate.Text.ToString());
            DateTime endDate   = MyCommFun.Obj2DateTime(this.endDate.Text.ToString());

            if (beginDate > endDate)
            {
                JscriptMsg("开始时间不能大于介绍时间!", "back", "Error");
                return;
            }

            if (richengmodel.beginDate <= beginDate && richengmodel.endDate >= endDate)
            {
            }
            else
            {
                JscriptMsg("时间范围必须在日程日内!", "back", "Error");
                return;
            }

            if (type == "edite")
            {
                bisai.id       = bisaiid;
                bisai.rcId     = richengid;
                bisai.bsPic    = this.bsPic.Text;
                bisai.bsRemark = this.bsRemark.InnerText;
                bisai.qd1Id    = Convert.ToInt32(this.qd1Id.SelectedValue);
                bisai.qd2Id    = Convert.ToInt32(this.qd2Id.SelectedValue);
                if (this.beginDate.Text != "")
                {
                    bisai.beginDate = Convert.ToDateTime(this.beginDate.Text);
                }
                if (this.endDate.Text != "")
                {
                    bisai.endDate = Convert.ToDateTime(this.endDate.Text);
                }
                if (this.jcBeginDate.Text != "")
                {
                    bisai.jcBeginDate = Convert.ToDateTime(this.jcBeginDate.Text);
                }
                if (this.jcEndDate.Text != "")
                {
                    bisai.jcEndDate = Convert.ToDateTime(this.jcEndDate.Text);
                }



                bisaibll.Update(bisai);

                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改球队设置,主键为" + bisaiid); //记录日志
                JscriptMsg("修改成功!", "bisai_list.aspx?id=" + richengid, "Success");
            }

            if (type == "add")
            {
                bisai.rcId     = richengid;
                bisai.bsPic    = this.bsPic.Text;
                bisai.bsRemark = this.bsRemark.InnerText;
                bisai.qd1Id    = Convert.ToInt32(this.qd1Id.SelectedValue);
                bisai.qd2Id    = Convert.ToInt32(this.qd2Id.SelectedValue);



                if (this.beginDate.Text != "")
                {
                    bisai.beginDate = Convert.ToDateTime(this.beginDate.Text);
                }
                if (this.endDate.Text != "")
                {
                    bisai.endDate = Convert.ToDateTime(this.endDate.Text);
                }



                if (this.jcBeginDate.Text != "")
                {
                    bisai.jcBeginDate = Convert.ToDateTime(this.jcBeginDate.Text);
                }
                if (this.jcEndDate.Text != "")
                {
                    bisai.jcEndDate = Convert.ToDateTime(this.jcEndDate.Text);
                }


                int id = bisaibll.Add(bisai);

                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "修改球队设置,主键为" + id); //记录日志
                JscriptMsg("增加成功!", "bisai_list.aspx?id=" + richengid, "Success");
            }
        }
Ejemplo n.º 21
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";
            string action = MXRequest.GetQueryString("myact");
            int    wid    = MyCommFun.RequestInt("wid");
            string openid = MyCommFun.RequestOpenid();

            #region 添加印象
            if (action == "fyyx")
            {
                BLL.wx_fc_fyImpression      fBll     = new BLL.wx_fc_fyImpression();
                Dictionary <string, string> jsondict = new Dictionary <string, string>();
                string imp_user = MyCommFun.QueryString("imp_user");
                int    fid      = MyCommFun.RequestInt("fid");
                int    record   = fBll.GetRecordCount(" content='" + imp_user + "'");
                int    allrw    = fBll.GetRecordCount(" id>0 ");
                int    rep      = fBll.GetRecordCount(" openid='" + openid + "'");
                if (rep > 0)
                {
                    jsondict.Add("errno", "2");
                    jsondict.Add("res", "你已经添加过印象了");
                    context.Response.Write(MyCommFun.getJsonStr(jsondict));
                    return;
                }

                if (record > 0)//有过此类印象
                {
                    double re = (Convert.ToDouble(record) / allrw) * 100;
                    jsondict.Add("res", re.ToString() + "%");
                }
                else           //独特印象
                {
                    jsondict.Add("res", "1");
                }
                Model.wx_fc_fyImpression fModel = new Model.wx_fc_fyImpression();
                fModel.content    = imp_user;
                fModel.createDate = DateTime.Now;
                fModel.fid        = fid;
                fModel.openid     = openid;
                fModel.sort_id    = 1;
                fModel.wid        = wid;
                fModel.quantity   = 1;
                fBll.Add(fModel);
                jsondict.Add("errno", "1");
                context.Response.Write(MyCommFun.getJsonStr(jsondict));
                return;
            }
            #endregion

            #region 添加预约订单信息
            if (action == "addyydd")
            {
                Dictionary <string, string> jsondict = new Dictionary <string, string>();
                BLL.wx_fc_yyInfo            yBll     = new BLL.wx_fc_yyInfo();
                BLL.wx_fc_floor             fBll     = new BLL.wx_fc_floor();
                string             linkman           = MyCommFun.QueryString("truename");
                string             dateline          = MyCommFun.QueryString("dateline");
                string             timepart          = MyCommFun.QueryString("timepart");
                int                housetype         = MyCommFun.RequestInt("housetype");
                string             info      = MyCommFun.QueryString("info");
                string             tel       = MyCommFun.QueryString("tel");
                int                fid       = MyCommFun.RequestInt("fid");
                int                addOrEdit = MyCommFun.RequestInt("addOrEdit");
                int                yid       = MyCommFun.Obj2Int(fBll.GetModel(fid).yid);
                Model.wx_fc_yyInfo yyinfo    = new Model.wx_fc_yyInfo()
                {
                    createdate  = DateTime.Now,
                    hid         = housetype,
                    telephone   = tel,
                    remark      = info,
                    name        = linkman,
                    yydate      = MyCommFun.Obj2DateTime(dateline),
                    yydatepart  = timepart,
                    wid         = wid,
                    fid         = fid,
                    yid         = yid,
                    openid      = openid,
                    orderStatus = "待回复",
                    sort_id     = 99
                };
                if (addOrEdit > 0)
                { //修改
                    yyinfo.Id = addOrEdit;
                    yBll.Update(yyinfo);
                }
                else                  //添加
                {
                    yBll.Add(yyinfo);
                }
                jsondict.Add("errno", "0");
                jsondict.Add("content", "");
                context.Response.Write(MyCommFun.getJsonStr(jsondict));
                return;
            }
            #endregion

            #region 加载相册信息
            if (action == "xiangce")
            {
                BLL.wx_fc_album      bll   = new BLL.wx_fc_album();
                BLL.wx_albums_photo  pBll  = new BLL.wx_albums_photo();
                BLL.wx_albums_info   aBll  = new BLL.wx_albums_info();
                Model.wx_albums_info model = new Model.wx_albums_info();
                int           fid          = MyCommFun.RequestInt("fid");
                StringBuilder sb           = new StringBuilder("");
                sb.Append("showPics([");
                //获得楼盘相册
                DataTable artlist = bll.GetList(" fid=" + fid).Tables[0];

                int a_rowsNum = 0;                                                        //每行显示的图片数量
                List <Model.wx_albums_photo> allist = new List <Model.wx_albums_photo>(); //图片表
                if (artlist != null && artlist.Rows.Count > 0)
                {
                    DataRow dr;
                    for (int i = 0; i < artlist.Rows.Count; i++)//循环楼盘相册
                    {
                        dr    = artlist.Rows[i];
                        model = aBll.GetModel(int.Parse(dr["aid"].ToString()));//根据楼盘相册得到该相册基本信息表

                        //if (model.albums == null || model.albums.Count <= 0)
                        //{
                        //    continue;
                        //}
                        allist = pBll.GetModelList(" aId=" + model.id);
                        sb.Append("{\"title\":\"" + model.aName + "\",");
                        a_rowsNum = (allist.Count) / 2;
                        //第一行
                        sb.Append(" \"ps1\":[");
                        sb.Append(" { \"type\":\"title\", \"title\":\"" + model.aName + "\", \"subTitle\":\"" + model.aContent + "\"}");
                        if (a_rowsNum > 0)
                        {
                            sb.Append(",");
                        }
                        for (int h = 0; h < a_rowsNum; h++)
                        {
                            if (h < (a_rowsNum - 1))
                            {
                                sb.Append(" {\"type\":\"img\",\"name\":\"" + allist[h].pContent + "\",\"img\":\"" + MyCommFun.getWebSite() + allist[h].photoPic + "\",\"size\":[480,450]},");
                            }
                            else
                            {
                                sb.Append(" {\"type\":\"img\",\"name\":\"" + allist[h].pContent + "\",\"img\":\"" + MyCommFun.getWebSite() + allist[h].photoPic + "\",\"size\":[480,450]}");
                            }
                        }
                        sb.Append("],");

                        //第二行
                        sb.Append(" \"ps2\":[");
                        int h_cishu = 0;
                        for (int h = a_rowsNum; h < allist.Count; h++)
                        {
                            if (h_cishu == 1)
                            {
                                sb.Append(" {\"type\":\"text\",\"content\":\"" + model.aContent + "\"},");
                            }

                            if (h < (allist.Count - 1))
                            {
                                sb.Append(" {\"type\":\"img\",\"name\":\"" + allist[h].pContent + "\",\"img\":\"" + MyCommFun.getWebSite() + allist[h].photoPic + "\",\"size\":[480,450]},");
                                h_cishu++;
                            }
                            else
                            {
                                sb.Append(" {\"type\":\"img\",\"name\":\"" + allist[h].pContent + "\",\"img\":\"" + MyCommFun.getWebSite() + allist[h].photoPic + "\",\"size\":[480,450]}");
                            }
                        }
                        if (h_cishu == 0)
                        {
                            if (allist.Count > 0)
                            {
                                sb.Append(",");
                            }
                            sb.Append("{\"type\":\"text\",\"content\":\"" + model.aContent + "\"}");
                        }

                        sb.Append("]");

                        if (i < (artlist.Rows.Count - 1))
                        {
                            sb.Append("},");
                        }
                        else
                        {
                            sb.Append("}");
                        }
                    }
                }

                sb.Append("]);");
                context.Response.Write(sb.ToString());
                return;
            }
            #endregion

            #region 加载户型图片
            if (action == "htImg")
            {
                BLL.wx_fc_houseType htBll = new BLL.wx_fc_houseType();
                BLL.wx_fc_floor     fBll  = new BLL.wx_fc_floor();
                int fid  = MyCommFun.RequestInt("fid");
                int htid = MyCommFun.RequestInt("htid");

                if (htBll.GetRecordCount(string.Format(" fid={0} and wid={1} and id={2}", fid, wid, htid)) < 1)
                {
                    return;
                }

                Model.wx_fc_houseType htModel = htBll.GetModel(htid);
                Model.wx_fc_floor     fModel  = fBll.GetModel(fid);
                StringBuilder         sb      = new StringBuilder("showRooms({");//begin
                sb.Append("\"banner\":\"http://42.96.196.48/tpl/static/attachment/focus/default/../canyin/3.jpg\",");
                sb.Append("\"rooms\":[{");
                sb.Append("\"name\":\"" + htModel.Name + "\",");
                sb.Append("\"desc\":\"" + fModel.newsTitle + "\",");
                sb.Append("\"bimg\":\"" + MyCommFun.getWebSite() + htModel.htimgA + "\",");
                sb.Append("\"rooms\":\"" + htModel.houseType + "\",");
                sb.Append("\"area\":\" " + htModel.jzmj + "平方米\",");
                sb.Append("\"floor\":\"" + htModel.storey + "\",");
                sb.Append("\"width\":1600,");
                sb.Append("\"height\":1600,");
                sb.Append("\"pics\":[");
                //图片区,A
                List <string> ls = imgstr(htModel);
                for (int i = 0; i < ls.Count; i++)
                {
                    sb.Append("{\"img\":\"" + MyCommFun.getWebSite() + htModel.htimgA + "\",");
                    sb.Append("\"width\":760,");
                    sb.Append("\"height\":760,");
                    sb.Append("\"name\":\"" + htModel.Name + "\"}");
                    if (i != ls.Count)
                    {
                        sb.Append(",");
                    }
                }

                sb.Append("],");
                //图片end
                sb.Append("\"dtitle\":[\"建筑面积约" + htModel.jzmj + "平方米\"],");
                sb.Append("\"dlist\":[\"" + htModel.Jieshao + "\"]");
                sb.Append("}]})");//end
                context.Response.Write(sb.ToString());
                return;
            }
            #endregion
        }
Ejemplo n.º 22
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);
        }
Ejemplo n.º 23
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();

            Model.wx_requestRuleContent rc = new Model.wx_requestRuleContent();
            int id = MyCommFun.Str2Int(hidid.Value);

            #region  //先判断
            string strErr = "";
            if (this.txtKW.Text.Trim().Length == 0)
            {
                strErr += "关键词不能为空!";
            }
            if (this.txtactName.Text.Trim().Length == 0)
            {
                strErr += "活动名称不能为空!";
            }
            if (this.txtbeginDate.Text.Trim().Length == 0 || !MyCommFun.isDateTime(txtbeginDate.Text))
            {
                strErr += "开始时间不能为空!";
            }
            if (this.txtendDate.Text.Trim().Length == 0 || !MyCommFun.isDateTime(txtendDate.Text))
            {
                strErr += "结束时间不能为空!";
            }


            if (strErr != "")
            {
                JscriptMsg(strErr, "back", "Error");
                return;
            }
            DateTime begin = MyCommFun.Obj2DateTime(txtbeginDate.Text.Trim());
            DateTime end   = MyCommFun.Obj2DateTime(txtendDate.Text.Trim());
            if (begin >= end)
            {
                JscriptMsg("开始时间必须小于结束时间", "back", "Error");
                return;
            }
            #endregion

            #region 赋值

            var dto = new photoActionDTO();
            Model.wx_requestRule rule = new Model.wx_requestRule();



            if (id > 0)
            {
                dto = _service.GetModel(id);
            }

            dto.actName = txtactName.Text.Trim();

            dto.brief      = txtbrief.Value.Trim();
            dto.beginDate  = begin.ToString();
            dto.endDate    = end.ToString();
            dto.actContent = txtactContent.Value.Trim();



            #endregion

            if (id <= 0)
            {  //新增
                dto.wid = weixin.id;

                //1新增主表
                _service.Add(dto);
                id = dto.id;

                //3 新增回复规则表
                AddRule(weixin.id, id);
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加湖怪活动,主键为" + id); //记录日志//1e2124dd04e11d01b9df2865f85944be
                JscriptMsg("添加湖怪活动成功!", "photolist.aspx", "Success");
            }
            else
            {   //修改
                //1修改主表
                _service.Modify(dto);

                //3 修改回复规则表
                IList <Model.wx_requestRule> rlist = rBll.GetModelList("modelFunctionName = '湖怪' and modelFunctionId=" + id);

                if (rlist != null && rlist.Count > 0)
                {
                    rule             = rlist[0];
                    rule.reqKeywords = txtKW.Text.Trim();
                    rBll.Update(rule);
                }
                else
                {
                    AddRule(weixin.id, id);
                }

                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改湖怪活动,主键为" + id); //记录日志
                JscriptMsg("修改湖怪活动成功!", "photolist.aspx", "Success");
            }
        }
Ejemplo n.º 24
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);
            }

            Model.manager 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);


            Model.wx_userweixin model = new Model.wx_userweixin();

            model.uId            = this.uid;
            model.wxName         = wxName;
            model.wxId           = wxId;
            model.yixinId        = "";
            model.weixinCode     = weixinCode;
            model.wxPwd          = wxPwd;
            model.headerpic      = headerpic;
            model.apiurl         = apiurl;
            model.wxToken        = wxToken;
            model.wxProvince     = wxProvince;
            model.wxCity         = wxCity;
            model.AppId          = AppId;
            model.AppSecret      = AppSecret;
            model.Access_Token   = "";
            model.openIdStr      = "";
            model.createDate     = createDate;
            model.endDate        = endDate;
            model.wenziMaxNum    = -1;//-1为无限制
            model.tuwenMaxNum    = -1;
            model.yuyinMaxNum    = -1;
            model.wenziDefineNum = 0;
            model.tuwenDefineNum = 0;
            model.yuyinDefineNum = 0;
            model.requestTTNum   = 0;
            model.requestUsedNum = 0;
            model.smsTTNum       = 0;
            model.smsUsedNum     = 0;
            model.isDelete       = false;
            model.wStatus        = 1;
            model.remark         = "";
            model.seq            = 99;

            if (IsChaoGuoWxNum())
            {
                return(false);
            }
            int wId = bll.Add(model);

            if (wId > 0)
            {
                Object obj = ConfigurationManager.AppSettings["industry_defaultAdd"];
                if (obj != null && obj.ToString() == "true")
                {
                    //为微账户添加行业默认模块
                    BLL.manager mBll = new BLL.manager();
                    BLL.wx_industry_defaultModule idBll = new wx_industry_defaultModule();
                    Model.manager user   = mBll.GetModel(uid);
                    int           roleid = user.role_id;
                    idBll.addMouduleByRoleid(roleid, wId);
                }

                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加微信号,主键为:" + model.id + ",微信号为:" + model.weixinCode); //记录日志
                return(true);
            }
            return(false);
        }
Ejemplo n.º 25
0
        /// <summary>
        /// 处理发关注红包的逻辑
        /// </summary>
        /// <param name="openid"></param>
        /// <param name="wid"></param>
        /// <param name="actModel"></param>
        public int  proecssSendHB(string openid, int wid, Model.wx_xjhongbao_action actModel)
        {
            BLL.wx_xjhongbao_action actBll    = new BLL.wx_xjhongbao_action();
            BLL.wx_xjhongbao_base   baseBll   = new BLL.wx_xjhongbao_base();
            Model.wx_xjhongbao_base baseModel = baseBll.GetModelByWid(wid);

            BLL.wx_payment_wxpay   weixinPayBLL   = new BLL.wx_payment_wxpay();
            Model.wx_payment_wxpay weixinPayModel = weixinPayBLL.GetModelByWid(wid);

            if (baseModel == null || weixinPayModel == null || actModel == null)
            {
                return(0);
            }

            #region 取用户昵称--注释掉了
            //string error = "";
            //string accessToken=WeiXinCRMComm.getAccessToken(wid, out error);
            //if (error.Trim().Length > 0)
            //{
            //    WXLogs.AddErrLog(wid, "微信红包", actModel.act_name, "accessToken取值有错误error:"+error);
            //    return;
            //}
            //string nick = UserApi.Info(accessToken, openid).nickname;
            #endregion

            //用户此次获得的红包(单位分)
            int hongbaoFen = 0;
            if (actModel.totalLqMoney >= actModel.totalMoney)
            {
                //1 红包金额已经领取完了,记录到日志
                InsertToLQinfo(wid, actModel.id, openid, 0, DateTime.Parse("1970-1-1"), "", "", "", "", "红包余额不足,需要调整活动的金额");
                return(0);
            }
            //2 判断该用户是否已经领取了
            bool hasLQ = lqBll.ExistsOpenid(actModel.id, openid, actModel.lqType == 0 ? true : false);
            if (hasLQ)
            { //已经领取了
                return(0);
            }
            int leftMoney = actModel.totalMoney.Value - actModel.totalLqMoney.Value;//剩余金额
            //3 计算本次的红包
            if (actModel.moneyType == 0)
            { //定额
                hongbaoFen = actModel.min_value.Value;
            }
            else
            {  //随机
                Random rd = new Random();
                hongbaoFen = rd.Next(actModel.min_value.Value, actModel.max_value.Value);
            }

            if (hongbaoFen >= leftMoney)
            {
                hongbaoFen = leftMoney;
            }

            //4 给用户发红包
            string mchbillno = weixinPayModel.mch_id + DateTime.Now.ToString("yyyymmddHHmmss") + TenPayV3Util.BuildRandomStr(4);


            Model.wx_xjhongbao_lqinfo lqinfoEntity = new Model.wx_xjhongbao_lqinfo();
            lqinfoEntity.wid          = wid;
            lqinfoEntity.actionId     = actModel.id;
            lqinfoEntity.openid       = openid;
            lqinfoEntity.total_amount = hongbaoFen;
            lqinfoEntity.createDate   = DateTime.Now;

            XmlDocument doc = new XmlDocument();
            if (!SendHBBase(weixinPayModel, actModel, wid, openid, hongbaoFen, mchbillno, doc))
            {
                //发红包的方法出现问题
                WXLogs.AddErrLog(wid, "微信红包", actModel.act_name, "发现金红包底层方法报错。");

                lqinfoEntity.Send_time  = DateTime.Now;
                lqinfoEntity.mch_billno = mchbillno;
                lqinfoEntity.mch_id     = weixinPayModel.mch_id;
                lqinfoEntity.hbstatus   = "FAILED";
                lqinfoEntity.send_type  = "API";
                lqinfoEntity.hb_type    = "NORMAL";
                lqinfoEntity.reason     = "result_code:" + doc.InnerXml.ToString();

                lqBll.Add(lqinfoEntity);  //记录领取日志
                WXLogs.AddLog(wid, "微信红包", actModel.act_name, "现金红包领取失败:" + doc.InnerXml.ToString());
                return(0);
            }
            //5修改现金:1活动的领取金额增加;2用户的中奖记录增加
            actModel = actBll.GetModel(actModel.id);
            actModel.totalLqMoney += hongbaoFen;
            actBll.Update(actModel);
            //6修改配置文件的领取金额;
            baseModel.totalLQMoney += hongbaoFen;
            baseBll.Update(baseModel);

            WXLogs.AddLog(wid, "微信红包", actModel.act_name, "现金红包领取成功2:" + doc.InnerXml.ToString());

            lqinfoEntity.Send_time  = MyCommFun.Obj2DateTime(MyCommFun.GetXmlNode("send_time", doc), DateTime.Now);
            lqinfoEntity.mch_billno = mchbillno;
            lqinfoEntity.mch_id     = weixinPayModel.mch_id;
            lqinfoEntity.detail_id  = MyCommFun.GetXmlNode("send_listid", doc);
            lqinfoEntity.hbstatus   = "SUCCESS";
            lqinfoEntity.send_type  = "API";
            lqinfoEntity.hb_type    = "NORMAL";
            lqinfoEntity.reason     = "";
            lqinfoEntity.remark     = doc.InnerXml.ToString();
            lqBll.Add(lqinfoEntity);

            WXLogs.AddLog(wid, "微信红包", actModel.act_name, "现金红包成功领取3:" + doc.InnerXml.ToString());
            return(hongbaoFen);
        }
Ejemplo n.º 26
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();
            int id = MyCommFun.Str2Int(hidid.Value);

            #region  //先判断
            string strErr = "";

            if (this.txtact_name.Text.Trim().Length == 0)
            {
                strErr += "活动名称不能为空!";
            }
            if (ddlhbType.SelectedItem.Value == "")
            {
                strErr += "活动类型不能为空!";
            }
            if (ddlhbType.SelectedItem.Value == "1")
            {
                if (this.txtKW.Text.Trim().Length == 0)
                {
                    strErr += "关键词不能为空!";
                }
            }

            if (this.txtbeginDate.Text.Trim().Length == 0 || !MyCommFun.isDateTime(txtbeginDate.Text))
            {
                strErr += "开始时间不能为空!";
            }
            if (this.txtendDate.Text.Trim().Length == 0 || !MyCommFun.isDateTime(txtendDate.Text))
            {
                strErr += "结束时间不能为空!";
            }

            if (this.txtwishing.Text.Trim().Length == 0)
            {
                strErr += "祝福语不能为空!";
            }

            if (this.txtnick_name.Text.Trim().Length == 0)
            {
                strErr += "提供方名称不能为空!";
            }

            if (this.txtsend_name.Text.Trim().Length == 0)
            {
                strErr += "商户名称不能为空!";
            }

            if (this.txtclient_ip.Text.Trim().Length == 0)
            {
                strErr += "调用接口的机器 Ip 地址不能为空!";
            }

            if (this.txttotalMoney.Text.Trim().Length == 0)
            {
                strErr += "红包总金额不能为空!";
            }

            if (strErr != "")
            {
                JscriptMsg(strErr, "back", "Error");
                return;
            }
            DateTime begin = DateTime.Parse(txtbeginDate.Text.Trim());
            DateTime end   = DateTime.Parse(txtendDate.Text.Trim());
            if (begin >= end)
            {
                JscriptMsg("开始时间必须小于结束时间", "back", "Error");
                return;
            }
            if (ddlhbType.SelectedItem.Value == "0")
            {
                //如果是关注红包,则要判断该微账号同一时间段是否已经包含了关注红包
                IList <Model.wx_xjhongbao_action> actlist = xjactBll.GetModelList("wid=" + weixin.id + " and id!=" + id + " and hbType=0 and  endDate>='" + begin.ToString() + "' and beginDate<='" + end.ToString() + "' ");

                if (actlist != null && actlist.Count > 0)
                {
                    JscriptMsg("该时间段内不能有2个关注红包", "back", "Error");
                    return;
                }
            }

            #endregion

            #region 赋值
            Model.wx_xjhongbao_action xjActionModel = new Model.wx_xjhongbao_action();
            if (id > 0)
            {   //修改
                xjActionModel = xjactBll.GetModel(id);
            }

            xjActionModel.act_name = txtact_name.Text.Trim();

            xjActionModel.actPic     = txtactPic.Text.Trim();
            xjActionModel.beginDate  = MyCommFun.Obj2DateTime(txtbeginDate.Text);
            xjActionModel.endDate    = MyCommFun.Obj2DateTime(txtendDate.Text);
            xjActionModel.lqType     = MyCommFun.Str2Int(radlqType.Text);
            xjActionModel.totalMoney = (int)(MyCommFun.Str2Decimal(txttotalMoney.Text) * 100);
            xjActionModel.moneyType  = MyCommFun.Str2Int(radmoneyType.SelectedItem.Value);
            xjActionModel.min_value  = (int)(MyCommFun.Str2Decimal(txtmin_value.Text) * 100);
            xjActionModel.keywords   = txtKW.Text.Trim();

            if (ddlhbType.SelectedItem.Value == "0")
            {  //如果红包为关注时红包,则领取方式为:一次性
                xjActionModel.lqType = 0;
            }
            if (xjActionModel.moneyType == 0)
            {
                xjActionModel.max_value = xjActionModel.min_value;
            }
            else
            {
                xjActionModel.max_value = (int)(MyCommFun.Str2Decimal(txtmax_value.Text) * 100);
            }
            xjActionModel.remark = txtremark.Value;

            //红包参数
            xjActionModel.wishing     = txtwishing.Text.Trim();
            xjActionModel.nick_name   = txtnick_name.Text.Trim();
            xjActionModel.send_name   = txtsend_name.Text.Trim();
            xjActionModel.logo_imgurl = txtlogo_imgurl.Text.Trim();
            xjActionModel.client_ip   = txtclient_ip.Text.Trim();

            //分享的参数
            xjActionModel.share_content = txtshare_content.Value.Trim();
            xjActionModel.share_url     = txtshare_url.Value.Trim();
            xjActionModel.share_imgurl  = txtshare_imgurl.Text.Trim();

            if (id > 0)
            {
                //修改
                bool updateOK = xjactBll.Update(xjActionModel);
                //if (xjActionModel.hbType == 1)
                //{
                //    //添加关键词
                //    IList<Model.wx_requestRule> rlist = rBll.GetModelList("modelFunctionName = '现金红包' and modelFunctionId=" + id);

                //    if (rlist != null && rlist.Count > 0)
                //    {
                //        Model.wx_requestRule rule = new Model.wx_requestRule();

                //        rule = rlist[0];
                //        rule.reqKeywords = txtKW.Text.Trim();
                //        rBll.Update(rule);
                //    }
                //    else
                //    {
                //        AddRule(weixin.id, id);
                //    }
                //}
                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改现金红包活动,主键为" + id); //记录日志//1e2124dd04e11d01b9df2865f85944be
                JscriptMsg("修改现金红包活动成功!", "actionmgr.aspx", "Success");
            }
            else
            {
                //新增
                xjActionModel.hbType       = MyCommFun.Str2Int(ddlhbType.Text.Trim());
                xjActionModel.totalLqMoney = 0;
                xjActionModel.wid          = weixin.id;
                xjActionModel.createDate   = DateTime.Now;
                int addId = xjactBll.Add(xjActionModel);
                //if (xjActionModel.hbType == 1)
                //{
                //    //添加关键词
                //    AddRule(weixin.id, addId);
                //}

                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加现金红包活动,主键为" + addId); //记录日志//1e2124dd04e11d01b9df2865f85944be
                JscriptMsg("添加现金红包活动成功!", "actionmgr.aspx", "Success");
            }



            #endregion
        }
Ejemplo n.º 27
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();
            int id = MyCommFun.Str2Int(hidid.Value);

            #region  //先判断
            string strErr = "";
            if (this.txtnName.Text.Trim().Length == 0)
            {
                strErr += "名称不能为空!";
            }

            if (strErr != "")
            {
                JscriptMsg(strErr, "back", "Error");
                return;
            }
            int rqType = MyCommFun.Str2Int(txtRQValue.Text.Trim(), -1);
            if (rqType == -1)
            {
                JscriptMsg("请选择人群的类型", "back", "Error");
                return;
            }
            #endregion
            Model.wx_ucard_ticket ticket = new Model.wx_ucard_ticket();

            if (id > 0)
            {
                ticket = tBll.GetModel(id);
            }

            ticket.tName       = txtnName.Text.Trim();
            ticket.usedContent = txtusedContent.Value.Trim();
            ticket.sId         = sid;
            ticket.beginDate   = MyCommFun.Obj2DateTime(txtbeginDate.Text);
            ticket.endDate     = MyCommFun.Obj2DateTime(txtendDate.Text);
            ticket.usedTimes   = MyCommFun.Str2Int(txtusedTimes.Text);
            ticket.userType    = rqType;
            if (rqType == 2001)
            {
                ticket.consumeMoney = MyCommFun.Str2Int(txtdcje.Text);
            }
            else if (rqType == 2002)
            {
                ticket.consumeMoney = MyCommFun.Str2Int(txtljje.Text);
            }
            if (radType1.Checked)
            {
                ticket.typeId = 1;
            }
            else
            {
                ticket.typeId  = 2;
                ticket.dyMoney = MyCommFun.Str2Int(txtTypeMoney.Text);
            }
            if (id <= 0)
            {  //新增
                //1新增主表
                ticket.createDate = DateTime.Now;
                ticket.sort_id    = 0;
                id = tBll.Add(ticket);
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加会员商家优惠券,主键为" + id); //记录日志
                JscriptMsg("添加会员商家优惠券成功!", "ticket_list.aspx?id=" + sid, "Success");
            }
            else
            {   //修改
                //1修改主表
                tBll.Update(ticket);
                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改会员商家优惠券,主键为" + id); //记录日志
                JscriptMsg("修改会员商家优惠券成功!", "ticket_list.aspx?id=" + sid, "Success");
            }
        }
Ejemplo n.º 28
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();

           
          
            int id = MyCommFun.Str2Int(hidid.Value);
            #region  //先判断
            string strErr = "";


            if (this.txtusername.Text.Trim().Length == 0)
            {
                strErr += "用户名不能为空!";
            }
            
           
            if (strErr != "")
            {
                JscriptMsg(strErr, "back", "Error");
                return;
            }
            #endregion

            #region 赋值
           

            Model.wx_my_user userEntity = new Model.wx_my_user();
           
            if (id > 0)
            {
                userEntity = userBll.GetModel(id);
            }

            userEntity.username = txtusername.Text.Trim();
            userEntity.userscore =MyCommFun.Obj2Int( txtuserscore.Text);
            userEntity.usergrade =MyCommFun.Obj2Int(txtusergrade.Text);
            userEntity.useraddr = txtuseraddr.Text.ToString();
            userEntity.usertel = txtusertel.Text;
            userEntity.userborn = MyCommFun.Obj2DateTime(txtuserborn.Text);
            userEntity.useremail = txtuseremail.Text.Trim();
            userEntity.userpsd = txtuserpsd.Text.Trim();
            userEntity.userqq = txtuserqq.Text.Trim();
            userEntity.userpic = txtuserpic.Text.Trim();
            

            #endregion

            if (id <= 0)
            {  //新增
                userEntity.wid = weixin.id;
                
                //1新增主表
                id = userBll.Add(userEntity);
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加体检-用户信息,主键为" + id); //记录日志
                JscriptMsg("添用户信息成功!", "user_list.aspx", "Success");
            }
            else
            {   //修改
                //1修改主表
                userBll.Update(userEntity);



                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改用户信息,主键为" + id); //记录日志
                JscriptMsg("修改用户信息成功!", "user_list.aspx", "Success");
            }

        }
Ejemplo n.º 29
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();

            Model.wx_requestRuleContent rc = new Model.wx_requestRuleContent();
            int id = MyCommFun.Str2Int(hidid.Value);

            #region  //先判断
            string strErr = "";
            if (this.txtTitle.Text.Trim().Length == 0)
            {
                strErr += "标题不能为空!";
            }
            if (this.txtDepict.Value.Trim().Length == 0)
            {
                strErr += "描述不能为空!";
            }
            if (this.txtPayname.Text.Trim().Length == 0)
            {
                strErr += "商户名称不能为空!";
            }
            if (this.txtPaynum.Text.Trim().Length == 0)
            {
                strErr += "商户ID不能为空!";
            }
            if (this.txtPaypass.Text.Trim().Length == 0)
            {
                strErr += "密钥不能为空!";
            }


            if (this.txtPricemax.Text.Trim().Length == 0)
            {
                strErr += "最大金额不能为空!";
            }

            if (this.txtPricemin.Text.Trim().Length == 0)
            {
                strErr += "最小金额不能为空!";
            }

            if (this.txtStartTime.Text.Trim().Length == 0)
            {
                strErr += "活动开始时间不能为空!";
            }
            if (this.txtEndTime.Text.Trim().Length == 0)
            {
                strErr += "活动结束时间不能为空!";
            }
            if (strErr != "")
            {
                JscriptMsg(strErr, "back", "Error");
                return;
            }
            #endregion

            #region 赋值
            Model.wx_hb_base     hb   = new Model.wx_hb_base();
            Model.wx_requestRule rule = new Model.wx_requestRule();
            if (id > 0)
            {
                hb = sstBll.GetModel(id);
            }

            hb.payname  = txtPayname.Text.Trim();
            hb.paynum   = txtPaynum.Text.Trim();
            hb.paypass  = txtPaypass.Text.Trim();
            hb.payreIP  = txtPayreIP.Text.Trim();
            hb.payZSadd = txtPayZSadd.Text.Trim();
            hb.pricemax = int.Parse(txtPricemax.Text.Trim());
            hb.pricemin = int.Parse(txtPricemin.Text.Trim());

            hb.startTime = MyCommFun.Obj2DateTime(txtStartTime.Text);
            hb.title     = txtTitle.Text.Trim();
            hb.zftxt     = txtZftxt.Text.Trim();
            hb.endTime   = MyCommFun.Obj2DateTime(txtEndTime.Text);
            hb.depict    = txtDepict.Value;
            hb.appID     = weixin.AppId;
            //     XCWeiXin.API.WxPayAPI.RequestHandler packageReqHandler =new API.WxPayAPI.RequestHandler();
            //     string paySign = packageReqHandler.CreateMd5Sign("key", txtPaypass.Text.Trim());
            //    hb.signname = paySign;
            #endregion

            if (id <= 0)
            {  //新增
                hb.wid = weixin.id;

                hb.addtime = DateTime.Now;
                //1新增主表
                id = sstBll.Add(hb);


                //2 新增回复规则表
                rBll.AddModeltxtPicRule(weixin.id, "红包", id, txtTitle.Text.Trim());
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加红包,主键为" + id); //记录日志
                JscriptMsg("添加红包成功!", "index_hb.aspx", "Success");
            }
            else
            {   //修改
                //1修改主表
                sstBll.Update(hb);

                //2 修改回复规则表
                IList <Model.wx_requestRule> rlist = rBll.GetModelList("modelFunctionName = '红包' and modelFunctionId=" + id);

                if (rlist != null && rlist.Count > 0)
                {
                    rule             = rlist[0];
                    rule.reqKeywords = txtTitle.Text.Trim();
                    rBll.Update(rule);
                }
                else
                {
                    rBll.AddModeltxtPicRule(weixin.id, "红包", id, txtTitle.Text.Trim());
                }

                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改红包,主键为" + id); //记录日志
                JscriptMsg("修改成功!", "index_hb.aspx", "Success");
            }
        }
Ejemplo n.º 30
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";
            string action = MXRequest.GetQueryString("myact");

            #region 根据品牌得到车系
            if (action == "chexi")
            {
                BLL.wx_wq_chexi          cxBll  = new BLL.wx_wq_chexi();
                int                      pid    = MyCommFun.RequestInt("pid");
                int                      wid    = MyCommFun.RequestInt("wid");
                List <Model.wx_wq_chexi> cxList = cxBll.GetModelList(string.Format(" wid={0} and pid={1}", wid, pid));
                context.Response.Write(MyCommFun.SwitchToJson <Model.wx_wq_chexi>(cxList));
                return;
            }
            #endregion

            #region 根据车系得到车型
            if (action == "chexing")
            {
                BLL.wx_wq_chexing cxBll = new BLL.wx_wq_chexing();
                int xid = MyCommFun.RequestInt("xid");
                int wid = MyCommFun.RequestInt("wid");
                List <Model.wx_wq_chexing> cxList = cxBll.GetModelList(string.Format(" wid={0} and xid={1}", wid, xid));
                context.Response.Write(MyCommFun.SwitchToJson <Model.wx_wq_chexing>(cxList));
                return;
            }
            #endregion


            #region 添加预约订单
            if (action == "addorder")
            {
                Dictionary <string, string> jsondict = new Dictionary <string, string>();
                BLL.wx_wq_yyOrder           yoBll    = new BLL.wx_wq_yyOrder();
                Model.wx_wq_yyOrder         yoModel  = new Model.wx_wq_yyOrder();
                try
                {
                    int    wid    = MyCommFun.RequestInt("wid");
                    string name   = MyCommFun.QueryString("truename");
                    string openid = MyCommFun.QueryString("openid");
                    string tel    = MyCommFun.QueryString("tel");
                    string date   = MyCommFun.QueryString("dateline");
                    string part   = MyCommFun.QueryString("timepart");
                    string xid    = MyCommFun.QueryString("xid");
                    string pid    = MyCommFun.QueryString("pid");
                    int    type   = MyCommFun.RequestInt("type");
                    string carnum = MyCommFun.QueryString("carnum");
                    string km     = MyCommFun.QueryString("km");
                    string remark = MyCommFun.QueryString("info");
                    yoModel.Name       = name;
                    yoModel.remark     = remark;
                    yoModel.sort_id    = 99;
                    yoModel.telephone  = tel;
                    yoModel.xid        = MyCommFun.Str2Int(xid);
                    yoModel.pid        = MyCommFun.Str2Int(pid);
                    yoModel.wid        = wid;
                    yoModel.yid        = type;
                    yoModel.km         = MyCommFun.Str2Decimal(km);
                    yoModel.carnum     = carnum;
                    yoModel.yydate     = MyCommFun.Obj2DateTime(date);
                    yoModel.yytime     = part;
                    yoModel.openid     = openid;
                    yoModel.ddstatus   = "待回复";
                    yoModel.createdate = DateTime.Now;
                    int res = yoBll.Add(yoModel);
                    if (res < 1)
                    {
                        jsondict.Add("errno", "1");
                        context.Response.Write(MyCommFun.getJsonStr(jsondict));
                        return;
                    }
                    jsondict.Add("errno", "0");
                    context.Response.Write(MyCommFun.getJsonStr(jsondict));
                    return;
                }
                catch (Exception)
                {
                    jsondict.Add("errno", "1");
                    context.Response.Write(MyCommFun.getJsonStr(jsondict));
                    return;
                }
            }
            #endregion

            #region  除订单
            if (action == "delorder")
            {
                Dictionary <string, string> jsondict = new Dictionary <string, string>();
                int id  = MyCommFun.RequestInt("id");
                int wid = MyCommFun.RequestInt("wid");
                BLL.wx_wq_yyOrder yoBll = new BLL.wx_wq_yyOrder();
                yoBll.Delete(id);

                return;
            }
            #endregion

            if (action == "addChezhu")
            {
                Dictionary <string, string> jsondict = new Dictionary <string, string>();
                BLL.wx_wq_chezhu            czBll    = new BLL.wx_wq_chezhu();
                try
                {
                    int    pid           = MyCommFun.RequestInt("car_model");
                    int    wid           = MyCommFun.RequestInt("wid");
                    int    xid           = MyCommFun.RequestInt("car_type");
                    int    xingid        = MyCommFun.RequestInt("car_xing");
                    string car_no        = MyCommFun.QueryString("car_no");
                    string tel           = MyCommFun.QueryString("tel");
                    string car_userName  = MyCommFun.QueryString("car_userName");
                    string car_startTime = MyCommFun.QueryString("car_startTime");
                    string car_buyTime   = MyCommFun.QueryString("car_buyTime");
                    string openid        = MyCommFun.QueryString("openid");
                    int    res           = czBll.GetRecordCount(" openid='" + openid + "' and wid=" + wid);

                    Model.wx_wq_chezhu czModel = new Model.wx_wq_chezhu();
                    if (res > 0)
                    {
                        czModel = czBll.GetModelList(" openid='" + openid + "' and wid=" + wid)[0];
                    }
                    czModel.cpNum      = car_no;
                    czModel.cxingid    = xingid;
                    czModel.gcdate     = MyCommFun.Obj2DateTime(car_buyTime);
                    czModel.Name       = car_userName;
                    czModel.ppid       = pid;
                    czModel.cxid       = xid;
                    czModel.cxingid    = xingid;
                    czModel.spdate     = MyCommFun.Obj2DateTime(car_startTime);
                    czModel.teltephone = tel;
                    czModel.sort_id    = 99;
                    czModel.wid        = wid;
                    czModel.createdate = DateTime.Now;
                    czModel.openid     = openid;
                    if (res > 0)
                    {
                        czBll.Update(czModel);
                        jsondict.Add("content", "修改车主信息成功");
                        context.Response.Write(MyCommFun.getJsonStr(jsondict));
                        return;
                    }
                    else
                    {
                        czBll.Add(czModel);
                        jsondict.Add("content", "添加车主信息成功");
                        context.Response.Write(MyCommFun.getJsonStr(jsondict));
                        return;
                    }
                }
                catch (Exception)
                {
                    jsondict.Add("content", "操作失败!");
                    context.Response.Write(MyCommFun.getJsonStr(jsondict));
                    return;
                }
            }
        }