using System; using System.Data; using System.Data.SqlClient; using DSWeb.Models; using WebSqlHelper; namespace DSWeb.EntityDA { public class InvoiceVerificationDA { private const string PARM_INVOICE_VERIFICATION_GID = "@gid"; private const string PARM_INVOICE_VERIFICATION_INVOICE_ID = "@invoice_id"; private const string PARM_INVOICE_VERIFICATION_SETTLEMENT_ID = "@settlement_id"; private const string PARM_INVOICE_VERIFICATION_CREATE_USER = "@create_user"; private const string PARM_INVOICE_VERIFICATION_CREATE_TIME = "@create_time"; private const string PARM_INVOICE_VERIFICATION_MODIFIED_USER = "@modified_user"; private const string PARM_INVOICE_VERIFICATION_MODIFIED_TIME = "@modified_time"; private const string PARM_INVOICE_VERIFICATION_REMARK = "@remark"; private const string PARM_INVOICE_VERIFICATION_IS_DELETE = "@is_delete"; private const string PARM_INVOICE_VERIFICATION_AMOUNT = "@amount"; private const string PARM_INVOICE_VERIFICATION_DO_AMOUNT = "@do_amount"; private const string SQL_SELECT_INVOICE_VERIFICATION_BY_GID = " SELECT GID, INVOICEID, SETTLEMENTID, CREATEUSER, CREATETIME, MODIFIEDUSER, MODIFIEDTIME, REMARK, ISDELETE, AMOUNT, DOAMOUNT, DELETEUSER, DELETETIME " + " FROM ch_fee_invoiceverification WHERE GID = @gid "; public InvoiceVerificationEntity GetInvoiceVerificationByGID(string tempInvoiceVerificationID) { InvoiceVerificationEntity invoiceVerificationEntity = null; SqlParameter parm = new SqlParameter(PARM_INVOICE_VERIFICATION_GID, SqlDbType.VarChar, 36); parm.Value = tempInvoiceVerificationID; using (SqlDataReader sqlRead = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, SQL_SELECT_INVOICE_VERIFICATION_BY_GID, parm)) { try { while (sqlRead.Read()) { invoiceVerificationEntity = new InvoiceVerificationEntity(); if (!sqlRead.IsDBNull(0)) { invoiceVerificationEntity.GID = sqlRead.GetString(0); } if (!sqlRead.IsDBNull(1)) { invoiceVerificationEntity.InvoiceID = sqlRead.GetString(1); } if (!sqlRead.IsDBNull(2)) { invoiceVerificationEntity.SettlementID = sqlRead.GetString(2); } if (!sqlRead.IsDBNull(3)) { invoiceVerificationEntity.CreateUser = sqlRead.GetString(3); } if (!sqlRead.IsDBNull(4)) { invoiceVerificationEntity.CreateTime = sqlRead.GetDateTime(4); } if (!sqlRead.IsDBNull(5)) { invoiceVerificationEntity.ModifiedUser = sqlRead.GetString(5); } if (!sqlRead.IsDBNull(6)) { invoiceVerificationEntity.ModifiedTime = sqlRead.GetDateTime(6); } if (!sqlRead.IsDBNull(7)) { invoiceVerificationEntity.Remark = sqlRead.GetString(7); } if (!sqlRead.IsDBNull(8)) { invoiceVerificationEntity.IsDelete = sqlRead.GetBoolean(8); } if (!sqlRead.IsDBNull(9)) { invoiceVerificationEntity.Amount = sqlRead.GetDecimal(9); } if (!sqlRead.IsDBNull(10)) { invoiceVerificationEntity.DoAmount = sqlRead.GetDecimal(10); } if (!sqlRead.IsDBNull(11)) { invoiceVerificationEntity.DeleteUser = sqlRead.GetString(11); } if (!sqlRead.IsDBNull(12)) { invoiceVerificationEntity.DeleteTime = sqlRead.GetDateTime(12); } } } catch (Exception execError) { throw execError; } } return invoiceVerificationEntity; } } }