public Model.Sys_Organization DataRowToModel(System.Data.DataRow row)
 {
     TDTK.PlatForm.MVC4.Model.Sys_Organization model = new TDTK.PlatForm.MVC4.Model.Sys_Organization();
     if (row != null)
     {
         if (row["OrgCode"] != null)
         {
             model.OrgCode = row["OrgCode"].ToString();
         }
         if (row["OrgName"] != null)
         {
             model.OrgName = row["OrgName"].ToString();
         }
         if (row["OrgLevel"] != null)
         {
             model.OrgLevel = row["OrgLevel"].ToString();
         }
         if (row["ParentOrgCode"] != null)
         {
             model.ParentOrgCode = row["ParentOrgCode"].ToString();
         }
         if (row["OrgSeq"] != null)
         {
             model.OrgSeq = row["OrgSeq"].ToString();
         }
         if (row["OrgType"] != null)
         {
             model.OrgType = row["OrgType"].ToString();
         }
         if (row["LinkMan"] != null)
         {
             model.LinkMan = row["LinkMan"].ToString();
         }
         if (row["LinkManTel"] != null)
         {
             model.LinkManTel = row["LinkManTel"].ToString();
         }
         if (row["Email"] != null)
         {
             model.Email = row["Email"].ToString();
         }
         if (row["IsForbid"] != null)
         {
             model.IsForbid = row["IsForbid"].ToString();
         }
         if (row["Remark"] != null)
         {
             model.Remark = row["Remark"].ToString();
         }
         if (row["SysCode"] != null)
         {
             model.SysCode = row["SysCode"].ToString();
         }
     }
     return model;
 }
        public Model.Sys_Organization GetModel(Model.Sys_Organization t)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 OrgCode,OrgName,OrgLevel,ParentOrgCode,OrgSeq,OrgType,LinkMan,LinkManTel,Email,IsForbid,Remark,SysCode from Sys_Organization ");
            strSql.Append(" where OrgCode=@OrgCode ");
            SqlParameter[] parameters = {
					new SqlParameter("@OrgCode", SqlDbType.VarChar,10)			};
            parameters[0].Value = t.OrgCode;

            TDTK.PlatForm.MVC4.Model.Sys_Organization model = new TDTK.PlatForm.MVC4.Model.Sys_Organization();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }