public override object CreateBulkRegistrationType(Taxpayer taxpayer) { var items = RegistrationIndicatorItems.Select(x => x.MapStateRegistrationIndicator()); var physicalAddress = PhysicalAddress?.MapAddressType(); var mailingAddress = MailingAddress?.MapAddressType(); var contactInfo = ContactInfo?.MapContactInformation(); var technologyModel = TechnologyModel?.MapTechnologyModel(); var record = new BulkRegistrationNewType { ActionCode = BulkRegistrationNewTypeActionCode.N, RegistrationEntity = EnumHelper.GetEnumItemFromValueName <EntityType>(EntityType), NAICSCode = NaicsCode, PhysicalAddress = physicalAddress, MailingAddress = mailingAddress ?? physicalAddress, SSTPContact = contactInfo, TechnologyModel = technologyModel, Item = taxpayer.MapTaxpayerName(), SellerPhone = taxpayer.SellerPhone, SellerPhoneExt = taxpayer.SellerPhoneExtension, StateIncorporated = taxpayer.StateIncorporated, EffectiveDate = DateTime.UtcNow, FirstFilingPeriod = $"{DateTime.UtcNow.Year}-{DateTime.UtcNow:MM}", NewPass = taxpayer.Password, StateRegistrationIndicator = items.ToArray(), DBAName = taxpayer.DoingBusinessName }; return(record); }
public bool AddTechnologyDetails(TechnologyModel objTechnologyModel) { try { var objTechnologyDetail = (from emp in ac.Technology_Details where emp.Technology_ID == objTechnologyModel.Technology_ID select emp).FirstOrDefault(); if (objTechnologyDetail != null) { objTechnologyDetail.Technology_Name = objTechnologyModel.Technology_Name; objTechnologyDetail.UpdateDate = DateTime.UtcNow; objTechnologyDetail.UpdatedBy = objTechnologyModel.UpdatedBy; } else { var objTechnology = new Technology_Details() { Technology_Name = objTechnologyModel.Technology_Name, CreateDate = DateTime.UtcNow, UpdateDate = DateTime.UtcNow, UpdatedBy = objTechnologyModel.UpdatedBy, CreatedBy = objTechnologyModel.CreatedBy }; ac.Technology_Details.Add(objTechnology); } ac.SaveChanges(); return(true); } catch (Exception ex) { throw ex; } }
public ActionResult AddTechnology(TechnologyModel newTechnologyModel) { TechnologyEntity newTechnologyEntity = manage.ConvertTechnologyModelToEntity(newTechnologyModel); accessBusinessLayer.AddTechnology(newTechnologyEntity); return(View("Index")); }
public ActionResult AddEditDetail(TechnologyModel objTechnologyModel) { objTechnologyModel.CreatedBy = objTechnologyModel.UpdatedBy = User.Identity.Name; var IsSaved = objTechnology.AddTechnologyDetails(objTechnologyModel); return(RedirectToAction("Index")); }
public ActionResult Index() { ApiAccess apiAccess = new ApiAccess(); var model = new TechnologyModel(); model.Technologies = new List <string>(); model.Technologies = apiAccess.GetAllTechnologies(); return(View(model)); }
public ActionResult AddEditTechnology(int id = 0) { var objTechnologyModel = new TechnologyModel(); if (id > 0) { objTechnologyModel = objTechnology.GetTechnologyDetailsByID(id); } return(PartialView(objTechnologyModel)); }
public ActionResult Technologies(string categoryId, string subCategoryId) { var model = new TechnologyModel(_context, categoryId, subCategoryId); if (model.ActiveCategoryNotFound) return RedirectToAction("Technologies", new { categoryId = model.RedirectCategoryId, subCategoryId = model.RedirectSubCategoryId }); ViewBag.IsHomePage = model.IsHomePage; ViewBag.ContentType = 0; ViewBag.CategoryLevel = model.Technology.CategoryLevel == 0 ? "technologyRoot" : "technology"; this.SetSeoContent(model); return View(model); }
public ActionResult TechnologyDelete(int id = 0) { var objTechnologyModel = new TechnologyModel(); if (id > 0) { objTechnologyModel = objTechnology.GetTechnologyDetailsByID(id); } ViewBag.TechnologyDelete = true; return(PartialView("AddEditTechnology", objTechnologyModel)); }
public async Task <IActionResult> UpdateTechnologyAsync([FromForm] TechnologyModel technologyModel) { try { return(Ok(await technologyApp.UpdateTechnologyAsync(technologyModel))); } catch (Exception) { throw; } }
public ResultModel <bool> CreateTechnology(TechnologyModel technologyModel) { ResultModel <bool> result = new ResultModel <bool>(); Technology technology = new Technology(technologyModel.Name, technologyModel.ImageURL, technologyModel.ClientId); technology.CreatedBy = 1; unitOfWork.TechnologyRepository.Insert(technology); result.StatusCode = Convert.ToInt32(Enums.StatusCode.OK); result.Data = true; result.Success = true; return(result); }
public async Task <ResponseModel> UpdateTechnologyAsync(TechnologyModel technologyModel) { try { Technology technology = new Technology(); if (technologyModel.operation == Operation.Update) { technology = await technologyRepo.GetTechnologyByIdAsync(technologyModel.Id); } technology.Id = technologyModel.Id; technology.Description = technologyModel.Description; technology.TechnologyName = technologyModel.TechnologyName; technology.Image = technologyModel.Image is null ? technology.Image : await commonApplication.CreateFileAsync(technologyModel.Image, "Technology"); switch (technologyModel.operation) { case Operation.Add: technology = await technologyRepo.AddTechnologyAsync(technology); break; case Operation.Update: technology = await technologyRepo.UpdateTechnologyAsync(technology); break; case Operation.Delete: technology = await technologyRepo.RemoveTechnologyAsync(technology); break; default: break; } return(responseModel.CreateResponse(HttpStatusCode.OK, $"Technology {technologyModel.operation.ToString()}ed Successfully")); } catch (Exception) { throw; } }
public ResultModel <bool> UpdateTechnology(TechnologyModel technologyModel) { ResultModel <bool> result = new ResultModel <bool>(); var technology = unitOfWork.TechnologyRepository.Get(x => x.BsonId == technologyModel.BsonId && !x.IsDeleted).FirstOrDefault(); if (technology != null) { technologyModel.UpdatedBy = 1; technologyModel.UpdatedOn = DateTime.UtcNow; technologyModel.CreatedBy = technology.CreatedBy; technologyModel.CreatedOn = technology.CreatedOn; mapper.Map(technologyModel, technology); unitOfWork.TechnologyRepository.Update(technology); result.StatusCode = Convert.ToInt32(Enums.StatusCode.OK); result.Data = true; result.Success = true; } return(result); }
public ActionResult <ResultVM <bool> > Create(TechnologyVM technologyVM) { ResultVM <bool> resultVM = new ResultVM <bool>(); try { TechnologyModel technologyModel = new TechnologyModel(); mapper.Map(technologyVM, technologyModel); var result = technologyBusiness.CreateTechnology(technologyModel); mapper.Map(result, resultVM); return(resultVM); } catch (Exception ex) { resultVM.Message = ex.Message; resultVM.StatusCode = Convert.ToInt32(Enums.StatusCode.BadRequest); return(StatusCode(StatusCodes.Status400BadRequest, new { Result = resultVM })); } }
public ActionResult <ResultVM <bool> > Update(TechnologyVM technologyVM) { ResultVM <bool> resultVM = new ResultVM <bool>(); try { TechnologyModel technologyModel = new TechnologyModel(); mapper.Map(technologyVM, technologyModel); var result = technologyBusiness.UpdateTechnology(technologyModel); mapper.Map(result, resultVM); } catch (Exception ex) { Common.LogMessage(ex.Message); resultVM.Message = ex.Message; resultVM.StatusCode = Convert.ToInt32(Enums.StatusCode.BadRequest); return(StatusCode(StatusCodes.Status400BadRequest, new { Result = resultVM, Codes = new string[] { "ServerError" } })); } return(resultVM); }