/// <summary> /// 获取城市线路区域关系列表 /// </summary> /// <returns>返回城市线路区域关系列表</returns> public virtual IList <EyouSoft.Model.SystemStructure.SysCityAreaControl> GetSiteAreaControlList() { IList <EyouSoft.Model.SystemStructure.SysCityAreaControl> List = new List <EyouSoft.Model.SystemStructure.SysCityAreaControl>(); DbCommand dc = base.SystemStore.GetSqlStringCommand(Sql_SysSiteAreaControl_Select); using (IDataReader dr = DbHelper.ExecuteReader(dc, base.SystemStore)) { EyouSoft.Model.SystemStructure.SysCityAreaControl model = null; while (dr.Read()) { model = new EyouSoft.Model.SystemStructure.SysCityAreaControl(); if (!dr.IsDBNull(0)) { model.AreaId = dr.GetInt32(0); } model.AreaName = dr[1].ToString(); if (!dr.IsDBNull(2)) { model.CityId = dr.GetInt32(2); } model.CityName = dr[3].ToString(); if (!dr.IsDBNull(4)) { model.ProvinceId = dr.GetInt32(4); } model.ProvinceName = dr[5].ToString(); if (!dr.IsDBNull(6)) { model.SortId = dr.GetInt32(6); } if (!dr.IsDBNull(7)) { model.TourCount = dr.GetInt32(7); } if (!string.IsNullOrEmpty(dr["IsDefaultShow"].ToString()) && dr["IsDefaultShow"].ToString().Equals("1")) { model.IsDefaultShow = true; } else { model.IsDefaultShow = false; } List.Add(model); } } return(List); }
protected void btnSave_Click(object sender, EventArgs e) { IList <EyouSoft.Model.SystemStructure.SysCityAreaControl> modelList = new List <EyouSoft.Model.SystemStructure.SysCityAreaControl>(); string[] LongVal = Utils.GetFormValues("cbkName_国内长线"); string[] ShortVal = Utils.GetFormValues("cbkName_国内短线"); string[] OutVal = Utils.GetFormValues("cbkName_国际线"); //添加国内长线模块 if (LongVal != null && LongVal.Length > 0) { EyouSoft.Model.SystemStructure.SysCityAreaControl model = null; foreach (string LongM in LongVal) { model = new EyouSoft.Model.SystemStructure.SysCityAreaControl(); string[] strList = LongM.Split('_'); string[] areaInfo = strList[0].Split('|'); model.AreaId = int.Parse(areaInfo[0]); model.AreaName = areaInfo[1]; model.CityId = CityID; model.CityName = ""; if (strList[2] != null) { if (strList[2].ToString() == "1") { model.IsDefaultShow = true; } else { model.IsDefaultShow = false; } } else { model.IsDefaultShow = false; } model.ProvinceId = ProvinceID; model.ProvinceName = ""; model.RouteType = EyouSoft.Model.SystemStructure.AreaType.国内长线; if (strList[1] != null && StringValidate.IsInteger(strList[1].ToString())) { model.SortId = int.Parse(strList[1].ToString()); } else { model.SortId = 0; } model.TourCount = 0; modelList.Add(model); } } //添加国内短线模块 if (ShortVal != null && ShortVal.Length > 0) { EyouSoft.Model.SystemStructure.SysCityAreaControl model = null; foreach (string ShortM in ShortVal) { model = new EyouSoft.Model.SystemStructure.SysCityAreaControl(); string[] strList = ShortM.Split('_'); string[] areaInfo = strList[0].Split('|'); model.AreaId = int.Parse(areaInfo[0]); model.AreaName = areaInfo[1]; model.CityId = CityID; model.CityName = ""; if (strList[2] != null) { if (strList[2].ToString() == "1") { model.IsDefaultShow = true; } else { model.IsDefaultShow = false; } } else { model.IsDefaultShow = false; } model.ProvinceId = ProvinceID; model.ProvinceName = ""; model.RouteType = EyouSoft.Model.SystemStructure.AreaType.国内短线; if (strList[1] != null && StringValidate.IsInteger(strList[1].ToString())) { model.SortId = int.Parse(strList[1].ToString()); } else { model.SortId = 0; } model.TourCount = 0; modelList.Add(model); } } //添加国际线模块 if (OutVal != null && OutVal.Length > 0) { EyouSoft.Model.SystemStructure.SysCityAreaControl model = null; foreach (string OutM in OutVal) { model = new EyouSoft.Model.SystemStructure.SysCityAreaControl(); string[] strList = OutM.Split('_'); string[] areaInfo = strList[0].Split('|'); model.AreaId = int.Parse(areaInfo[0]); model.AreaName = areaInfo[1]; model.CityId = CityID; model.CityName = ""; if (strList[2] != null) { if (strList[2].ToString() == "1") { model.IsDefaultShow = true; } else { model.IsDefaultShow = false; } } else { model.IsDefaultShow = false; } model.ProvinceId = ProvinceID; model.ProvinceName = ""; model.RouteType = EyouSoft.Model.SystemStructure.AreaType.国际线; if (strList[1] != null && StringValidate.IsInteger(strList[1].ToString())) { model.SortId = int.Parse(strList[1].ToString()); } else { model.SortId = 0; } model.TourCount = 0; modelList.Add(model); } } //执行操作 EyouSoft.BLL.SystemStructure.SysCity.CreateInstance().UpdateSysSiteAreaControl(CityID, modelList); //释放资源 modelList = null; MessageBox.ShowAndRedirect(this, "设置线路区域成功!", "ChooseRouteAgency.aspx?CityID=" + CityID); }