protected void init_form(string ctrID)
        {
            IList<WG_ServiceIntentionEntity> regionList = DataProvider.GetInstance().GetWG_ServiceIntentionList(" 1 = 1 ");

            if (!string.IsNullOrEmpty(ctrID))
            {
                _WG_ServiceIntentionEntity = DataProvider.GetInstance().GetWG_ServiceIntentionEntity(int.Parse(ctrID));

                _WG_ServiceIntentionEntity_parent = DataProvider.GetInstance().GetWG_ServiceIntentionEntity(_WG_ServiceIntentionEntity.ParentID);

            }
            if (!IsPostBack)
            {
                //初始化父菜单
                //var parentIdDataSource = from parentIdTabels in regionList where parentIdTabels.ParentID == 0 select parentIdTabels;
                var parentIdDataSource = from parentIdTabels in regionList where 1 == 1 select parentIdTabels;
                DropDownList_parentId.DataSource = parentIdDataSource;
                DropDownList_parentId.DataTextField = "Content";
                DropDownList_parentId.DataValueField = "ID";
                DropDownList_parentId.DataBind();
                DropDownList_parentId.Items.Insert(0, new ListItem("全部", "0"));


            }
            #region 编辑
            if (!string.IsNullOrEmpty(ctrID))
            {
                if (_WG_ServiceIntentionEntity_parent != null)
                {
                    DropDownList_parentId.ClearSelection();
                    DropDownList_parentId.Items.FindByText(_WG_ServiceIntentionEntity_parent.Content).Selected = true;
                }
                TextBox_Content.Text = _WG_ServiceIntentionEntity.Content.ToString();
            }
            #endregion
        }
        protected void WG_ServiceIntentionAdd()
        {
            #region 判断是否可空


            var _ParentID = DropDownList_parentId.SelectedItem.Value;
            if (string.IsNullOrEmpty(_ParentID))
            {
                Alert("[ 父ID ]不能为空");
                return;
            }

            var _Content = Request.Form["TextBox_Content"];
            if (string.IsNullOrEmpty(_Content))
            {
                Alert("[ 意向名称 ]不能为空");
                return;
            }

            #endregion

            #region 获取数据

            WG_ServiceIntentionEntity _WG_ServiceIntentionEntity = new WG_ServiceIntentionEntity();


            _WG_ServiceIntentionEntity.ParentID = Convert.ToInt32(_ParentID.ToString());


            _WG_ServiceIntentionEntity.Content = Convert.ToString(_Content.ToString());

            _WG_ServiceIntentionEntity.CreateDate = DateTime.Now;

            _WG_ServiceIntentionEntity.UpdateDate = DateTime.Now;
            try
            {
                DataProvider.GetInstance().AddWG_ServiceIntention(_WG_ServiceIntentionEntity);
            }
            catch
            {
                WriteLog("WG_ServiceIntentionAdd", "添加WG_ServiceIntention", "插入数据库时出错", Common.DailyUtility.MideSmsType.LogType.SystemLog);
                Alert("添加数据时出错,请重试");
                return;
            }
            Alert("添加WG_ServiceIntention成功");
        }
        private MideFrameWork.Data.Entity.WG_ServiceIntentionEntity GetWG_ServiceIntention(DataRow dr)
        {
            MideFrameWork.Data.Entity.WG_ServiceIntentionEntity info = new MideFrameWork.Data.Entity.WG_ServiceIntentionEntity();
										if(DBNull.Value==dr["ID"])
					info.ID=0;
				else
					info.ID=int.Parse(dr["ID"].ToString());
									
																						if(DBNull.Value==dr["ParentID"])
					info.ParentID=0;
				else
					info.ParentID=int.Parse(dr["ParentID"].ToString());
									
																								
						if(DBNull.Value==dr["Content"])
				info.Content= string.Empty;
			else	
				info.Content= dr["Content"].ToString();
																									if(DBNull.Value==dr["CreateDate"])
					info.CreateDate=DateTime.Now;
				else
					info.CreateDate=DateTime.Parse(dr["CreateDate"].ToString());
						
																									if(DBNull.Value==dr["UpdateDate"])
					info.UpdateDate=DateTime.Now;
				else
					info.UpdateDate=DateTime.Parse(dr["UpdateDate"].ToString());
						
															            return info;
        }