Beispiel #1
0
        /// <summary>
        /// 获取预设车型列表
        /// </summary>
        /// <returns></returns>
        private IList <MTourCarType> GetTourCarTypeList()
        {
            IList <MTourCarType> list = new List <MTourCarType>();

            string[] tourCarTypeIdArr = Utils.GetFormValues(this.PresetBusType1.hideTourCarTypeIdClientID);
            string[] carTypeIdArr     = Utils.GetFormValues(this.PresetBusType1.hidCarTypeIdClientID);
            string[] carTypeNameArr   = Utils.GetFormValues(this.PresetBusType1.hidCarTypeNameClientID);
            string[] descArr          = Utils.GetFormValues(this.PresetBusType1.hidDescClientID);
            string[] seatNum          = Utils.GetFormValues(this.PresetBusType1.hidSeatNumClientID);
            if (tourCarTypeIdArr.Length > 0)
            {
                for (int i = 0; i < carTypeIdArr.Length; i++)
                {
                    if (carTypeIdArr[i].Trim() != "")
                    {
                        MTourCarType model = new MTourCarType();
                        model.TourCarTypeId = tourCarTypeIdArr[i];
                        model.CarTypeId     = carTypeIdArr[i];
                        model.CarTypeName   = carTypeNameArr[i];
                        model.Desc          = descArr[i];
                        model.SeatNum       = Utils.GetInt(seatNum[i]);
                        list.Add(model);
                    }
                }
            }
            return(list);
        }
        private string PageSave(string tourId)
        {
            string OperaterID = this.OperateID.Value;

            if (SiteUserInfo.UserId != OperaterID)
            {
                return(EyouSoft.Common.UtilsCommons.AjaxReturnJson("0", "你不是该计划的销售员,无法修改车型!"));
            }
            string msg = string.Empty;

            string[] CarTypeId     = Utils.GetFormValues(PresetBusType1.hidCarTypeIdClientID);
            string[] CarTypeName   = Utils.GetFormValues(PresetBusType1.hidCarTypeNameClientID);
            string[] Desc          = Utils.GetFormValues(PresetBusType1.hidDescClientID);
            string[] SeatNum       = Utils.GetFormValues(PresetBusType1.hidSeatNumClientID);
            string[] TourCarTypeId = Utils.GetFormValues(PresetBusType1.hideTourCarTypeIdClientID);
            EyouSoft.BLL.TourStructure.BTour bll  = new EyouSoft.BLL.TourStructure.BTour();
            IList <MTourCarType>             list = new List <MTourCarType>();

            if (CarTypeId.Length > 0)
            {
                for (int i = 0; i < CarTypeId.Length; i++)
                {
                    if (CarTypeName[i].ToString() != "")
                    {
                        MTourCarType model = new MTourCarType();
                        model.TourCarTypeId = TourCarTypeId[i].ToString();
                        model.SeatNum       = Utils.GetInt(SeatNum[i].ToString());
                        model.Desc          = Desc[i].ToString();
                        model.CarTypeName   = CarTypeName[i].ToString();
                        model.CarTypeId     = CarTypeId[i].ToString();
                        list.Add(model);
                    }
                }
            }
            if (!string.IsNullOrEmpty(msg))
            {
                return(EyouSoft.Common.UtilsCommons.AjaxReturnJson("0", msg));
            }
            else
            {
                if (bll.UpdateTourCarType(tourId, SiteUserInfo.Username, SiteUserInfo.UserId, list))
                {
                    return(EyouSoft.Common.UtilsCommons.AjaxReturnJson("1", "修改成功!"));
                }
                else
                {
                    return(EyouSoft.Common.UtilsCommons.AjaxReturnJson("0", "修改失败!"));
                }
            }
        }