コード例 #1
0
        public ProposalDetailWithContactItemsInfo GetProposalWithContactItemsByCode(string code, string _userID)
        {
            ProposalDetailBase   proposalDetail = new ProposalDetailBase();
            SqlConnectionFactory sqlConnection  = new SqlConnectionFactory();
            ProposalDetailWithContactItemsInfo ret;

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                proposalDetail = ProposalDataLayer.GetInstance().getProposalDetailByCode(connection, code, _userID);
                if (proposalDetail == null)
                {
                    return(null);
                }
                ret = new ProposalDetailWithContactItemsInfo(proposalDetail);

                int       QuoteID = ProposalDataLayer.GetInstance().getQuoteIDWithHaveFinalContact(connection, proposalDetail.ProposalID);
                QuoteInfo quote   = QuoteDataLayer.GetInstance().getQuote(connection, QuoteID, _userID);
                if (quote.TotalCost > 30000000)
                {
                    ret.DeliveryReceiptType = 2;
                }
                else
                {
                    ret.DeliveryReceiptType = 1;
                }


                ret.Items = new List <ItemInfo>();
                ret.Items = QuoteDataLayer.GetInstance().GetQuoteItems(connection, QuoteID);
            }
            return(ret);
        }
コード例 #2
0
        public ProposalDetailInfo GetDetailProposalByCode(string code, string _userID)
        {
            ProposalDetailBase   proposalDetail = new ProposalDetailBase();
            SqlConnectionFactory sqlConnection  = new SqlConnectionFactory();
            ProposalDetailInfo   ret;

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                proposalDetail = ProposalDataLayer.GetInstance().getProposalDetailByCode(connection, code, _userID);
                if (proposalDetail == null)
                {
                    return(null);
                }
                ret             = new ProposalDetailInfo(proposalDetail);
                ret.ListComment = new List <CommentInfo>();

                //Get document
                DocumentSeachCriteria documentCriteria = new DocumentSeachCriteria();
                documentCriteria.TableName = TableFile.Proposal.ToString();
                documentCriteria.PreferId  = proposalDetail.ProposalID.ToString();
                ret.ListDocument           = DocumentService.GetInstance().GetDocument(documentCriteria);

                ret.Items = new List <ItemPropsalInfo>();
                ret.Items = ProposalDataLayer.GetInstance().GetPropsalItems(connection, proposalDetail.ProposalID);

                //get Comment
                CommentSeachCriteria commentCriteria = new CommentSeachCriteria();
                commentCriteria.TableName = TableFile.Proposal.ToString();
                commentCriteria.PreferId  = proposalDetail.ProposalID.ToString();
                ret.ListComment           = CommentService.GetInstance().getComment(commentCriteria);
                foreach (var item in ret.ListComment)
                {
                    DocumentSeachCriteria documentCriteria2 = new DocumentSeachCriteria();
                    documentCriteria2.TableName = TableFile.Comment.ToString();
                    documentCriteria2.PreferId  = item.AutoID.ToString();
                    item.ListDocument           = DocumentService.GetInstance().GetDocument(documentCriteria2);
                }
            }
            return(ret);
        }