예제 #1
0
        /// <summary>
        /// 获取所有的长短线区域城市关系
        /// </summary>
        /// <returns>长短线区域城市关系实体集合</returns>
        public virtual IList <Model.SystemStructure.SysAreaSiteControl> GetSysAreaSiteControl()
        {
            IList <Model.SystemStructure.SysAreaSiteControl> List = new List <Model.SystemStructure.SysAreaSiteControl>();
            DbCommand dc = base.SystemStore.GetSqlStringCommand(Sql_SysAreaSiteControl_Select);

            using (IDataReader dr = DbHelper.ExecuteReader(dc, base.SystemStore))
            {
                Model.SystemStructure.SysAreaSiteControl model = null;
                while (dr.Read())
                {
                    model = new EyouSoft.Model.SystemStructure.SysAreaSiteControl();

                    if (!dr.IsDBNull(dr.GetOrdinal("ProvinceId")))
                    {
                        model.ProvinceId = int.Parse(dr["ProvinceId"].ToString());
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("CityId")))
                    {
                        model.CityId = int.Parse(dr["CityId"].ToString());
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("AreaId")))
                    {
                        model.AreaId = int.Parse(dr["AreaId"].ToString());
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("AreaType")))
                    {
                        model.RouteType = (Model.SystemStructure.AreaType) int.Parse(dr["AreaType"].ToString());
                    }
                    model.AreaName = dr["AreaName"].ToString();

                    List.Add(model);
                }
            }
            return(List);
        }
예제 #2
0
 protected void btn_SaveShortArea_Click(object sender, EventArgs e)
 {
     if (EditFlag)
     {
         string[] areaID     = this.AreaList1.GetShortckvalues;
         string   Pro_CityID = Utils.GetFormValue("hdCityID");
         string[] pro_city   = Pro_CityID.Split('|');
         IList <EyouSoft.Model.SystemStructure.SysAreaSiteControl> sysAreaList = new List <EyouSoft.Model.SystemStructure.SysAreaSiteControl>();
         if (areaID != null && areaID.Length > 0)
         {
             EyouSoft.Model.SystemStructure.SysAreaSiteControl model = null;
             foreach (string aInfo in areaID)
             {
                 model = new EyouSoft.Model.SystemStructure.SysAreaSiteControl();
                 string[] aIdInfo = aInfo.Split('|');
                 if (!string.IsNullOrEmpty(Pro_CityID))
                 {
                     model.ProvinceId = int.Parse(pro_city[0]);
                     model.CityId     = int.Parse(pro_city[1]);
                     model.AreaId     = int.Parse(aIdInfo[0]);
                     model.AreaName   = aIdInfo[1];
                     model.RouteType  = EyouSoft.Model.SystemStructure.AreaType.国内短线;
                     sysAreaList.Add(model);
                 }
             }
             EyouSoft.BLL.SystemStructure.SysArea.CreateInstance().AddSysAreaSiteControl(sysAreaList);
             if (pro_city != null && pro_city.Length > 1)
             {
                 MessageBox.ResponseScript(this, "alert('操作成功!');SetClass('" + pro_city[0] + "','" + pro_city[1] + "',1);ShowAreaAndCompany('" + pro_city[0] + "','" + pro_city[1] + "',1);");
             }
         }
         else
         {
             MessageBox.ResponseScript(this, "alert('请先选择您要设置的省份城市和线路区域!');");
         }
         //释放资源
         sysAreaList = null;
     }
     else
     {
         Utils.ResponseNoPermit(YuYingPermission.平台管理_线路区域分类, true);
     }
 }