void mrsClient_GetEstimateHeaderCompleted(object sender, GetEstimateHeaderCompletedEventArgs e) { if (e.Error == null) { EstimateHeader estimate = e.Result; txtComments.Text = estimate.Comments; _comments = estimate.Comments; this.Title = String.Format(this.Title.ToString(), estimate.EstimateId.ToString()); } else { ExceptionHandler.PopUpErrorMessage(e.Error, "GetEstimateHeaderCompleted"); } BusyIndicator1.IsBusy = false; }
void mrsClient_GetEstimateHeaderCompleted(object sender, GetEstimateHeaderCompletedEventArgs e) { if (e.Error == null) { EstimateHeader header = (EstimateHeader)e.Result; _originalEffectiveDate = header.EffectiveDate; _originalHomePrice = header.HomePrice; //Get Effective Date Options PopulateEffectiveDates(_recordId); } else { ExceptionHandler.PopUpErrorMessage(e.Error, "GetEstimateHeaderCompleted"); BusyIndicator1.IsBusy = false; } }
void mrsClient_GetEstimateHeaderCompleted(object sender, GetEstimateHeaderCompletedEventArgs e) { if (e.Error == null) { estimate = e.Result; _revisionnumner = estimate.RevisionNumber.ToString(); _estimatenumber = estimate.EstimateId.ToString(); if (estimate.CustomerDocumentName != null && estimate.CustomerDocumentName != "") { if (estimate.CustomerDocumentName.ToUpper().Contains("CONTRACT")) { _totalvalue = double.Parse(estimate.TotalPrice.ToString()); } else if (estimate.CustomerDocumentName.ToUpper().Contains("VARIATION")) { _totalvalue = double.Parse(estimate.TotalVariation.ToString()); } if (estimate.CustomerDocumentName.ToUpper().Contains("VARIATION") || estimate.CustomerDocumentName.ToUpper().Contains("CONTRACT")) { string[] temp = estimate.CustomerDocumentName.Split(' '); if (estimate.CustomerDocumentName.ToUpper().Contains("VARIATION")) { if (temp.Length > 0) { _customerdocumenttype = temp[0].ToUpper(); } if (temp.Length > 1) { _customerdocumentnumber = temp[1]; } } else { _customerdocumenttype = estimate.CustomerDocumentName; } if (_statusId == 2) { if (estimate.CustomerDocumentName.ToUpper().Contains("VARIATION")) { lblvariation.Visibility = Visibility.Visible; txtvariationsummary.Visibility = Visibility.Visible; txtvariationsummary.Text = estimate.CustomerDocumentDesc; _summary = estimate.CustomerDocumentDesc; } } } } else { lblTotal.Visibility = Visibility.Collapsed; txtSignedTotal.Visibility = Visibility.Collapsed; } if (_createNewRevision) { // Populate existing comments to allow user to append the comments _comments = estimate.Comments != null ? estimate.Comments : string.Empty; txtComments.Text = _comments; } switch (_statusId) { case 1: txtReason.Text = "Activating Estimate " + estimate.EstimateId.ToString(); this.Title = "Activating Estimate " + estimate.EstimateId.ToString(); txtRevision.Visibility = Visibility.Visible; cmbRevision.Visibility = Visibility.Visible; break; case 2: txtReason.Text = "Type of Acceptance "; this.Title = "Completing Estimate " + estimate.EstimateId.ToString(); txtRevision.Visibility = Visibility.Visible; cmbRevision.Visibility = Visibility.Visible; if (estimate.RevisionTypeId == 2) // STS revision type { chkCustomerNotification.Visibility = System.Windows.Visibility.Visible; } break; case 3: txtReason.Text = "Rejection Reason "; this.Title = "Rejecting Estimate " + estimate.EstimateId.ToString(); txtRevision.Visibility = Visibility.Visible; cmbRevision.Visibility = Visibility.Visible; break; case 4: txtReason.Text = "On Hold Reason "; this.Title = "Holding Estimate " + estimate.EstimateId.ToString(); break; case 5: txtReason.Text = "Cancel Reason "; this.Title = "Cancelling Estimate " + estimate.EstimateId.ToString(); break; default: break; } PopulateStatusReasons(_statusId, estimate.RevisionTypeId); } else { ExceptionHandler.PopUpErrorMessage(e.Error, "GetEstimateHeaderCompleted"); BusyIndicator1.IsBusy = false; } }
void mrsClient_GetEstimateHeaderCompleted(object sender, GetEstimateHeaderCompletedEventArgs e) { EstimateHeader header = (EstimateHeader)e.Result; txtEffectiveDate.Text = header.EffectiveDate.ToString("dd/MM/yyyy"); txtHomePrice.Text = header.HomePrice.ToString("c"); //txtPromotion.Text = header.PromotionName; txtPromotionValue.Text = header.PromotionValue.ToString("c"); txtRegion.Text = header.Region; txtTotalPrice.Text = header.TotalPrice.ToString("c"); txtUpgradeValue.Text = header.UpgradeValue.ToString("c"); txtComments.Text = header.Comments; txtFullSiteAddress.Text = GetLotAddress(header.LotNumber, header.StreetNumber, header.StreetAddress, header.Suburb, header.State, header.PostCode); txtHomeName.Text = header.HomeName; txtMargin.Text = header.MarginString; //txtTotalCost.Text = header.TotalCostBTP.ToString("c"); txtTotalCost.Text = header.TotalCostDBC.ToString("c"); txtTotalRetail.Text = header.TotalPriceExc.ToString("c"); txtTotalMargin.Text = header.TotalMargin.ToString("c"); txtEstimateNumber.Text = header.EstimateId.ToString(); txtDifficulty.Text = header.DifficultyRating; if (header.DueDate == DateTime.MinValue) { txtDueDate.Text = ""; } else { txtDueDate.Text = header.DueDate.ToString("dd/MM/yyyy"); } if (header.AppointmentDate == DateTime.MinValue) { txtAppointment.Text = ""; } else { txtAppointment.Text = header.AppointmentDate.ToString("dd/MM/yyyy"); } if (header.DepositDate == DateTime.MinValue) { txtDepositDate.Text = ""; } else { txtDepositDate.Text = header.DepositDate.ToString("dd/MM/yyyy"); } txtHomeAndLandPackage.Text = header.HomeAndLandPackage; if (!((App)App.Current).CurrentRoleAccessModule.AccessMarginModule) { txtTotalRetail.Visibility = Visibility.Collapsed; lblTotalretailexc.Visibility = Visibility.Collapsed; txtTotalCost.Visibility = Visibility.Collapsed; lbltotalcost.Visibility = Visibility.Collapsed; txtMargin.Visibility = Visibility.Collapsed; lblTotalMarginpercentage.Visibility = Visibility.Collapsed; txtTotalMargin.Visibility = Visibility.Collapsed; lblTotalMargin.Visibility = Visibility.Collapsed; } BusyIndicator1.IsBusy = false; }