private void SetMessage(EstimateModel estimateModel) { imgThumbIcon.Hidden = true; lblCongratulationTitle.Text = string.Empty; lblLine1.Text = string.Empty; lblLine2.Text = string.Empty; lblLine3.Text = string.Empty; lblLine4.Text = string.Empty; lblLine5.Text = string.Empty; if (estimateModel.IsDepositPaidByCheck) { lblLine1.Text = "We have received your request"; lblLine2.Text = "for deposit payment with a check."; lblLine3.Text = "Our sales representative will contact you shortly"; lblLine4.Text = "to guide you further."; lblLine5.Text = "You can go to dashboard and save your changes."; } else if (!estimateModel.PaymentStatus) { lblLine1.Text = "Sorry! Your payment was not successful."; UIHelper.SetLabelFont(lblLine1, JKMEnum.LinotteFont.LinotteSemiBold.GetStringValue()); lblLine2.Text = "Don't worry though. You can go to dashboard,"; lblLine3.Text = " and still save the move details."; lblLine4.Text = "Our sales representative will contact you shortly,"; lblLine5.Text = "and help with the booking process"; } }
/// <summary> /// Method Name : UpdateMoveDataAsync /// Author : Hiren Patel /// Creation Date : 1 Feb 2018 /// Purpose : Use for Update move data /// Revision : /// </summary> public async Task UpdateMoveDataAsync() { Move move; move = new Move(); if (DTOConsumer.dtoEstimateData != null) { estimateModel = DTOConsumer.GetSelectedEstimate(); MoveDataModel dtoMoveData = DTOConsumer.dtoMoveData; dtoMoveData.StatusReason = GetMoveStatusReason(estimateModel); loadingOverlay = UIHelper.ShowLoadingScreen(View); APIResponse <MoveDataModel> aPIResponse = await move.PutMoveData(dtoMoveData, estimateModel.MoveNumber); if (aPIResponse.STATUS) { await DTOConsumer.BindMoveDataAsync(); PerformSegue("MoveConfirmedToDashBoard", this); } else { UIHelper.ShowMessage(aPIResponse.Message); } loadingOverlay.Hide(); } }
public ActionResult AjaxUpdate(EstimateModel objEstimatemodel, string TextField) { objResponse Response = new objResponse(); Project.Entity.Estimate objEstimate = new Entity.Estimate(); session = new SessionHelper(); try { if (objEstimatemodel.Date != null) { objEstimate.Date = BAL.Helper.Helper.ConvertToDateNullable(objEstimatemodel.Date, "dd/MM/yyyy"); } objEstimate.Estimate_ID_Auto_PK = objEstimatemodel.Estimate_ID; objEstimate.Language = objEstimatemodel.Language; objEstimate.AssignTo = objEstimatemodel.AssignTo; objEstimate.Priority = objEstimatemodel.Priority; objEstimate.Requirment = objEstimatemodel.Requirment; Response = objEstimateManager.UpdateEstimate(objEstimate, session.UserSession.Username, TextField); if (Response.ErrorCode == 0) { return(Json("Success", JsonRequestBehavior.AllowGet)); } else { return(Json("Fail", JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { BAL.Common.LogManager.LogError("AjaxUpdate Post Method", 1, Convert.ToString(ex.Source), Convert.ToString(ex.Message), Convert.ToString(ex.StackTrace)); return(Json("Fail", JsonRequestBehavior.AllowGet)); } }
public ActionResult EstimateHome() { EstimateModel model = new EstimateModel(); model.Estimations = objEstimateManager.getEstimate(); return(View(model)); }
/// <summary> /// Method Name : SetEstimateData /// Author : Hiren Patel /// Creation Date : 30 Dec 2017 /// Purpose : Set estimates data /// Revision : /// </summary> public void SetEstimateData(EstimateModel estimateModel, UITableView tableView, EstimateListViewController estimateListViewController) { this.estimateListViewController = estimateListViewController; this.estimateModel = estimateModel; lblEstimateTitle.Text = estimateModel.MoveNumber; if (string.IsNullOrEmpty(estimateModel.EstimatedLineHaul)) { lblExcessValuation.Text = UtilityPCL.CurrencyFormat("0"); } else { lblExcessValuation.Text = estimateModel.EstimatedLineHaul; } if (estimateModel.MoveNumber == UtilityPCL.selectedMoveNumber) { btnSelectEstimate.SetImage(UIImage.FromFile(AppConstant.ESTIMATE_SELECETD_IMAGE_URL), UIControlState.Normal); } else { btnSelectEstimate.SetImage(UIImage.FromFile(AppConstant.ESTIMATE_UNSELECETD_IMAGE_URL), UIControlState.Normal); } SetIimgViewEstimateTap(); btnSelectEstimate.TintColor = UIColor.White; btnSelectEstimate.Layer.BorderWidth = 0; this.tableView = tableView; }
/// <summary> /// Method Name : PopulateData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { viewDepositCollected.Hidden = true; viewTransactionDetails.Hidden = true; estimateModel = DTOConsumer.GetSelectedEstimate(); int stepLenth = 10; if (estimateModel != null) { lblDepositCollected.Text = estimateModel.Deposit; lblTransactionId.Text = estimateModel.TransactionId; SetDataBaseOnPaymentMode(estimateModel); if (estimateModel.IsDepositPaid) { stepLenth = 9; } } if (stepLenth == 10) { imgBigStepNumber.Image = UIImage.FromFile("10.png"); } else { imgBigStepNumber.Image = UIImage.FromFile("09.png"); } UIHelper.CreateWizardHeader(stepLenth, viewHeader, estimateModel); }
/// <summary> /// Method Name : SetStatusCode /// Author : Vivek Bhavsar /// Creation Date : 23 Jan 2018 /// Purpose : sub method to set status code /// Revision : /// </summary> /// <param name="dtoEstimate"></param> private void SetStatusCode(EstimateModel dtoEstimate) { if (!string.IsNullOrEmpty(dtoEstimate.StatusReason)) { dtoEstimate.StatusReason = UtilityPCL.GetMoveDataDisplayValue(dtoEstimate.StatusReason, MoveDataDisplayResource.msgMoveCode); } }
public async Task <ActionResult <EstimateModel> > Post(int invoiceId, EstimateModel model) { try { //Make sure EstimateId is not already taken var existing = await _repository.GetEstimateAsync(invoiceId, model.Id); if (existing != null) { return(BadRequest("Estimate Id in Use")); } //map var Estimate = _mapper.Map <Estimate>(model); //save and return if (!await _repository.StoreNewEstimateAsync(invoiceId, Estimate)) { return(BadRequest("Bad request, could not create record!")); } else { var location = _linkGenerator.GetPathByAction("Get", "Estimate", new { invoiceId = Estimate.InvoiceId, Estimate.Id }); return(Created(location, _mapper.Map <EstimateModel>(Estimate))); } } catch (Exception e) { _logger.LogError(e, e.Message); return(this.StatusCode(StatusCodes.Status500InternalServerError, "Database Failure")); } }
public ActionResult CreateSheet(EstimateModel estimate) { var newEstimate = new Estimate { Title = estimate.Title, Comments = estimate.Comments, CreatedByUserId = WebUser.Id }; _estimateRepository.Create(newEstimate); _unitOfWork.Commit(); foreach (var lineItem in estimate.Rows) { var newEstimateLineItem = new EstimateLineItem() { EstimateId = newEstimate.Id, Module = lineItem.Module, Task = lineItem.Task, Effort = lineItem.Effort, Comment = lineItem.Comment, WorkType = lineItem.WorkType }; _estimateLineItemRepository.Create(newEstimateLineItem); } _unitOfWork.Commit(); return(Json(true)); }
/// <summary> /// Method Name : PopulateValuatiosData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateValuatiosData(EstimateModel estimateModel) { txtCost.Text = UtilityPCL.RemoveCurrencyFormat(estimateModel.ExcessValuation); txtCoverageValue.Text = estimateModel.ValuationDeductible; txtDeclaredValue.Text = UtilityPCL.RemoveCurrencyFormat(estimateModel.ValuationCost); SetChangedUnChangedImage(imgValuation, estimateModel.IsValuationEdited); }
public ActionResult EstimateEditPopup(int id) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageCountries)) { return(AccessDeniedView()); } var sp = _EstimateService.GetEstimateByStateId(id); if (sp == null) { var model = new EstimateModel(); model.StateId = id; //default value return(View(model)); } else { var spp = new EstimateModel(); spp.LePhiTruocBa = sp.LePhiTruocBa; spp.PhiBHVC = sp.PhiBHVC; spp.BaoHiemTNDS = sp.BaoHiemTNDS; spp.BienSo = sp.BienSo; spp.PhiBHVC = sp.PhiBHVC; spp.StateId = sp.StateId; spp.PhiDuongBo = sp.PhiDuongBo; spp.PhiKiemDinh = sp.PhiKiemDinh; return(View(spp)); } }
private void DisplayCount() { estimateModel = DTOConsumer.dtoEstimateData.FirstOrDefault(rc => rc.MoveNumber == UIHelper.SelectedMoveNumber); if (estimateModel != null && !estimateModel.IsDepositPaid) { viewNine.Visibility = ViewStates.Visible; frameTen.Visibility = ViewStates.Visible; iCount = 10; tvCount.Text = "10"; wizMoveConfirmedWitDeposit(); } else { viewNine.Visibility = ViewStates.Gone; frameTen.Visibility = ViewStates.Gone; tvCount.Text = "09"; iCount = 9; wizMoveConfirmed(); } //viewNine.Visibility = ViewStates.Gone; //frameTen.Visibility = ViewStates.Gone; //tvCount.Text = "9"; //iCount = 9; //wizMoveConfirmed(); }
public ActionResult GetEstimate(int id) { var estimate = _estimateRepository.Get(id); var lineItems = _estimateLineItemRepository.GetAllBy(l => l.EstimateId == estimate.Id).ToList(); if (estimate != null) { var model = new EstimateModel() { Id = estimate.Id, Title = estimate.Title, Comments = estimate.Comments }; var lineItemModels = lineItems.Select(l => new EstimateLineItemModel { Module = l.Module, Task = l.Task, Effort = l.Effort, WorkType = l.WorkType, Comment = l.Comment }).ToList(); model.Rows = lineItemModels; return(Json(model, JsonRequestBehavior.AllowGet)); } return(Json(false, JsonRequestBehavior.AllowGet)); }
/// <summary> /// Method Name : PopulateAddressesData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateAddressesData(EstimateModel estimateModel) { txtOriginAddress.Text = estimateModel.CustomOriginAddress; txtDestinationAddress.Text = estimateModel.CustomDestinationAddress; SetChangedUnChangedImage(imgAddresses, estimateModel.IsAddressEdited); }
/// <summary> /// Method Name : PutEstimateData /// Author : Vivek Bhavsar /// Creation Date : 10 Jan 2018 /// Purpose : Update Estimate Details /// Revision : /// </summary> /// <param name="estimateModel"></param> /// <param name="estimateID"></param> /// <returns></returns> public async Task <APIResponse <EstimateModel> > PutEstimateData(EstimateModel estimateModel, string estimateID) { APIResponse <EstimateModel> response = new APIResponse <EstimateModel>() { STATUS = false }; HttpResponseMessage responseMessage = await apiHelper.InvokePutAPI <EstimateModel>(baseAPIUrl + estimateID, estimateModel); switch (responseMessage.StatusCode) { case HttpStatusCode.OK: response.STATUS = true; response.Message = Resource.msgPutEstimateData; break; case HttpStatusCode.NotFound: response.Message = Resource.msgPutNoEstimateFound; break; default: response.Message = apiHelper.GetAPIResponseStatusCodeMessage(responseMessage); break; } return(response); }
public async Task <ActionResult <EstimateModel> > Put(int invoiceId, int Id, EstimateModel updatedModel) { try { var currentEstimate = await _repository.GetEstimateAsync(invoiceId, Id); if (currentEstimate == null) { return(NotFound($"Could not find Estimate with Id of {Id}")); } _mapper.Map(updatedModel, currentEstimate); if (await _repository.UpdateEstimateAsync(invoiceId, currentEstimate)) { return(_mapper.Map <EstimateModel>(currentEstimate)); } } catch (Exception e) { _logger.LogError(e, e.Message); return(this.StatusCode(StatusCodes.Status500InternalServerError, "Database Failure")); } return(BadRequest()); }
/// <summary> /// Method Name : PutEstimateData /// Author : Vivek Bhavsar /// Creation Date : 22 Jan 2018 /// Purpose : Update estimate data in CRM /// Revision : /// </summary> /// <param name="estimateModel"></param> /// <param name="estimateID"></param> /// <returns></returns> public async Task <APIResponse <EstimateModel> > PutEstimateData(EstimateModel estimateModel, string estimateID) { APIResponse <EstimateModel> apiResponse; apiResponse = await estimateAPIServices.PutEstimateData(estimateModel, estimateID); return(apiResponse); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { var cell = (estimateListTableCell)tableView.DequeueReusableCell("estimateCell", indexPath); EstimateModel alertModel = estimateModelList[indexPath.Row]; cell.SetEstimateData(alertModel, tableView, estimateListViewController); return(cell); }
/// <summary> /// Method Name : PopulateServicesDates /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateServicesDates(EstimateModel estimateModel) { txtPackDate.Text = estimateModel.PackStartDate; txtLoadDate.Text = estimateModel.LoadStartDate; txtMoveDate.Text = estimateModel.MoveStartDate; SetChangedUnChangedImage(imgServiceDate, estimateModel.IsServiceDate); ResetControlServiceDates(); }
//CONSTRUCTOR public ModelReportingService(EstimateModel estimateModel, ReportModel reportModel) { _reportModel = reportModel; _estimateModel = estimateModel; try { GenerateModelReport(); } catch (Exception e) { Console.WriteLine(e.Message); } }
/// <summary> /// Method Name : PopulateData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null) { txtWhatMattersMost.Text = estimateModel.WhatMattersMost; } UIHelper.CreateWizardHeader(5, viewHeader, estimateModel); }
public IActionResult Create([FromBody] EstimateModel estimateModel) { if (!ModelState.IsValid) { return(View("~/Views/Panel/Income/Create.cshtml")); } List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> >(); parameters.Add(new KeyValuePair <string, string>("i_id_organization_master", _objHelper.GetTokenData(HttpContext.User.Identity as ClaimsIdentity, "id_organization"))); parameters.Add(new KeyValuePair <string, string>("i_id_currency_master", estimateModel.currency)); parameters.Add(new KeyValuePair <string, string>("i_id_customer_master", estimateModel.cutomer)); parameters.Add(new KeyValuePair <string, string>("i_date", estimateModel.date)); parameters.Add(new KeyValuePair <string, string>("i_expires", estimateModel.expires)); parameters.Add(new KeyValuePair <string, string>("i_footer", estimateModel.footer)); parameters.Add(new KeyValuePair <string, string>("i_header", estimateModel.header)); parameters.Add(new KeyValuePair <string, string>("i_memo", estimateModel.memo)); parameters.Add(new KeyValuePair <string, string>("i_po_so", estimateModel.po_so)); parameters.Add(new KeyValuePair <string, string>("i_subhead", estimateModel.subhead)); parameters.Add(new KeyValuePair <string, string>("i_version", estimateModel.version)); parameters.Add(new KeyValuePair <string, string>("i_created_by", _objHelper.GetTokenData(HttpContext.User.Identity as ClaimsIdentity, "id_user"))); DataTable _dtResp = _objDataHelper.ExecuteProcedure("insert_estimate_master", parameters); if (this._objHelper.checkDBResponse(_dtResp)) { // ENTER DETAILS parameters = new List <KeyValuePair <string, string> >(); parameters.Add(new KeyValuePair <string, string>("i_id_estimate_master", _dtResp.Rows[0]["estimate_id"].ToString())); for (int i = 0; i < estimateModel.estimateDetailList.Count; i++) { parameters.Add(new KeyValuePair <string, string>("i_id_tax_master", estimateModel.estimateDetailList[i].tax)); parameters.Add(new KeyValuePair <string, string>("i_id_product_master", estimateModel.estimateDetailList[i].product)); parameters.Add(new KeyValuePair <string, string>("i_description", estimateModel.estimateDetailList[i].description)); parameters.Add(new KeyValuePair <string, string>("i_quantity", estimateModel.estimateDetailList[i].quantity)); parameters.Add(new KeyValuePair <string, string>("i_price", estimateModel.estimateDetailList[i].price)); parameters.Add(new KeyValuePair <string, string>("i_amount", estimateModel.estimateDetailList[i].amount)); DataTable _dtRespDetail = _objDataHelper.ExecuteProcedure("insert_estimate_detail", parameters); // Remove for next iteration parameters.Remove(new KeyValuePair <string, string>("i_id_tax_master", estimateModel.estimateDetailList[i].tax)); parameters.Remove(new KeyValuePair <string, string>("i_id_product_master", estimateModel.estimateDetailList[i].product)); parameters.Remove(new KeyValuePair <string, string>("i_description", estimateModel.estimateDetailList[i].description)); parameters.Remove(new KeyValuePair <string, string>("i_quantity", estimateModel.estimateDetailList[i].quantity)); parameters.Remove(new KeyValuePair <string, string>("i_price", estimateModel.estimateDetailList[i].price)); parameters.Remove(new KeyValuePair <string, string>("i_amount", estimateModel.estimateDetailList[i].amount)); } } else { ViewData["ErrorMessage"] = "Estimates service unavailable"; } return(View("~/Views/Panel/Income/Create.cshtml")); }
public async Task <APIResponse> Estimate([FromBody] EstimateModel model) { if (BaseValidableModel.IsInvalid(model, out var errFields)) { return(APIResponse.BadRequest(errFields)); } var exchangeCurrency = FiatCurrency.Usd; TradableCurrency?cryptoToken = null; // try parse fiat currency if (Enum.TryParse(model.Currency, true, out FiatCurrency fc)) { exchangeCurrency = fc; } // or crypto currency else if (Enum.TryParse(model.Currency, true, out TradableCurrency cc)) { cryptoToken = cc; } else { return(APIResponse.BadRequest(nameof(model.Currency), "Invalid format")); } // try parse amount if (!BigInteger.TryParse(model.Amount, out var inputAmount) || inputAmount < 1 || (cryptoToken == null && !model.Reversed && inputAmount > long.MaxValue)) { return(APIResponse.BadRequest(nameof(model.Amount), "Invalid amount")); } // --- var userOrNull = await GetUserFromDb(); var rcfg = RuntimeConfigHolder.Clone(); // get user limits var limits = cryptoToken != null ? DepositLimits(rcfg, cryptoToken.Value) : await DepositLimits(rcfg, DbContext, userOrNull?.Id, exchangeCurrency) ; // estimate var estimation = await Estimation(rcfg, inputAmount, cryptoToken, exchangeCurrency, model.Reversed, 0, limits.Min, limits.Max); if (!estimation.TradingAllowed) { return(APIResponse.BadRequest(APIErrorCode.TradingNotAllowed)); } if (estimation.IsLimitExceeded) { return(APIResponse.BadRequest(APIErrorCode.TradingExchangeLimit, estimation.View.Limits)); } return(APIResponse.Success(estimation.View)); }
/// <summary> /// Method Name : PopulateData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null) { txtOriginAddress.Text = estimateModel.CustomOriginAddress; txtDestinationAddress.Text = estimateModel.CustomDestinationAddress; } UIHelper.CreateWizardHeader(4, viewHeader, estimateModel); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.LayoutActivityMoveConfirmed); estimateModel = DTOConsumer.dtoEstimateData.FirstOrDefault(rc => rc.MoveNumber == UIHelper.SelectedMoveNumber); dtoMoveData = DTOConsumer.dtoMoveData; UIReference(); DisplayCount(); ApplyFont(); }
/// <summary> /// Method Name : GetMoveStatusReason /// Author : Sanket Prajapati /// Creation Date : 24 jan 2018 /// Purpose : Use for Set move StatusReason /// Revision : /// </summary> public string GetMoveStatusReason(EstimateModel estimateModel) { if (estimateModel.PaymentStatus) { return("100000000"); } else { return("148050000"); //needs overrides } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = inflater.Inflate(Resource.Layout.LayoutFragmentMoveConfirmed, container, false); estimateModel = DTOConsumer.dtoEstimateData.FirstOrDefault(rc => rc.MoveNumber == UIHelper.SelectedMoveNumber); dtoMoveData = DTOConsumer.dtoMoveData; estimate = new Estimate(); UIReference(); ApplyFont(); view.Invalidate(); return(view); }
/// <summary> /// Method Name : PopulateData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null) { txtCost.Text = estimateModel.ValuationCost; txtCoverageValue.Text = estimateModel.ValuationDeductible; txtDeclaredValue.Text = estimateModel.ExcessValuation; } UIHelper.CreateWizardHeader(6, viewHeader, estimateModel); }
/// <summary> /// Method Name : PopulateData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { webViewPDF.LoadRequest(new NSUrlRequest(new NSUrl(AppConstant.VITAL_INFORMATION_DOCUMENT_URL, true))); webViewPDF.ScalesPageToFit = true; if (DTOConsumer.dtoEstimateData != null) { estimateModel = DTOConsumer.GetSelectedEstimate(); } UIHelper.CreateWizardHeader(7, viewHeader, estimateModel); }
/// <summary> /// Method Name : PopulateData /// Author : Hiren Patel /// Creation Date : 2 Dec 2017 /// Purpose : fill Estimate Data /// Revision : /// </summary> public void PopulateData() { uiWebViewPDF.LoadRequest(new NSUrlRequest(new NSUrl(AppConstant.VIEW_ESTIMATE_URL, true))); uiWebViewPDF.ScalesPageToFit = true; estimateModel = DTOConsumer.GetSelectedEstimate(); if (estimateModel != null) { lblEstimateName.Text = estimateModel.MoveNumber; } }