public async Task <ActionResult> Index(CompanySettingViewModel model) { if (this.ModelState.IsValid) { var record = this.Mapper.Map <CompanySettingModel>(model); if (model.Id == 0) { record.CreatedDate = DateTime.Now; record.UpdatedDate = DateTime.Now; record.CreatedBy = 1; record.UpdatedBy = 1; await this.companysettingService.InsertAsync(record); this.ShowMessage(Messages.SavedSuccessfully); } else { record.UpdatedDate = DateTime.Now; await this.companysettingService.UpdateAsync(record); this.ShowMessage(Messages.UpdateSuccessfully); } return(this.RedirectToRoute(Constants.RouteArea, new { controller = "CompanySetting", action = "index", area = Constants.AreaAdmin })); } return(this.View(model)); }
/// <summary> /// Get FlightMarkup When it is there in the table /// </summary> /// <returns>CompanyView Model</returns> public async Task <ActionResult> Index() { CompanySettingViewModel viewModel = new CompanySettingViewModel(); var record = await this.companysettingService.GetCompanyMarkup(); if (record != null) { viewModel = this.Mapper.Map <CompanySettingViewModel>(record); } return(this.View(viewModel)); }