protected void init_form(string ctrID)
        {
            if (!string.IsNullOrEmpty(ctrID))
            {
                _WebSiteManagementEntity = DataProvider.GetInstance().GetWebSiteManagementEntity(int.Parse(ctrID));

               				                				                   TextBox_WebSiteName.Text = _WebSiteManagementEntity.WebSiteName.ToString();
                                				                   TextBox_MetaKeywords.Text = _WebSiteManagementEntity.MetaKeywords.ToString();
                                				                   TextBox_MetaDescriptions.Text = _WebSiteManagementEntity.MetaDescriptions.ToString();
                                				                   TextBox_AdvPopupScript.Text = _WebSiteManagementEntity.AdvPopupScript.ToString();
                                				                   TextBox_OwnerID.Text = _WebSiteManagementEntity.OwnerID.ToString();
                                				                				                            }
        }
        private MideFrameWork.Data.Entity.WebSiteManagementEntity GetWebSiteManagement(DataRow dr)
        {
            MideFrameWork.Data.Entity.WebSiteManagementEntity info = new MideFrameWork.Data.Entity.WebSiteManagementEntity();
										if(DBNull.Value==dr["ID"])
					info.ID=0;
				else
					info.ID=int.Parse(dr["ID"].ToString());
									
																								
						if(DBNull.Value==dr["WebSiteName"])
				info.WebSiteName= string.Empty;
			else	
				info.WebSiteName= dr["WebSiteName"].ToString();
																								
						if(DBNull.Value==dr["MetaKeywords"])
				info.MetaKeywords= string.Empty;
			else	
				info.MetaKeywords= dr["MetaKeywords"].ToString();
																								
						if(DBNull.Value==dr["MetaDescriptions"])
				info.MetaDescriptions= string.Empty;
			else	
				info.MetaDescriptions= dr["MetaDescriptions"].ToString();
																								
						if(DBNull.Value==dr["AdvPopupScript"])
				info.AdvPopupScript= string.Empty;
			else	
				info.AdvPopupScript= dr["AdvPopupScript"].ToString();
																						if(DBNull.Value==dr["OwnerID"])
					info.OwnerID=0;
				else
					info.OwnerID=int.Parse(dr["OwnerID"].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;
        }
        protected void WebSiteManagementAdd()
        {
            #region 判断是否可空
		 
                                                                          
                  var _WebSiteName = Request.Form["TextBox_WebSiteName"];
                 if (string.IsNullOrEmpty(_WebSiteName))
                   {
                        Alert("[ 网站名称 ]不能为空");
                        return;
                  }
				                                           
                  var _MetaKeywords = Request.Form["TextBox_MetaKeywords"];
                 if (string.IsNullOrEmpty(_MetaKeywords))
                   {
                        Alert("[ Meta关键字 ]不能为空");
                        return;
                  }
				                                           
                  var _MetaDescriptions = Request.Form["TextBox_MetaDescriptions"];
                 if (string.IsNullOrEmpty(_MetaDescriptions))
                   {
                        Alert("[ Meta描述 ]不能为空");
                        return;
                  }
				                                           
                  var _AdvPopupScript = Request.Form["TextBox_AdvPopupScript"];
                 if (string.IsNullOrEmpty(_AdvPopupScript))
                   {
                        Alert("[ 广告脚本 ]不能为空");
                        return;
                  }
				                                           
                  var _OwnerID = Request.Form["TextBox_OwnerID"];
                 if (string.IsNullOrEmpty(_OwnerID))
                   {
                        Alert("[ 拥有者ID ]不能为空");
                        return;
                  }
				                                                                                
	        #endregion
           
            #region 获取数据

            WebSiteManagementEntity  _WebSiteManagementEntity = new WebSiteManagementEntity();
            
               		                               	  		                            
                 	                 	                
                    _WebSiteManagementEntity.WebSiteName =Convert.ToString(_WebSiteName.ToString());
               		                        	  		                            
                 	                 	                
                    _WebSiteManagementEntity.MetaKeywords =Convert.ToString(_MetaKeywords.ToString());
               		                        	  		                            
                 	                 	                
                    _WebSiteManagementEntity.MetaDescriptions =Convert.ToString(_MetaDescriptions.ToString());
               		                        	  		                            
                 	                 	                
                    _WebSiteManagementEntity.AdvPopupScript =Convert.ToString(_AdvPopupScript.ToString());
               		                        	  		                            
                 	                 	                     _WebSiteManagementEntity.OwnerID =Convert.ToInt32(_OwnerID.ToString());
                	                        	  		        
		       	_WebSiteManagementEntity.CreateDate =DateTime.Now;
		               	  		        
		       	_WebSiteManagementEntity.UpdateDate =DateTime.Now;
		               	              try
            {
                DataProvider.GetInstance().AddWebSiteManagement(_WebSiteManagementEntity);
            }
            catch
            {
                WriteLog("WebSiteManagementAdd", "添加WebSiteManagement", "插入数据库时出错", Common.DailyUtility.MideSmsType.LogType.SystemLog);
                Alert("添加数据时出错,请重试");
                return;
            }
            Alert("添加WebSiteManagement成功");
        }