示例#1
0
        public TimeLineRecord GetProposalProccess2(int proposalID, string _userI, string _userID)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();
            TimeLineRecord       ret           = new TimeLineRecord();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                ProcessInfo info = ProposalDataLayer.GetInstance().GetProposalProccessID(connection, proposalID);
                if (info.ProposalID != 0)
                {
                    ret.ProposalDetailInfo = ProposalService.GetInstance().getDetailProposal(info.ProposalID, _userI);
                }
                if (info.SurveyID != 0)
                {
                    ret.SurveyDetailInfo = SurveyService.GetInstance().GetDetailSurvey(info.SurveyID, _userID);
                }
                if (info.ExplanationID != 0)
                {
                    ret.ExplanationDetailInfo = ExplanationService.GetInstance().getDetailExplanation(info.ExplanationID, _userID);
                }
                if (info.QuoteID != 0)
                {
                    ret.QuoteInfo = QuoteService.GetInstance().getQuote(info.QuoteID, _userID);
                }
                if (info.AuditID != 0)
                {
                    ret.AuditDetailInfo = AuditService.GetInstance().getAuditInfo(info.AuditID, _userID);
                }
                if (info.BidPlanID != 0)
                {
                    ret.BidPlanInfo = BidPlanService.GetInstance().getBidPlan(info.BidPlanID, _userID);
                }
                if (info.NegotiationID != 0)
                {
                    ret.NegotiationInfo = NegotiationService.GetInstance().GetNegotiation(info.NegotiationID, _userID);
                }
                if (info.DecisionID != 0)
                {
                    ret.DecisionInfo = DecisionService.GetInstance().GetDecision(info.DecisionID, _userID);
                }
                if (info.ContractID != 0)
                {
                    ret.ContractInfo = ContractService.GetInstance().getContractNew(info.ContractID, _userID);
                }
                if (info.DeliveryReceiptID != 0)
                {
                    ret.DeliveryReceiptInfo = DeliveryReceiptServices.GetInstance().GetDetail(info.DeliveryReceiptID, _userID);
                }
                if (info.AcceptanceID != 0)
                {
                    ret.AcceptanceInfo = AcceptanceServices.GetInstance().GetDetail(info.AcceptanceID, _userID);
                }
            }
            return(ret);
        }
示例#2
0
        public void deleteProcess(SqlConnection connection, string feature, string quoteIds, string _userID)
        {
            switch (feature)
            {
            case "Quote":
                List <string> auditIds = AuditDataLayer.GetInstance().GetAuditByQuoteIds(connection, quoteIds);
                if (auditIds.Count > 0)
                {
                    AuditService.GetInstance().DeleteMuti(String.Join(", ", auditIds.ToArray()), _userID);
                }
                List <string> bidPlans = BidPlanDataLayer.GetInstance().GetBidPlanByQuoteIds(connection, quoteIds);
                if (bidPlans.Count > 0)
                {
                    BidPlanService.GetInstance().DeleteMuti(String.Join(", ", bidPlans.ToArray()), _userID);
                }
                List <string> negotiationIDs = NegotiationDataLayer.GetInstance().GetNegotiationByQuoteIds(connection, quoteIds);
                if (negotiationIDs.Count > 0)
                {
                    NegotiationService.GetInstance().DeleteMuti(String.Join(", ", negotiationIDs.ToArray()), _userID);
                }
                List <string> decisonIDs = DecisionDataLayer.GetInstance().GetDecisionByQuoteIds(connection, quoteIds);
                if (decisonIDs.Count > 0)
                {
                    DecisionService.GetInstance().DeleteMuti(String.Join(", ", decisonIDs.ToArray()), _userID);
                }
                List <string> contractIDs = ContractDataLayer.GetInstance().GetContractByQuoteIds(connection, quoteIds, _userID);
                if (contractIDs.Count > 0)
                {
                    ContractService.GetInstance().deleteMuti(String.Join(", ", contractIDs.ToArray()), _userID);
                }
                List <string> deliveryReceiptIDs = DeliveryReceiptDataLayer.GetInstance().GetDeliveryReceiptByQuoteIds(connection, quoteIds);
                if (deliveryReceiptIDs.Count > 0)
                {
                    DeliveryReceiptServices.GetInstance().DeleteMuti(String.Join(", ", deliveryReceiptIDs.ToArray()), _userID);
                }
                List <string> acceptanceIDs = AcceptanceDataLayer.GetInstance().GetAcceptanceByQuoteIds(connection, quoteIds);
                if (acceptanceIDs.Count > 0)
                {
                    AcceptanceServices.GetInstance().DeleteMuti(String.Join(", ", acceptanceIDs.ToArray()));
                }
                break;

            case "Audit":
                bidPlans = BidPlanDataLayer.GetInstance().GetBidPlanByQuoteIds(connection, quoteIds);
                if (bidPlans.Count > 0)
                {
                    BidPlanService.GetInstance().DeleteMuti(String.Join(", ", bidPlans.ToArray()), _userID);
                }
                negotiationIDs = NegotiationDataLayer.GetInstance().GetNegotiationByQuoteIds(connection, quoteIds);
                if (negotiationIDs.Count > 0)
                {
                    NegotiationService.GetInstance().DeleteMuti(String.Join(", ", negotiationIDs.ToArray()), _userID);
                }
                decisonIDs = DecisionDataLayer.GetInstance().GetDecisionByQuoteIds(connection, quoteIds);
                if (decisonIDs.Count > 0)
                {
                    DecisionService.GetInstance().DeleteMuti(String.Join(", ", decisonIDs.ToArray()), _userID);
                }
                contractIDs = ContractDataLayer.GetInstance().GetContractByQuoteIds(connection, quoteIds, _userID);
                if (contractIDs.Count > 0)
                {
                    ContractService.GetInstance().deleteMuti(String.Join(", ", contractIDs.ToArray()), _userID);
                }
                deliveryReceiptIDs = DeliveryReceiptDataLayer.GetInstance().GetDeliveryReceiptByQuoteIds(connection, quoteIds);
                if (deliveryReceiptIDs.Count > 0)
                {
                    DeliveryReceiptServices.GetInstance().DeleteMuti(String.Join(", ", deliveryReceiptIDs.ToArray()), _userID);
                }
                acceptanceIDs = AcceptanceDataLayer.GetInstance().GetAcceptanceByQuoteIds(connection, quoteIds);
                if (acceptanceIDs.Count > 0)
                {
                    AcceptanceServices.GetInstance().DeleteMuti(String.Join(", ", acceptanceIDs.ToArray()));
                }
                break;

            case "BidPlan":
                negotiationIDs = NegotiationDataLayer.GetInstance().GetNegotiationByQuoteIds(connection, quoteIds);
                if (negotiationIDs.Count > 0)
                {
                    NegotiationService.GetInstance().DeleteMuti(String.Join(", ", negotiationIDs.ToArray()), _userID);
                }
                decisonIDs = DecisionDataLayer.GetInstance().GetDecisionByQuoteIds(connection, quoteIds);
                if (decisonIDs.Count > 0)
                {
                    DecisionService.GetInstance().DeleteMuti(String.Join(", ", decisonIDs.ToArray()), _userID);
                }
                contractIDs = ContractDataLayer.GetInstance().GetContractByQuoteIds(connection, quoteIds, _userID);
                if (contractIDs.Count > 0)
                {
                    ContractService.GetInstance().deleteMuti(String.Join(", ", contractIDs.ToArray()), _userID);
                }
                deliveryReceiptIDs = DeliveryReceiptDataLayer.GetInstance().GetDeliveryReceiptByQuoteIds(connection, quoteIds);
                if (deliveryReceiptIDs.Count > 0)
                {
                    DeliveryReceiptServices.GetInstance().DeleteMuti(String.Join(", ", deliveryReceiptIDs.ToArray()), _userID);
                }
                acceptanceIDs = AcceptanceDataLayer.GetInstance().GetAcceptanceByQuoteIds(connection, quoteIds);
                if (acceptanceIDs.Count > 0)
                {
                    AcceptanceServices.GetInstance().DeleteMuti(String.Join(", ", acceptanceIDs.ToArray()));
                }
                break;

            case "Negotiation":
                decisonIDs = DecisionDataLayer.GetInstance().GetDecisionByQuoteIds(connection, quoteIds);
                if (decisonIDs.Count > 0)
                {
                    DecisionService.GetInstance().DeleteMuti(String.Join(", ", decisonIDs.ToArray()), _userID);
                }
                contractIDs = ContractDataLayer.GetInstance().GetContractByQuoteIds(connection, quoteIds, _userID);
                if (contractIDs.Count > 0)
                {
                    ContractService.GetInstance().deleteMuti(String.Join(", ", contractIDs.ToArray()), _userID);
                }
                deliveryReceiptIDs = DeliveryReceiptDataLayer.GetInstance().GetDeliveryReceiptByQuoteIds(connection, quoteIds);
                if (deliveryReceiptIDs.Count > 0)
                {
                    DeliveryReceiptServices.GetInstance().DeleteMuti(String.Join(", ", deliveryReceiptIDs.ToArray()), _userID);
                }
                acceptanceIDs = AcceptanceDataLayer.GetInstance().GetAcceptanceByQuoteIds(connection, quoteIds);
                if (acceptanceIDs.Count > 0)
                {
                    AcceptanceServices.GetInstance().DeleteMuti(String.Join(", ", acceptanceIDs.ToArray()));
                }
                break;

            case "Decision":
                contractIDs = ContractDataLayer.GetInstance().GetContractByQuoteIds(connection, quoteIds, _userID);
                if (contractIDs.Count > 0)
                {
                    ContractService.GetInstance().deleteMuti(String.Join(", ", contractIDs.ToArray()), _userID);
                }
                deliveryReceiptIDs = DeliveryReceiptDataLayer.GetInstance().GetDeliveryReceiptByQuoteIds(connection, quoteIds);
                if (deliveryReceiptIDs.Count > 0)
                {
                    DeliveryReceiptServices.GetInstance().DeleteMuti(String.Join(", ", deliveryReceiptIDs.ToArray()), _userID);
                }
                acceptanceIDs = AcceptanceDataLayer.GetInstance().GetAcceptanceByQuoteIds(connection, quoteIds);
                if (acceptanceIDs.Count > 0)
                {
                    AcceptanceServices.GetInstance().DeleteMuti(String.Join(", ", acceptanceIDs.ToArray()));
                }
                break;

            case "Contract":
                deliveryReceiptIDs = DeliveryReceiptDataLayer.GetInstance().GetDeliveryReceiptByQuoteIds(connection, quoteIds);
                if (deliveryReceiptIDs.Count > 0)
                {
                    DeliveryReceiptServices.GetInstance().DeleteMuti(String.Join(", ", deliveryReceiptIDs.ToArray()), _userID);
                }
                acceptanceIDs = AcceptanceDataLayer.GetInstance().GetAcceptanceByQuoteIds(connection, quoteIds);
                if (acceptanceIDs.Count > 0)
                {
                    AcceptanceServices.GetInstance().DeleteMuti(String.Join(", ", acceptanceIDs.ToArray()));
                }
                break;

            case "DeliveryReceipt":
                acceptanceIDs = AcceptanceDataLayer.GetInstance().GetAcceptanceByQuoteIds(connection, quoteIds);
                if (acceptanceIDs.Count > 0)
                {
                    AcceptanceServices.GetInstance().DeleteMuti(String.Join(", ", acceptanceIDs.ToArray()));
                }
                break;

            default:
                break;
            }
        }