public BidPlanPrint getBidPlanInfoByQuote(SqlConnection connection, int QuoteInfo) { BidPlanPrint ret = new BidPlanPrint(); using (var command = new SqlCommand( " select tblBP.* ,tblC.CapitalName from tbl_BidPlan tblBP inner join tbl_Capital tblC on tblC.CapitalID = tblBP.CapitalID " + " where tblBP.QuoteID = " + QuoteInfo, connection)) { using (var reader = command.ExecuteReader()) { while (reader.Read()) { ret.BidExpirated = GetDbReaderValue <int>(reader["BidExpirated"]); ret.BidExpiratedUnit = GetDbReaderValue <string>(reader["BidExpiratedUnit"]); ret.BidPlanCode = GetDbReaderValue <string>(reader["BidPlanCode"]); ret.BidType = GetDbReaderValue <string>(reader["BidType"]); ret.CapitalID = GetDbReaderValue <int>(reader["CapitalID"]); ret.CapitalName = GetDbReaderValue <string>(reader["CapitalName"]); } } } return(ret); }
public NegotiationPrintModel GetNegotiationPrintModel(int _ID, string _userID) { NegotiationPrintModel record = new NegotiationPrintModel(); NegotiationInfo info = new NegotiationInfo(); SqlConnectionFactory sqlConnection = new SqlConnectionFactory(); SearchAuditInfo auditInfo = new SearchAuditInfo(); using (SqlConnection connection = sqlConnection.GetConnection()) { info = NegotiationDataLayer.GetInstance().getNegotiation(connection, _ID, _userID); if (record == null) { return(null); } CustomerInfo cusInfo = CustomerDataLayer.GetInstance().getCustomer(connection, info.CustomerID); auditInfo = AuditDataLayer.GetInstance().getAuditInfoByQuote(connection, info.QuoteID); BidPlanPrint bidPlanInfo = BidPlanDataLayer.GetInstance().getBidPlanInfoByQuote(connection, info.QuoteID); record.ASide = "BỆNH VIỆN TRUYỀN MÁU HUYẾT HỌC"; record.BSide = info.CustomerName; record.ALocation = info.Location; record.APhone = info.Phone; record.AFax = info.Fax; record.ABankID = info.BankID; record.ATaxCode = info.TaxCode; record.ARepresent = info.Represent; record.APosition = info.Position; record.BLocation = cusInfo.Address; record.BPhone = cusInfo.Phone; record.BFax = cusInfo.Fax; record.BBankID = cusInfo.BankNumber + " " + cusInfo.BankName; record.BTaxCode = cusInfo.TaxCode; record.BRepresent = cusInfo.Surrogate; record.BPosition = cusInfo.Position; record.DateIn = info.DateIn; record.Term = info.Term; record.NegotiationCode = info.NegotiationCode; record.AuditTime = auditInfo.InTime; record.AuditCode = auditInfo.AuditCode; record.VATNumber = info.VATNumber; record.IsVAT = info.IsVAT; record.QuoteTotalCost = info.QuoteTotalCost; record.Items = QuoteDataLayer.GetInstance().getSelectedItemsQuote(connection, record.QuoteID); record.QuoteID = info.QuoteID; record.QuoteCode = info.QuoteCode; record.Items = QuoteDataLayer.GetInstance().getSelectedItemsQuote(connection, record.QuoteID); record.BidExpirated = info.BidExpirated; record.BidExpiratedUnit = info.BidExpiratedUnit; record.BidType = info.BidType; return(record); } }