public async Task<ActionResult> Create(MSTViewModel assemblysite) { if (ModelState.IsValid) { MSTAssemblySiteDto data = new MSTAssemblySiteDto() { Name = assemblysite.Name, Description = assemblysite.Description, LastUpdatedBy = this.CurrentName, }; var result = await AssembliesSiteRepository.AddAsync(data); if (result == Model.SaveResult.SUCCESS) return RedirectToAction("Index"); } return View(assemblysite); }
public async Task<ActionResult> Create(MSTViewModel viewmodel) { if (ModelState.IsValid) { MSTLabSiteDto failureType = new MSTLabSiteDto { Name = viewmodel.Name, Description = viewmodel.Description, LastUpdatedBy = CurrentName }; var result = await LabSiteRep.AddAsync(failureType); if (result == Model.SaveResult.SUCCESS) return RedirectToAction("Index"); } return View(viewmodel); }
public async Task<ActionResult> Create(MSTViewModel viewmodel) { if (ModelState.IsValid) { MSTOriginDto bu = new MSTOriginDto { Name = viewmodel.Name, Description = viewmodel.Description, LastUpdatedBy = CurrentName }; var result = await OriginRepository.AddAsync(bu); if (result == Model.SaveResult.SUCCESS) return RedirectToAction("Index"); } return View(viewmodel); }
public async Task<ActionResult> Create(MSTViewModel model) { if (ModelState.IsValid) { MSTRatingDto rating = new MSTRatingDto() { Name = model.Name, Description = model.Description, LastUpdatedBy = CurrentName }; var result = await RatingRep.AddAsync(rating); if (result == Model.SaveResult.SUCCESS) return RedirectToAction("Index"); } return View(model); }
public async Task<ActionResult> Create(MSTViewModel model) { if (!ModelState.IsValid) return View(model); if (ModelState.IsValid) { SYSRolesDto role = new SYSRolesDto() { Name = model.Name, Description = model.Description, LastUpdatedBy = CurrentName }; var result = await RolesRepository.AddAsync(role); if (result == Model.SaveResult.SUCCESS) return RedirectToAction("Index"); } return View(model); }
public async Task<ActionResult> Edit(int id) { if (id == 0) return new HttpStatusCodeResult(HttpStatusCode.BadRequest); MSTTechnogolyDto tech = await TechRepository.SingleAsync(id); if (tech == null) return HttpNotFound(); MSTViewModel bind = new MSTViewModel { Name = tech.Name, Description = tech.Description, LastUpdatedBy = tech.LastUpdatedBy, LastUpdate = tech.LastUpdate, }; return View(bind); }
public async Task<ActionResult> Edit(int id, MSTViewModel assemblysite) { if (ModelState.IsValid) { var item = await AssembliesSiteRepository.SingleAsync(id); if (item != null) { item.Name = assemblysite.Name; item.Description = assemblysite.Description; item.LastUpdatedBy = this.CurrentName; await AssembliesSiteRepository.UpdateAsync(item); return RedirectToAction("Index"); } } return View(assemblysite); }
public async Task<ActionResult> Edit(int id) { if (id == 0) return new HttpStatusCodeResult(HttpStatusCode.BadRequest); var assemblysite = await AssembliesSiteRepository.SingleAsync(id); if (assemblysite == null) return HttpNotFound(); MSTViewModel bind = new MSTViewModel { Id = assemblysite.Id, Name = assemblysite.Name, Description = assemblysite.Description, LastUpdatedBy = assemblysite.LastUpdatedBy, LastUpdate = assemblysite.LastUpdate, }; return View(bind); }
public async Task<ActionResult> Edit(int id, MSTViewModel model) { if (ModelState.IsValid) { var status = new MSTStatusDto() { Id = id, Name = model.Name, Description = model.Description, LastUpdatedBy = CurrentName, }; var result = await StatusRespository.UpdateAsync(status); if (result == Model.SaveResult.SUCCESS) return RedirectToAction("Index"); } return View(model); }
public async Task<ActionResult> Edit(int id) { if (id == 0) return new HttpStatusCodeResult(HttpStatusCode.BadRequest); MSTOriginDto bu = await OriginRepository.SingleAsync(id); if (bu == null) return HttpNotFound(); MSTViewModel bind = new MSTViewModel { Name = bu.Name, Description = bu.Description, LastUpdatedBy = bu.LastUpdatedBy, LastUpdate = bu.LastUpdate, }; return View(bind); }
public async Task<ActionResult> Edit(int id) { if (id == 0) return new HttpStatusCodeResult(HttpStatusCode.BadRequest); MSTRatingDto rating = await RatingRep.SingleAsync(id); if (rating == null) return HttpNotFound(); MSTViewModel bind = new MSTViewModel { Id = id, Name = rating.Name, Description = rating.Description, LastUpdatedBy = rating.LastUpdatedBy, LastUpdate = rating.LastUpdate, }; return View(bind); }
public async Task<ActionResult> Edit(int id) { if (id == 0) return new HttpStatusCodeResult(HttpStatusCode.BadRequest); MSTDepartmentDto department = await DepartmentRepository.SingleAsync(id); if (department == null) return HttpNotFound(); MSTViewModel bind = new MSTViewModel { Name = department.Name, Description = department.Description, LastUpdatedBy = department.LastUpdatedBy, LastUpdate = department.LastUpdate, }; return View(bind); }
public async Task<ActionResult> Edit(int id, MSTViewModel viewmodel) { if (ModelState.IsValid) { var role = new SYSRolesDto { Id = id, Name = viewmodel.Name, Description = viewmodel.Description, LastUpdatedBy = CurrentName }; var result = await RolesRepository.UpdateAsync(role); switch (result) { case Model.SaveResult.SUCCESS: return RedirectToAction("Index"); default: return View(viewmodel); } } return View(viewmodel); }
public async Task<ActionResult> Create(MSTViewModel viewmodel) { if (ModelState.IsValid) { FARMechanismDto mechanism = new FARMechanismDto { Name = viewmodel.Name, Description = viewmodel.Description, LastUpdatedBy = CurrentName }; var result = await MechanismRep.AddAsync(mechanism); if (result == Model.SaveResult.SUCCESS) return RedirectToAction("Index"); } return View(viewmodel); }
public async Task<ActionResult> Edit(int id) { if (id == 0) return new HttpStatusCodeResult(HttpStatusCode.BadRequest); FARMechanismDto mechanism = await MechanismRep.SingleAsync(id); if (mechanism == null) return HttpNotFound(); MSTViewModel bind = new MSTViewModel { Name = mechanism.Name, Description = mechanism.Description, LastUpdatedBy = mechanism.LastUpdatedBy, LastUpdate = mechanism.LastUpdate, }; return View(bind); }
public async Task<ActionResult> Edit(int id) { if (id == 0) return new HttpStatusCodeResult(HttpStatusCode.BadRequest); MSTPackageTypesDto package = await PackageTypesRepository.SingleAsync(id); if (package == null) return HttpNotFound(); MSTViewModel bind = new MSTViewModel { Name = package.Name, Description = package.Description, LastUpdatedBy = package.LastUpdatedBy, LastUpdate = package.LastUpdate, }; return View(bind); }
public async Task<ActionResult> Edit(int id, MSTViewModel viewmodel) { if (ModelState.IsValid) { MSTPackageTypesDto package = new MSTPackageTypesDto { Id = id, Name = viewmodel.Name, Description = viewmodel.Description, LastUpdatedBy = CurrentName, }; var result = await PackageTypesRepository.UpdateAsync(package); if (result == Model.SaveResult.SUCCESS) return RedirectToAction("Index"); } return View(viewmodel); }
public async Task<ActionResult> Edit(int id) { if (id == 0) return new HttpStatusCodeResult(HttpStatusCode.BadRequest); MSTLabSiteDto labSite = await LabSiteRep.SingleAsync(id); if (labSite == null) return HttpNotFound(); MSTViewModel bind = new MSTViewModel { Name = labSite.Name, Description = labSite.Description, LastUpdatedBy = labSite.LastUpdatedBy, LastUpdate = labSite.LastUpdate, }; return View(bind); }
public async Task<ActionResult> Edit(int id, MSTViewModel viewmodel) { if (ModelState.IsValid) { MSTLabSiteDto labSite = new MSTLabSiteDto { Id = id, Name = viewmodel.Name, Description = viewmodel.Description, LastUpdatedBy = CurrentName, }; var result = await LabSiteRep.UpdateAsync(labSite); if (result == Model.SaveResult.SUCCESS) return RedirectToAction("Index"); } return View(viewmodel); }
public async Task<ActionResult> Edit(int id) { if (id == 0) return new HttpStatusCodeResult(HttpStatusCode.BadRequest); MSTStatusDto status = await StatusRespository.SingleAsync(id); if (status == null) return HttpNotFound(); MSTViewModel bind = new MSTViewModel { Id = id, Name = status.Name, Description = status.Description, LastUpdatedBy = status.LastUpdatedBy, LastUpdate = status.LastUpdate, }; return View(bind); }