예제 #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);
        }
예제 #2
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");
            }
        }
예제 #3
0
        private void ShowInfo(int _id)
        {
            Model.wx_wq_chezhu model = bll.GetModel(_id);
            //获得品牌,车系,车型
            string pid = model.ppid.ToString();

            this.ddlPinpai.SelectedValue = pid;
            string cid = model.cxid.ToString();

            getChexi(MyCommFun.Str2Int(pid));
            this.ddlChexi.SelectedValue = cid;
            string cgid = model.cxingid.ToString();

            getChexing(MyCommFun.Str2Int(pid), MyCommFun.Str2Int(cgid));
            this.ddlChexing.SelectedValue = cgid;

            this.txtCpNum.Text         = model.cpNum;
            this.txtGcTime.Text        = model.gcdate.ToString();
            this.txtName.Text          = model.Name;
            this.txtPrevByDate.Text    = model.prevBydate.ToString();
            this.txtPrevByLicheng.Text = model.prevBylicheng.ToString();
            this.txtPrevByMoney.Text   = model.prevBymoney.ToString();
            this.txtPrevBxdate.Text    = model.prevNjdate.ToString();
            this.txtPrevBxMoney.Text   = model.prevBxmoney.ToString();
            this.txtPrevNjtime.Text    = model.prevBxdate.ToString();

            this.txtGcTime.Text = model.gcdate.ToString();
            this.txtSpTime.Text = model.spdate.ToString();
            this.txtTel.Text    = model.teltephone;
        }
예제 #4
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;
                }
            }
        }