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

               				                				                   TextBox_TypeNameCN.Text = _ArticleTypeEntity.TypeNameCN.ToString();
                                				                   TextBox_TypeNameEN.Text = _ArticleTypeEntity.TypeNameEN.ToString();
                                				                   TextBox_IconUrl.Text = _ArticleTypeEntity.IconUrl.ToString();
                                				                   TextBox_LinkUrl.Text = _ArticleTypeEntity.LinkUrl.ToString();
                                				                   TextBox_IsEnable.Text = _ArticleTypeEntity.IsEnable.ToString();
                                				                   TextBox_DisplayIndex.Text = _ArticleTypeEntity.DisplayIndex.ToString();
                                				                   TextBox_ParentID.Text = _ArticleTypeEntity.ParentID.ToString();
                                				                   TextBox_OwerID.Text = _ArticleTypeEntity.OwerID.ToString();
                                				                				                            }
        }
        private MideFrameWork.Data.Entity.ArticleTypeEntity GetArticleType(DataRow dr)
        {
            MideFrameWork.Data.Entity.ArticleTypeEntity info = new MideFrameWork.Data.Entity.ArticleTypeEntity();
										if(DBNull.Value==dr["ID"])
					info.ID=0;
				else
					info.ID=int.Parse(dr["ID"].ToString());
									
																								
						if(DBNull.Value==dr["TypeNameCN"])
				info.TypeNameCN= string.Empty;
			else	
				info.TypeNameCN= dr["TypeNameCN"].ToString();
																								
						if(DBNull.Value==dr["TypeNameEN"])
				info.TypeNameEN= string.Empty;
			else	
				info.TypeNameEN= dr["TypeNameEN"].ToString();
																								
						if(DBNull.Value==dr["IconUrl"])
				info.IconUrl= string.Empty;
			else	
				info.IconUrl= dr["IconUrl"].ToString();
																								
						if(DBNull.Value==dr["LinkUrl"])
				info.LinkUrl= string.Empty;
			else	
				info.LinkUrl= dr["LinkUrl"].ToString();
																						if(DBNull.Value==dr["IsEnable"])
					info.IsEnable=0;
				else
					info.IsEnable=int.Parse(dr["IsEnable"].ToString());
									
																						if(DBNull.Value==dr["DisplayIndex"])
					info.DisplayIndex=0;
				else
					info.DisplayIndex=int.Parse(dr["DisplayIndex"].ToString());
									
																						if(DBNull.Value==dr["ParentID"])
					info.ParentID=0;
				else
					info.ParentID=int.Parse(dr["ParentID"].ToString());
									
																						if(DBNull.Value==dr["OwerID"])
					info.OwerID=0;
				else
					info.OwerID=int.Parse(dr["OwerID"].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 ArticleTypeAdd()
        {
            #region 判断是否可空
		 
                                                                          
                  var _TypeNameCN = Request.Form["TextBox_TypeNameCN"];
                 if (string.IsNullOrEmpty(_TypeNameCN))
                   {
                        Alert("[ 中文名称 ]不能为空");
                        return;
                  }
				                                           
                  var _TypeNameEN = Request.Form["TextBox_TypeNameEN"];
                 if (string.IsNullOrEmpty(_TypeNameEN))
                   {
                        Alert("[ 英文名称 ]不能为空");
                        return;
                  }
				                                           
                  var _IconUrl = Request.Form["TextBox_IconUrl"];
                 if (string.IsNullOrEmpty(_IconUrl))
                   {
                        Alert("[ 图标路径 ]不能为空");
                        return;
                  }
				                                           
                  var _LinkUrl = Request.Form["TextBox_LinkUrl"];
                 if (string.IsNullOrEmpty(_LinkUrl))
                   {
                        Alert("[ 连接地址 ]不能为空");
                        return;
                  }
				                                           
                  var _IsEnable = Request.Form["TextBox_IsEnable"];
                 if (string.IsNullOrEmpty(_IsEnable))
                   {
                        Alert("[ 是否启用 ]不能为空");
                        return;
                  }
				                                           
                  var _DisplayIndex = Request.Form["TextBox_DisplayIndex"];
                 if (string.IsNullOrEmpty(_DisplayIndex))
                   {
                        Alert("[ 显示顺序 ]不能为空");
                        return;
                  }
				                                           
                  var _ParentID = Request.Form["TextBox_ParentID"];
                 if (string.IsNullOrEmpty(_ParentID))
                   {
                        Alert("[ 父ID ]不能为空");
                        return;
                  }
				                                           
                  var _OwerID = Request.Form["TextBox_OwerID"];
                 if (string.IsNullOrEmpty(_OwerID))
                   {
                        Alert("[ 所属用户ID ]不能为空");
                        return;
                  }
				                                                                                
	        #endregion
           
            #region 获取数据

            ArticleTypeEntity  _ArticleTypeEntity = new ArticleTypeEntity();
            
               		                               	  		                            
                 	                 	                
                    _ArticleTypeEntity.TypeNameCN =Convert.ToString(_TypeNameCN.ToString());
               		                        	  		                            
                 	                 	                
                    _ArticleTypeEntity.TypeNameEN =Convert.ToString(_TypeNameEN.ToString());
               		                        	  		                            
                 	                 	                
                    _ArticleTypeEntity.IconUrl =Convert.ToString(_IconUrl.ToString());
               		                        	  		                            
                 	                 	                
                    _ArticleTypeEntity.LinkUrl =Convert.ToString(_LinkUrl.ToString());
               		                        	  		                            
                 	                 	                     _ArticleTypeEntity.IsEnable =Convert.ToInt32(_IsEnable.ToString());
                	                        	  		                            
                 	                 	                     _ArticleTypeEntity.DisplayIndex =Convert.ToInt32(_DisplayIndex.ToString());
                	                        	  		                            
                 	                 	                     _ArticleTypeEntity.ParentID =Convert.ToInt32(_ParentID.ToString());
                	                        	  		                            
                 	                 	                     _ArticleTypeEntity.OwerID =Convert.ToInt32(_OwerID.ToString());
                	                        	  		        
		       	_ArticleTypeEntity.CreateDate =DateTime.Now;
		               	  		        
		       	_ArticleTypeEntity.UpdateDate =DateTime.Now;
		               	              try
            {
                DataProvider.GetInstance().AddArticleType(_ArticleTypeEntity);
            }
            catch
            {
                WriteLog("ArticleTypeAdd", "添加ArticleType", "插入数据库时出错", Common.DailyUtility.MideSmsType.LogType.SystemLog);
                Alert("添加数据时出错,请重试");
                return;
            }
            Alert("添加ArticleType成功");
        }