public Model.TT_CollBalance DataRowToModel(System.Data.DataRow row)
 {
     TDTK.PlatForm.MVC4.Model.TT_CollBalance model = new TDTK.PlatForm.MVC4.Model.TT_CollBalance();
     if (row != null)
     {
         if (row["BalanceID"] != null && row["BalanceID"].ToString() != "")
         {
             model.BalanceID = long.Parse(row["BalanceID"].ToString());
         }
         if (row["CollCode"] != null)
         {
             model.CollCode = row["CollCode"].ToString();
         }
         if (row["BalanceDate"] != null && row["BalanceDate"].ToString() != "")
         {
             model.BalanceDate = DateTime.Parse(row["BalanceDate"].ToString());
         }
         if (row["CollAccount"] != null && row["CollAccount"].ToString() != "")
         {
             model.CollAccount = decimal.Parse(row["CollAccount"].ToString());
         }
         if (row["Operator"] != null)
         {
             model.Operator = row["Operator"].ToString();
         }
     }
     return model;
 }
        public Model.TT_CollBalance GetModel(Model.TT_CollBalance t)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 BalanceID,CollCode,BalanceDate,CollAccount,Operator from TT_CollBalance ");
            strSql.Append(" where BalanceID=@BalanceID");
            SqlParameter[] parameters = {
					new SqlParameter("@BalanceID", SqlDbType.BigInt)
			};
            parameters[0].Value = t.BalanceID;

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