/// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Danyl.SnnuURP.Model.TeacherWageAdjustmentView DataRowToModel(DataRow row)
 {
     Danyl.SnnuURP.Model.TeacherWageAdjustmentView model = new Danyl.SnnuURP.Model.TeacherWageAdjustmentView();
     if (row != null)
     {
         if (row["Id"] != null && row["Id"].ToString() != "")
         {
             model.Id = int.Parse(row["Id"].ToString());
         }
         if (row["Tid"] != null && row["Tid"].ToString() != "")
         {
             model.Tid = int.Parse(row["Tid"].ToString());
         }
         if (row["Tname"] != null)
         {
             model.Tname = row["Tname"].ToString();
         }
         if (row["Sex"] != null && row["Sex"].ToString() != "")
         {
             if ((row["Sex"].ToString() == "1") || (row["Sex"].ToString().ToLower() == "true"))
             {
                 model.Sex = true;
             }
             else
             {
                 model.Sex = false;
             }
         }
         if (row["IdNumber"] != null)
         {
             model.IdNumber = row["IdNumber"].ToString();
         }
         if (row["TeacherTypeId"] != null && row["TeacherTypeId"].ToString() != "")
         {
             model.TeacherTypeId = int.Parse(row["TeacherTypeId"].ToString());
         }
         if (row["Degree"] != null)
         {
             model.Degree = row["Degree"].ToString();
         }
         if (row["DeptName"] != null)
         {
             model.DeptName = row["DeptName"].ToString();
         }
         if (row["NewSalary"] != null && row["NewSalary"].ToString() != "")
         {
             model.NewSalary = decimal.Parse(row["NewSalary"].ToString());
         }
         if (row["OldSalary"] != null && row["OldSalary"].ToString() != "")
         {
             model.OldSalary = decimal.Parse(row["OldSalary"].ToString());
         }
         if (row["BasicWage"] != null && row["BasicWage"].ToString() != "")
         {
             model.BasicWage = decimal.Parse(row["BasicWage"].ToString());
         }
         if (row["JobSubsidies"] != null && row["JobSubsidies"].ToString() != "")
         {
             model.JobSubsidies = decimal.Parse(row["JobSubsidies"].ToString());
         }
         if (row["PersonalIncomeTax"] != null)
         {
             model.PersonalIncomeTax = row["PersonalIncomeTax"].ToString();
         }
     }
     return model;
 }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Danyl.SnnuURP.Model.TeacherWageAdjustmentView GetModel(int Id)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 Id,Tid,Tname,Sex,IdNumber,TeacherTypeId,Degree,DeptName,NewSalary,OldSalary,BasicWage,JobSubsidies,PersonalIncomeTax from TeacherWageAdjustmentView ");
            strSql.Append(" where Id=@Id ");
            SqlParameter[] parameters = {
                    new SqlParameter("@Id", SqlDbType.Int,4)            };
            parameters[0].Value = Id;

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