Exemplo n.º 1
0
        public override async Task <ResponseMessage> UpdateComponentToDB()
        {
            string compIdValue = GetIdValue();
            string updateUrl   = GetPutUrl(compIdValue);

            return(await HDBHandler.UpdateComponentToDB(updateUrl, ComponentDetails.ToString()));
        }
        public async Task <bool> SpecificationCheck(ComponentDetails component1, ComponentDetails component2)
        {
            Console.WriteLine("Performing specification based compatibility check");
            var specs = _specCheckList[
                string.Join(",", new List <string>()
            {
                component1.ComponentTypeName, component2.ComponentTypeName
            })];
            var compatible = true;

            foreach (var spec in specs)
            {
                Console.WriteLine($"Checking specification {spec}");
                var s1 = component1.Specifications.FirstOrDefault(s => s.Code.Equals(spec));
                var s2 = component2.Specifications.FirstOrDefault(s => s.Code.Equals(spec));
                if (s1 == null || s2 == null || !s1.Value.Equals(s2.Value))
                {
                    compatible = false;
                    break;
                }
            }

            if (compatible)
            {
                Console.WriteLine("Specification check successful, adding compatibility");
                var compatibility = new CompatibilityFull()
                {
                    Component1Id = component1.Id,
                    Component2Id = component2.Id
                };
                await _compatibilityService.AddNoReturn(compatibility);
            }
            return(compatible);
        }
        public ResponseMessage UpdateComponent(ComponentDetails servicedto, int id)
        {
            ResponseMessage responseMessage = new ResponseMessage();

            responseMessage = _repository.UpdateComponent(servicedto, id);
            return(responseMessage);
        }
        public ResponseMessage UpdateComponent(ComponentDetails servicedto, int id)
        {
            ResponseMessage responseMessage = new ResponseMessage();

            try {
                var component = _context.Component.Where(x => x.Id == id && x.IsDelete == false).FirstOrDefault();
                if (component != null)
                {
                    if (_context.Component.Where(x => x.Id == servicedto.Id && x.IsDelete == false).Count() > 0)
                    {
                        throw new ValueNotFoundException("Component already exist.");
                    }
                    else
                    {
                        //TODO: need to identify attributes
                        _context.SaveChanges();

                        return(responseMessage = new ResponseMessage()
                        {
                            Message = "Component updated successfully.",
                        });
                    }
                }
                else
                {
                    throw new ValueNotFoundException("Component not available.");
                }
            } catch (Exception ex) {
                throw ex;
            }
        }
 private Component ConstructComponent(int projectStructureID, ComponentDetails comp, Component compdb, ComponentType compTypeDB)
 {
     if (compdb == null)
     {
         compdb = new Component();
         int    count = _context.Component.Count() + 1;
         string id    = constantVal.ComponentIdPrefix + count.ToString().PadLeft(6, '0');
         compdb.CompId    = id;
         compdb.CreatedAt = DateTime.Now;
     }
     compdb.ProjStructId = projectStructureID;
     compdb.CompName     = comp.ComponentName;
     compdb.IsActive     = comp.IsActive;
     compdb.IsDelete     = false;
     compdb.DrawingNo    = comp.DrawingNo;
     compdb.CompTypeId   = compTypeDB.Id;
     compdb.ComponentNo  = comp.ComponentNo;
     compdb.IsGroup      = comp.IsGroup;
     compdb.Leng         = comp.Leng;
     compdb.Breath       = comp.Breath;
     compdb.Height       = comp.Height;
     compdb.Thickness    = comp.Thickness;
     compdb.Weight       = comp.Weight;
     compdb.MakeType     = comp.MakeType;
     compdb.IsTag        = comp.IsTag;
     compdb.QrCode       = comp.QrCode;
     compdb.CompStatus   = comp.CompStatus;
     compdb.UpdatedAt    = DateTime.Now;
     return(compdb);
 }
        public ComponentDetails GetComponentById(int id)
        {
            ComponentDetails response = _repository.GetComponentById(id);

            if (response == null)
            {
                return(null);
            }

            return(response);
        }
        public ComponentDetails GetComponentById(int id)
        {
            ComponentDetails response = new ComponentDetails();
            var responsedb            = _context.Component.Where(x => x.Id == id && x.IsDelete == false).FirstOrDefault();

            if (responsedb != null)
            {
                response = _mapper.Map <ComponentDetails> (responsedb);
            }

            return(response);
        }
Exemplo n.º 8
0
        public ComponentDetails FromDbComponentToComponentDetailed(component component)
        {
            var analogs = new List <ComponentList>();

            foreach (component com in component.component2)
            {
                analogs.Add(FromDbComponentToViewComponent(com));
            }

            ComponentDetails details = new ComponentDetails()
            {
                ComponentName    = component.NameAndVersion,
                CriticalityLevel = component.criticality_level.CriticalityLevel,
                Vendor           = component.VendorLink,
                Analogs          = analogs
            };

            return(details);
        }
        public ActionResult ShowComponentDetales(int componentId)
        {
            ComponentDetails component = _logic.GetComponentDetails(componentId);

            return(View(component));
        }
Exemplo n.º 10
0
        public async Task <Warranty> GetComplaintById(string complaintId)
        {
            var resultSet = await this._newWarranty.GetComplaintById(complaintId);

            Warranty warranty = new Warranty();

            try
            {
                if (resultSet != null && resultSet[0] != null)
                {
                    foreach (var result in resultSet[0])
                    {
                        warranty.StatusReportID = result.Status_Report_ID;
                        ContactDetails contactDetails = new ContactDetails();
                        contactDetails.Title      = result.Contact_Person_Honourific;
                        contactDetails.FirstName  = result.Contact_Person_First_Name;
                        contactDetails.LastName   = result.Contact_Person_Surname;
                        contactDetails.JobTitle   = result.Contact_Person_Job_Title;
                        contactDetails.TelNo      = result.Telephone_No;
                        contactDetails.MobNo      = result.Mobile_No;
                        contactDetails.Ext        = result.Extension;
                        contactDetails.Email      = result.Email_Address;
                        contactDetails.Department = result.Department;

                        ReceiptDetails receiptDetails = new ReceiptDetails();
                        receiptDetails.DateOfEvent  = result.Event_Date == null ? string.Empty : result.Event_Date.ToString("MM/dd/yyyy");
                        receiptDetails.DateReceived = result.Received_Date == null ? string.Empty : result.Received_Date.ToString("MM/dd/yyyy");
                        //receiptDetails.DateClosed =
                        receiptDetails.DateLogged      = result.Logged_Date == null ? string.Empty : result.Logged_Date.ToString("MM/dd/yyyy");
                        receiptDetails.TimeLogged      = result.Logged_Time == null ? string.Empty : Convert.ToString(result.Logged_Time);
                        receiptDetails.RecipientID     = result.Recipient_Employee_ID;
                        receiptDetails.LoggedByID      = result.Logged_Employee_ID;
                        receiptDetails.ManagerID       = result.Manager_Employee_ID;
                        receiptDetails.AccountName     = result.Account_Name;
                        receiptDetails.AccountSAP      = result.Account_Ref;
                        receiptDetails.Opera           = result.Opera_Code;
                        receiptDetails.AccountAddress1 = result.Account_Address_1;
                        receiptDetails.AccountAddress2 = result.Account_Address_2;
                        receiptDetails.City            = result.Town_City;
                        receiptDetails.Postal          = result.Post_Code;

                        WarrantyComplaint warrantyComplaint = new WarrantyComplaint();
                        warrantyComplaint.Email       = result.Format_Complaint_Email_Flag == null ? false : Convert.ToBoolean(result.Format_Complaint_Email_Flag);
                        warrantyComplaint.Phone       = result.Format_Complaint_Phone_Flag == null ? false : Convert.ToBoolean(result.Format_Complaint_Phone_Flag);
                        warrantyComplaint.Postal      = result.Format_Complaint_Postal_Flag == null ? false : Convert.ToBoolean(result.Format_Complaint_Postal_Flag);
                        warrantyComplaint.InPerson    = result.Format_Complaint_Person_Flag == null ? false : Convert.ToBoolean(result.Format_Complaint_Person_Flag);
                        warrantyComplaint.SocialMedia = result.Format_Complaint_Social_Media_Flag == null ? false : Convert.ToBoolean(result.Format_Complaint_Social_Media_Flag);
                        warrantyComplaint.WCC         = result.Complaint_Category_ID;
                        warrantyComplaint.IWRT        = result.Warranty_Return_Transfer_Flag == null ? false : Convert.ToBoolean(result.Warranty_Return_Transfer_Flag);
                        warrantyComplaint.Identity    = result.Product_Identity_Flag == null ? false : Convert.ToBoolean(result.Product_Identity_Flag);
                        warrantyComplaint.Quality     = result.Product_Quality_Flag == null ? false : Convert.ToBoolean(result.Product_Quality_Flag);
                        warrantyComplaint.Durability  = result.Product_Durability_Flag == null ? false : Convert.ToBoolean(result.Product_Durability_Flag);
                        warrantyComplaint.Reliability = result.Product_Reliability_Flag == null ? false : Convert.ToBoolean(result.Product_Reliability_Flag);
                        warrantyComplaint.Usability   = result.Product_Usability_Flag == null ? false : Convert.ToBoolean(result.Product_Usability_Flag);
                        warrantyComplaint.Safety      = result.Product_Safety_Flag == null ? false : Convert.ToBoolean(result.Product_Safety_Flag);
                        warrantyComplaint.Performance = result.Product_Performance_Flag == null ? false : Convert.ToBoolean(result.Product_Performance_Flag);
                        warrantyComplaint.DWC         = result.Summary_Complaint;
                        warrantyComplaint.Human       = result.Account_Type_Human_Flag == null ? false : Convert.ToBoolean(result.Account_Type_Human_Flag);
                        warrantyComplaint.Industrial  = result.Account_Type_Industrial_Flag == null ? false : Convert.ToBoolean(result.Account_Type_Industrial_Flag);
                        warrantyComplaint.Vet         = result.Account_Type_Veterinary_Flag;
                        warrantyComplaint.OPS         = result.Other_Please_Specify;
                        warrantyComplaint.WRTF        = result.Warranty_Return_Transfer_Yes;

                        warranty.ItemReceived           = result.Item_Received_Flag == null ? false : Convert.ToBoolean(result.Item_Received_Flag);
                        warranty.ItemRetainedByCustomer = result.Item_Retained_Flag == null ? false : Convert.ToBoolean(result.Item_Retained_Flag);
                        warranty.RepairReplaceFOC       = result.Repair_Replace_FOC_Flag == null ? false : Convert.ToBoolean(result.Repair_Replace_FOC_Flag);
                        warranty.ReportRequested        = result.Report_Flag == null ? false : Convert.ToBoolean(result.Report_Flag);


                        warranty.contactDetails    = contactDetails;
                        warranty.receiptDetails    = receiptDetails;
                        warranty.warrantyComplaint = warrantyComplaint;
                    }
                }

                if (resultSet != null && resultSet.Count >= 1 && resultSet[1] != null)
                {
                    var result = resultSet[1];

                    warranty.productDetails = new List <ProductDetails>();
                    foreach (var data in result)
                    {
                        ProductDetails productDetails = new ProductDetails();
                        productDetails.ProdID             = data.Item_Detail_ID;
                        productDetails.OurRef             = data.Our_Ref_No;
                        productDetails.OurPONo            = data.Our_PO_No;
                        productDetails.MFGComplaintID     = data.MFG_Complaint;
                        productDetails.DeviceProductCode  = data.Device_Product_Code;
                        productDetails.Description        = data.Description;
                        productDetails.Quantity           = Convert.ToString(data.Quantity);
                        productDetails.SerialNo           = data.Serial_No;
                        productDetails.LotNo              = data.Batch_No;
                        productDetails.ManufacturerStatus = data.Outcome;
                        productDetails.Cost        = Convert.ToString(data.Cost_GBP);
                        productDetails.Loan        = data.Loan_Issued_Flag;
                        productDetails.ResultUK    = data.Granted_Resut;
                        productDetails.Category    = data.Category;
                        productDetails.Discipline  = data.Discipline;
                        productDetails.SubCategory = data.Sub_Category;
                        warranty.productDetails.Add(productDetails);
                    }
                    //warranty.productDetails.Add(listProductDetails);
                }
                if (resultSet != null && resultSet.Count >= 2 && resultSet[2] != null)
                {
                    var result = resultSet[2];

                    warranty.componentDetails = new List <ComponentDetails>();
                    foreach (var data in result)
                    {
                        ComponentDetails componentDetails = new ComponentDetails();
                        componentDetails.ComponentID = data.Component_Detail_ID;
                        componentDetails.ComponentNo = data.Component_No;
                        componentDetails.Unit        = Convert.ToString(data.Unit);
                        componentDetails.DChl        = data.SAP_Distribution_Channel;
                        componentDetails.GBP         = Convert.ToString(data.Cost_GBP);
                        componentDetails.MainSFC     = data.Main_SFC;
                        componentDetails.Description = data.Description;
                        warranty.componentDetails.Add(componentDetails);
                    }
                }
                if (resultSet != null && resultSet.Count >= 3 && resultSet[3] != null)
                {
                    foreach (var result in resultSet[3])
                    {
                        AdverseIncident adverseIncident = new AdverseIncident();
                        adverseIncident.AIStatus         = Convert.ToString(result.Status_Report_ID);
                        adverseIncident.MHRAID           = Convert.ToString(result.MHRA_ID);
                        adverseIncident.AIDateOfEvent    = result.Event_Date == null ? null : result.Event_Date.ToString("MM/dd/yyyy");
                        adverseIncident.AIDateReceived   = result.Received_Date == null ? null : result.Received_Date.ToString("MM/dd/yyyy");
                        adverseIncident.HAEO             = result.Has_Event_Occurred_Flag == null ? false : Convert.ToBoolean(result.Has_Event_Occurred_Flag);
                        adverseIncident.HSER15           = result.Death_Injury_Flag == null ? false : Convert.ToBoolean(result.Death_Injury_Flag);
                        adverseIncident.AIDateToReportBy = Convert.ToString(result.Days_Event_Report);
                        adverseIncident.HSER10           = result.Could_Death_Injury_Flag == null ? false : Convert.ToBoolean(result.Could_Death_Injury_Flag);
                        adverseIncident.DID               = result.Details_Death_Injury;
                        adverseIncident.IDS               = result.Karl_Storz_Device_Flag == null ? false : Convert.ToBoolean(result.Karl_Storz_Device_Flag);
                        adverseIncident.DMITE             = result.Incident_Email_Date == null ? null : result.Incident_Email_Date.ToString("MM/dd/yyyy");
                        adverseIncident.MfgComplaintID    = result.KST_Complaint;
                        adverseIncident.Manugacturer      = result.Manufacturer_ID;
                        adverseIncident.AICM              = result.Criteria_Met_Flag == null ? false : Convert.ToBoolean(result.Criteria_Met_Flag);
                        adverseIncident.WIRBYUM           = result.Reported_MHRA_User_Flag == null ? false : Convert.ToBoolean(result.Reported_MHRA_User_Flag);
                        adverseIncident.DURTM             = result.MHRA_Reported_User_Date == null ? null : result.MHRA_Reported_User_Date.ToString("MM/dd/yyyy");
                        adverseIncident.WIRBKTMNo         = result.Reported_MHRA_KSEUK_No_Flag == null ? false : Convert.ToBoolean(result.Reported_MHRA_KSEUK_No_Flag);
                        adverseIncident.WIRBKTMYes        = result.Reported_MHRA_KSEUK_Flag == null ? false : Convert.ToBoolean(result.Reported_MHRA_KSEUK_Flag);
                        adverseIncident.DKRTMHRA          = result.MHRA_Reported_Date == null ? null : result.MHRA_Reported_Date.ToString("MM/dd/yyyy");
                        adverseIncident.KSEUKMHRARef      = result.MHRA_Ref;
                        adverseIncident.CustomerMHRARef   = result.Customer_MHRA_Ref;
                        adverseIncident.DateAckSentToMHRA = result.KSEUK_Ack_MHRA_Date == null ? null : result.KSEUK_Ack_MHRA_Date.ToString("MM/dd/yyyy");
                        adverseIncident.DateNextReportDue = result.Report_Received_KST_Date == null ? null : result.Report_Received_KST_Date.ToString("MM/dd/yyyy");
                        adverseIncident.MRtoMHRA          = result.Mfg_Report_MHRA_Flag == null ? false : Convert.ToBoolean(result.Mfg_Report_MHRA_Flag);
                        adverseIncident.NtbRtMHRA         = result.Mfg_Not_Report_MHRA_Flag == null ? false : Convert.ToBoolean(result.Mfg_Not_Report_MHRA_Flag);
                        adverseIncident.InvestOutcome     = result.Investigation_Outcome;
                        adverseIncident.AIComments        = result.MHRA_Comments;
                        adverseIncident.DateRepSentToMHRA = result.Report_Sent_MHRA_Date == null ? null : result.Report_Sent_MHRA_Date.ToString("MM/dd/yyyy");
                        adverseIncident.DCLRFMHRA         = result.Closing_Letter_Received_MHRA_Date == null ? null : result.Closing_Letter_Received_MHRA_Date.ToString("MM/dd/yyyy");
                        adverseIncident.NotMHRA           = result.Mfg_NoMHRA_Report_Why;
                        adverseIncident.DateFMRR          = result.Next_Report_MFG_Date == null ? null : result.Next_Report_MFG_Date.ToString("MM/dd/yyyy");
                        warranty.adverseIncident          = adverseIncident;
                    }
                }
                if (resultSet != null && resultSet.Count >= 4 && resultSet[4] != null)
                {
                    foreach (var result in resultSet[4])
                    {
                        Acknowledgement acknowledgement = new Acknowledgement();
                        acknowledgement.AckStatus         = Convert.ToString(result.Status_Report_ID);
                        acknowledgement.DCReceived        = result.Received_Date == null ? null : result.Received_Date.ToString("MM/dd/yyyy");
                        acknowledgement.DASTC             = result.Customer_Acknowledgement_Date == null ? null : result.Customer_Acknowledgement_Date.ToString("MM/dd/yyyy");
                        acknowledgement.MethodOfAck       = Convert.ToString(result.Acknowledgement_Method_ID);
                        acknowledgement.AckBy             = Convert.ToString(result.Ack_Sent_By_ID);
                        acknowledgement.WrittenAck        = result.Written_Acknowledgement_Flag == null ? false : Convert.ToBoolean(result.Written_Acknowledgement_Flag);
                        acknowledgement.DWAS              = result.Acknowledgement_Sent_Date == null ? null : result.Acknowledgement_Sent_Date.ToString("MM/dd/yyyy");
                        acknowledgement.AckAAR            = result.Action_Required;
                        acknowledgement.AcknowledgementID = Convert.ToString(result.Acknowledgement_ID);
                        warranty.acknowledgement          = acknowledgement;
                    }
                }
                if (resultSet != null && resultSet.Count >= 5 && resultSet[5] != null)
                {
                    foreach (var result in resultSet[5])
                    {
                        InvestigateNEvaluate investigateNEvaluate = new InvestigateNEvaluate();
                        investigateNEvaluate.IEID        = result.Investigation_Evaluation_ID;
                        investigateNEvaluate.ComplaintID = Convert.ToString(result.Complaint_ID);
                        investigateNEvaluate.SCOTC       = result.Suspected_Cause;
                        investigateNEvaluate.KSEUK       = result.KSEUK_Investigation_Flag;
                        investigateNEvaluate.InvestigationManufacturer = result.Manufacturer_Investigation_Flag;
                        investigateNEvaluate.InvestOther                  = result.Other_Investigation_Flag;
                        investigateNEvaluate.IDDesc                       = result.Investigation_Required;
                        investigateNEvaluate.RRFOC                        = result.Repair_Replace_FOC_Flag;
                        investigateNEvaluate.ReportRequest                = result.Report_Requested_Flag;
                        investigateNEvaluate.OtherProvideDetails          = result.Other_Investigation_Results_Flag;
                        investigateNEvaluate.IRDesc                       = result.Investigation_Results;
                        investigateNEvaluate.WarrantyAccepted             = result.Warranty_Accepted_Flag;
                        investigateNEvaluate.WarrantyRejected             = result.Warranty_Rejected_Quote_Flag;
                        investigateNEvaluate.WarrantyRejectedFairtrade    = result.Warranty_Rejected_Fairtrade_Flag;
                        investigateNEvaluate.EP1AuditOff                  = result.EP1_Audit_Offered_Flag;
                        investigateNEvaluate.TrainingOffered              = result.Training_Offered_Flag;
                        investigateNEvaluate.TrainingOffered              = result.Advise_IFUS_Website_Flag;
                        investigateNEvaluate.IEOtherProvideDetails        = result.Solution_Other_Flag;
                        investigateNEvaluate.SSDesc                       = result.Other_Solution;
                        investigateNEvaluate.CEDesc                       = result.Customer_Expectations;
                        investigateNEvaluate.CustomerSolution             = result.Stakeholder_Customer_Flag;
                        investigateNEvaluate.KSEUKSolution                = result.Stakeholder_KSEUK_Flag;
                        investigateNEvaluate.ManufacturerSolution         = result.Stakeholder_Manufacturer_Flag;
                        investigateNEvaluate.RegulatoryComplianceSolution = result.Regulatory_Compliance_Flag;
                        investigateNEvaluate.CAPARequired                 = result.CAPA_Required_Flag;
                        investigateNEvaluate.IEStatus                     = Convert.ToString(result.Status_Report_ID);
                        investigateNEvaluate.DateQuote                    = result.Quote_Issued_Date == null ? null : result.Quote_Issued_Date.ToString("MM/dd/yyyy");
                        investigateNEvaluate.SAPRef                       = result.SAP_Quote_Ref;
                        warranty.investigateNEvaluate                     = investigateNEvaluate;
                    }
                }
                if (resultSet != null && resultSet.Count >= 6 && resultSet[6] != null)
                {
                    foreach (var result in resultSet[6])
                    {
                        RiskAssessment riskAssessment = new RiskAssessment();
                        riskAssessment.RAID                      = result.Risk_Assessment_ID;
                        riskAssessment.RAStatus                  = Convert.ToString(result.Status_Report_ID);
                        riskAssessment.DateofRiskAssess          = result.RA_Completed_Date == null ? null : result.RA_Completed_Date.ToString("MM/dd/yyyy");
                        riskAssessment.RiskAssessmentCompletedBy = Convert.ToString(result.RA_Completed_By_ID);
                        riskAssessment.RiskAssessmentMatrix      = Convert.ToString(result.Risk_Assessment_Matrix);
                        riskAssessment.Severity                  = Convert.ToString(result.Probability_Number);
                        riskAssessment.Occurrence                = Convert.ToString(result.Consequence_Number);
                        riskAssessment.Detection                 = Convert.ToString(result.Detection_Number);
                        riskAssessment.Score                     = Convert.ToString(result.Risk_Assessment_Score);
                        riskAssessment.RiskAssessmentColor       = result.RA_Colour;
                        riskAssessment.RAJ      = result.RA_Justification;
                        warranty.riskAssessment = riskAssessment;
                    }
                }
                if (resultSet != null && resultSet.Count >= 7 && resultSet[7] != null)
                {
                    foreach (var result in resultSet[7])
                    {
                        ComplaintRespToCustomer complaintRespToCustomer = new ComplaintRespToCustomer();
                        complaintRespToCustomer.RespondID           = result.Respond_ID;
                        complaintRespToCustomer.CRTCStatus          = Convert.ToString(result.Status_Report_ID);
                        complaintRespToCustomer.DateResponded       = result.Responded_Date == null ? null : result.Responded_Date.ToString("MM/dd/yyyy");;
                        complaintRespToCustomer.PersonResponding    = Convert.ToString(result.Response_Person_Who_ID);
                        complaintRespToCustomer.WarrantyLetter      = result.Responding_Warranty_Letter_Flag;
                        complaintRespToCustomer.CustomerExplanation = result.Customer_Explanation;
                        warranty.complaintRespToCustomer            = complaintRespToCustomer;
                    }
                }
                if (resultSet != null && resultSet.Count >= 8 && resultSet[8] != null)
                {
                    foreach (var result in resultSet[8])
                    {
                        ComplaintClosure complaintClosure = new ComplaintClosure();
                        complaintClosure.CCID               = result.Customer_Closure_ID;
                        complaintClosure.CCStatus           = Convert.ToString(result.Status_Report_ID);
                        complaintClosure.CustomerClosure    = result.Closure_Customer_Flag;
                        complaintClosure.DateOfClosure      = result.Closure_Method_Date == null ? null : result.Closure_Method_Date.ToString("MM/dd/yyyy");
                        complaintClosure.MethodClosureEmail = Convert.ToString(result.Closure_Method_ID);
                        complaintClosure.KSEUKClosure       = result.Closure_KSEUK_Flag;
                        complaintClosure.MHRAClosure        = result.Closure_MHRA_Flag;
                        complaintClosure.FADR               = result.Any_Other_Docs;
                        complaintClosure.AFR = result.Any_Followup_Required;
                        complaintClosure.DateComplaintReviewed      = result.Reviewed_Date == null ? null : result.Reviewed_Date.ToString("MM/dd/yyyy");
                        complaintClosure.ComplaintReviewedBy        = Convert.ToString(result.Complaint_Reviewer_ID);
                        complaintClosure.ComplaintReviewedCompleted = result.Complaint_Reviewed_Flag;
                        complaintClosure.DateComplaintClosed        = result.CClosed_Date == null ? null : result.CClosed_Date.ToString("MM/dd/yyyy");
                        complaintClosure.ComplaintClosedBy          = Convert.ToString(result.Person_Closed_Complaint_ID);
                        complaintClosure.ComplaintClosed            = result.Lock_Stage_Closure_Flag;
                        warranty.complaintClosure = complaintClosure;
                    }
                }
                if (resultSet != null && resultSet.Count >= 9 && resultSet[9] != null)
                {
                    foreach (var result in resultSet[9])
                    {
                        CustomerFeedback customerFeedback = new CustomerFeedback();
                        customerFeedback.CFID                 = result.Customer_Follow_Up_ID;
                        customerFeedback.CFStatus             = Convert.ToString(result.Status_Report_ID);
                        customerFeedback.FollowupDueDate      = result.Follow_Up_Due_Date == null ? null : result.Follow_Up_Due_Date.ToString("MM/dd/yyyy");
                        customerFeedback.MethodofFollowUp     = Convert.ToString(result.Method_Follow_Up_ID);
                        customerFeedback.FollowupConductedBy  = Convert.ToString(result.Followup_Conducted_By_ID);
                        customerFeedback.DateReceivedFeedback = result.Received_Feedback_Date == null ? null : result.Received_Feedback_Date.ToString("MM/dd/yyyy");
                        customerFeedback.DescFeedback         = result.Description_Feedback;
                        customerFeedback.AARequired           = result.Additional_Action_Required_Flag;
                        customerFeedback.AAIfRequired         = result.Additional_Action;
                        customerFeedback.DateActionCompleted  = result.Closing_Date == null ? null : result.Closing_Date.ToString("MM/dd/yyyy");
                        customerFeedback.ActionCompletedBy    = Convert.ToString(result.Closed_By_ID);
                        warranty.customerFeedback             = customerFeedback;
                    }
                }

                if (resultSet != null && resultSet.Count >= 10 && resultSet[10] != null)
                {
                    foreach (var result in resultSet[10])
                    {
                        warranty.communicationLog                = new CommunicationLog();
                        warranty.communicationLog.CLID           = result.Comms_Log_ID;
                        warranty.communicationLog.CLStatus       = Convert.ToString(result.Status_Report_ID);
                        warranty.communicationLog.SummaryComm    = result.Summary_Comms;
                        warranty.communicationLog.CDID           = result.ComplaintDocumentationID;
                        warranty.communicationLog.OpenSharedPath = result.ComplaintDocumentationLinks;
                    }
                }
                //var response = Tuple.Create(new
                //{
                //    status = true,
                //    result = warranty
                //}, warranty);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            //return new
            //{
            //    status = true,
            //    result = warranty
            //};
            return(warranty);
        }
Exemplo n.º 11
0
        public async Task <int> AddUpdateGenericComponent([FromBody] ComponentDetails comp)
        {
            GenericComponentController controllerObj = new GenericComponentController();

            return(await controllerObj.AddUpdateGeneticComp(comp));
        }
Exemplo n.º 12
0
        public override async Task <ResponseMessage> UpdateComponentToDB()
        {
            string updateUrl = GetPutUrl(CompName);

            return(await CDPHandler.UpdateComponentToDB(updateUrl, ComponentDetails.ToString()));
        }