private void GenerateTender() { this.tender = new Tender(); this.tender.Opportunity = this.opportunity; this.tender.Bidder = this.frmOpportunity.bcDetBidder.Value; this.tender.Dependency = this.frmOpportunity.dcDetDependency.Value; this.tender.EndUser = this.frmOpportunity.eucDetEndUser.Value; this.tender.Asesor = this.frmOpportunity.acDetAsesor.Value; this.tender.Deadline = (Nullable <DateTime>) this.frmOpportunity.dteDetDeadline.Value; this.tender.PreRevisionDate = (Nullable <DateTime>) this.frmOpportunity.dteDetPrerevisionDate.Value; this.tender.RegistrationDate = (Nullable <DateTime>) this.frmOpportunity.dteDetRegistrationDate.Value; this.tender.AcquisitionReason = this.frmOpportunity.txtDetAcquisitionReason.Text; this.tender.Name = this.frmOpportunity.txtDetOpportunityName.Text; this.tender.Activated = true; this.tender.Deleted = false; foreach (OpportunityLog opportunityLog in this.opportunity.OpportunityLogs.Where(x => x.Activated.Value && !x.Deleted.Value)) { TenderLog tenderLog = new TenderLog(); ObjectsUtil.CopyProperties(tenderLog, opportunityLog); tenderLog.Tender = this.tender; this.tender.TenderLogs.Add(tenderLog); } this.srvTender.Save(this.tender); this.frmOpportunity.txtDetRelatedTender.Text = this.tender.Name; this.frmOpportunity.gbxDetRelatedTender.Visible = true; this.frmOpportunity.ubtnDetGenerateTender.Visible = false; }
public void showObjectData() { bool isGoodName = false; List <Type> listObjets = ObjectsUtil.getAllClasses(); foreach (Type item in listObjets) { Console.WriteLine(item.Name); } Console.WriteLine("Sélectionnez un type d'objet : "); SelectedDataType = ConsoleUtil.ReadLine(); foreach (Type item in listObjets) { if (item.Name == SelectedDataType) { isGoodName = true; } } if (isGoodName == true) { selectDataFromType(); typeSelectData(userId); } else { showError(() => showObjectData()); } }