Esempio n. 1
0
        /// <summary>
        /// 页面初始化
        /// </summary>
        private void PageInit()
        {
            //获取查询条件
            string txtsearch = Utils.GetFormValue("txtSearch");

            //获取分页参数并强转
            pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1);
            IList <EyouSoft.Model.ComStructure.MComCarLocation> list = new EyouSoft.BLL.ComStructure.BComCarLocation().GetList(pageIndex, pageSize, ref recordCount, SiteUserInfo.CompanyId, null, txtsearch);

            if (list != null && list.Count > 0)
            {
                repList.DataSource = list;
                repList.DataBind();
                //绑定分页
                BindPage();
            }
            else
            {
                repList.DataSource = null;
                repList.DataBind();
                this.ExporPageInfoSelect1.Visible = false;
            }
            //释放
            list = null;
        }
Esempio n. 2
0
        /// <summary>
        /// 删除上车地点
        /// </summary>
        private void DelCarPlace()
        {
            string CarPlaceId = Utils.GetQueryStringValue("id");
            int    i          = new EyouSoft.BLL.ComStructure.BComCarLocation().DelCarLocation(CarPlaceId);

            if (i == 1)
            {
                AjaxResponse(UtilsCommons.AjaxReturnJson("1", "删除成功!"));
            }
            else if (i == 2)
            {
                AjaxResponse(UtilsCommons.AjaxReturnJson("0", "该上车地点已被计划使用!"));
            }
            else
            {
                AjaxResponse(UtilsCommons.AjaxReturnJson("0", "删除失败!"));
            }
        }
Esempio n. 3
0
 /// <summary>
 /// 页面初始化
 /// </summary>
 protected void PageInit()
 {
     if (!string.IsNullOrEmpty(Id))
     {
         EyouSoft.Model.ComStructure.MComCarLocation model = new EyouSoft.BLL.ComStructure.BComCarLocation().GetModel(Id);
         this.txtCarPlace.Text  = model.Location;
         this.txtJiePrice.Text  = Utils.FilterEndOfTheZeroDecimal(model.OnPrice);
         this.txtSongPrice.Text = Utils.FilterEndOfTheZeroDecimal(model.OffPrice);
         this.txtDescribe.Text  = model.Desc;
         if (model.Status)
         {
             this.rbtnStatus1.Checked = true;
         }
         else
         {
             this.rbtnStatus0.Checked = true;
         }
     }
 }
Esempio n. 4
0
        private void InitPage()
        {
            EyouSoft.BLL.ComStructure.BComCarLocation BLL = new EyouSoft.BLL.ComStructure.BComCarLocation();
            string strLocation = Utils.GetQueryStringValue("text");

            pageIndex = Utils.GetInt(Utils.GetQueryStringValue("Page"), 1);
            IList <EyouSoft.Model.ComStructure.MComCarLocation> list = BLL.GetList(pageIndex, pageSize, ref recordCount, SiteUserInfo.CompanyId, true, strLocation);

            if (list != null && list.Count > 0)
            {
                this.rpt_PickUpPoint.DataSource = list;
                this.rpt_PickUpPoint.DataBind();
                BindPage();
            }
            else
            {
                this.rpt_PickUpPoint.Controls.Add(new Label()
                {
                    Text = "<tr><td colspan='5' align='center'>暂无数据</td></tr>"
                });
                this.ExporPageInfoSelect1.Visible = false;
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 保存
        /// </summary>
        private void Save()
        {
            EyouSoft.Model.ComStructure.MComCarLocation model = new EyouSoft.Model.ComStructure.MComCarLocation();
            model.CarLocationId = Id;
            model.Location      = Utils.GetFormValue(txtCarPlace.UniqueID);
            model.OnPrice       = Utils.GetDecimal(Utils.GetFormValue(txtJiePrice.UniqueID));
            model.OffPrice      = Utils.GetDecimal(Utils.GetFormValue(txtSongPrice.UniqueID));
            model.Desc          = Utils.GetFormValue(txtDescribe.UniqueID);
            model.CompanyId     = CurrentUserCompanyID;
            model.Operator      = SiteUserInfo.Username;
            model.OperatorId    = SiteUserInfo.UserId;
            if (this.rbtnStatus1.Checked == true)
            {
                model.Status = true;
            }
            else
            {
                model.Status = false;
            }
            if (string.IsNullOrEmpty(Id))
            {
                if (new EyouSoft.BLL.ComStructure.BComCarLocation().AddCarLocation(model))
                {
                    AjaxResponse(UtilsCommons.AjaxReturnJson("1", "添加成功"));
                }
                else
                {
                    AjaxResponse(UtilsCommons.AjaxReturnJson("0", "添加失败"));
                }
            }
            else
            {
                EyouSoft.Model.ComStructure.MComCarLocation m = new EyouSoft.BLL.ComStructure.BComCarLocation().GetModel(Id);
                //只修改状态
                if (IsSame(model.Location, m.Location) && IsSame(Utils.FilterEndOfTheZeroDecimal(model.OnPrice), Utils.FilterEndOfTheZeroDecimal(m.OnPrice)) && IsSame(Utils.FilterEndOfTheZeroDecimal(model.OffPrice), Utils.FilterEndOfTheZeroDecimal(m.OffPrice)) && IsSame(model.Desc, m.Desc) && !IsSame(model.Status.ToString(), m.Status.ToString()))
                {
                    if (new EyouSoft.BLL.ComStructure.BComCarLocation().UpdateCarLocation(Id, model.Status))
                    {
                        AjaxResponse(UtilsCommons.AjaxReturnJson("1", "修改成功"));
                    }
                    else
                    {
                        AjaxResponse(UtilsCommons.AjaxReturnJson("0", "修改失败"));
                    }
                }
                //修改其他信息
                else
                {
                    int updatestate = new EyouSoft.BLL.ComStructure.BComCarLocation().UpdateCarLocation(model);
                    switch (updatestate)
                    {
                    case 1:
                        AjaxResponse(UtilsCommons.AjaxReturnJson("1", "修改成功"));
                        break;

                    case 2:
                        AjaxResponse(UtilsCommons.AjaxReturnJson("0", "该地点已被使用,无法修改"));
                        break;

                    default:
                        AjaxResponse(UtilsCommons.AjaxReturnJson("0", "修改失败"));
                        break;
                    }
                }
            }
        }