public void CreateTestMasterMapping(TestMasterMappingViewModel testMasterMappingViewModel) { RestRequest request = new RestRequest("/CreateTestMasterMapping", Method.POST); request.AddJsonBody(testMasterMappingViewModel); this.iRestClientBase.Execute(request); }
public void CreateTestMasterMapping(TestMasterMappingViewModel testMasterMappingViewModel) { TestMasterMapping testMasterMapping; testMasterMapping = _iMpper.Map <TestMasterMappingViewModel, TestMasterMapping>(testMasterMappingViewModel); testMasterMappingRepositry.Add(testMasterMapping); }
//public List<usp_GetLocationAndPartMappingViewModel> GetAllLocationAndPartMasterMapping(int testMasterid, bool redirect) //{ // RestRequest request = new RestRequest("/GetAllLocationAndPartMasterMapping"); // request.AddQueryParameter("testMasterid", testMasterid.ToString()); // request.AddQueryParameter("redirect", redirect.ToString()); // return this.iRestClientBase.Execute<List<usp_GetLocationAndPartMappingViewModel>>(request); //} public void ifExistsLocationAndPartMapping(TestMasterMappingViewModel testMasterMappingViewModel) { RestRequest request = new RestRequest("/ifExistsLocationAndPartMapping", Method.POST); request.AddJsonBody(testMasterMappingViewModel); this.iRestClientBase.Execute <List <TestMasterMappingViewModel> >(request); }
public void RemovePartAndLocation(TestMasterMappingViewModel testMasterMappingViewModel) { RestRequest request = new RestRequest("/RemovePartAndLocation", Method.POST); request.AddJsonBody(testMasterMappingViewModel); this.iRestClientBase.Execute <List <TestMasterMappingViewModel> >(request); }
public void RemovePartAndLocationMapping(TestMasterMappingViewModel testMasterMappingViewModel) { TestMasterMapping testMasterMapping; testMasterMapping = _iMpper.Map <TestMasterMappingViewModel, TestMasterMapping>(testMasterMappingViewModel); //Property based updation testMasterMappingRepositry.Update(testMasterMapping, o => o.IsActive, o => o.ModifiedBy, o => o.ModifiedOn); }
public JsonResult RemovePartAndLocation(TestMasterMappingViewModel testMasterMappingViewModel) { _iTestMaserClient.RemovePartAndLocation(testMasterMappingViewModel); var Data = new { Success = ModelState.IsValid ? true : false, testMasterId = testMasterMappingViewModel.TestMasterID, msg = ModelState.IsValid ? "location and part mapping removed!" : "Error in removing part and location mapping" }; return(Json(Data, JsonRequestBehavior.AllowGet)); }
public JsonResult checkExistence(TestMasterMappingViewModel testMasterMappingViewModel) { TestMasterMapping objestMasterMapping = null; objestMasterMapping = Mapper.Map <TestMasterMappingViewModel, TestMasterMapping>(testMasterMappingViewModel); testMasterMappingService.IfExistsPartAndLocationCombination(objestMasterMapping); var Data = new { Success = true }; return(Json(Data, JsonRequestBehavior.AllowGet)); }
public JsonResult CreateTestMasterMapping(TestMasterMappingViewModel testMasterMappingViewModel) { _iTestMaserClient.CreateTestMasterMapping(testMasterMappingViewModel); if (ModelState.IsValid) { var Data = new { Success = true, testMasterId = testMasterMappingViewModel.TestMasterID, msg = "location and part has been created!" }; return(Json(Data, JsonRequestBehavior.AllowGet)); } return(null); }
public JsonResult RemovePartAndLocation(TestMasterMappingViewModel testMasterMappingViewModel) { TestMasterMapping objTestMasterMapping = null; objTestMasterMapping = Mapper.Map <TestMasterMappingViewModel, TestMasterMapping>(testMasterMappingViewModel); testMasterMappingService.RemovePartAndLocationMapping(objTestMasterMapping); iUnitOfWork.Commit(); var data = new { status = true, testMasterId = testMasterMappingViewModel.TestMasterID, msg = "Location and Part mapping removed !" }; return(Json(data, JsonRequestBehavior.AllowGet)); }
//[HandleBusinessException] // [HandleActionFilter] public ActionResult checkExistence(TestMasterMappingViewModel testMasterMappingViewModel) { List <string> errorList = new List <string>(); _iTestMaserClient.ifExistsLocationAndPartMapping(testMasterMappingViewModel); //if (!ModelState.IsValid) //{ // return PartialView("_Notification").WithValidationError( // ModelState.Where(s => s.Value.Errors.Count > 0).SelectMany(s => new List<string> { s.Value.Errors[0].ErrorMessage }).ToList() // ); //} //else return PartialView("_Notification").WithInfo(new List<string> { "" }); if (!ModelState.IsValid) { errorList = ModelState.Where(s => s.Value.Errors.Count > 0).Select(s => s.Value.Errors[0].ErrorMessage).ToList(); } var Data = new { Success = !ModelState.IsValid ? false : true, Code = !ModelState.IsValid ? 500 : 200, Message = !ModelState.IsValid ? "Combination of part and location exists!" : "Test Master Created Successfuly", error = errorList }; return(Json(Data, JsonRequestBehavior.AllowGet)); //TestMasterMapping objestMasterMapping = null; //objestMasterMapping = Mapper.Map<TestMasterMappingViewModel, TestMasterMapping>(testMasterMappingViewModel); //testMasterMappingService.IfExistsPartAndLocationCombination(objestMasterMapping); //var Data = new //{ // Success = true //}; //return Json(Data, JsonRequestBehavior.AllowGet); }
public JsonResult CreateTestMasterMapping(TestMasterMappingViewModel testMasterMappingViewModel) { //moved to mapper configuration //testMasterMappingViewModel.CreatedBy = 111; //testMasterMappingViewModel.CreatedOn = DateTime.Now; //testMasterMappingViewModel.ModifiedBy = 2222; //testMasterMappingViewModel.ModifiedOn = DateTime.Now; //testMasterMappingViewModel.IsActive = true; TestMasterMapping objestMasterMappingr = null; objestMasterMappingr = Mapper.Map <TestMasterMappingViewModel, TestMasterMapping>(testMasterMappingViewModel); testMasterMappingService.CreateTestMasterMapping(objestMasterMappingr); iUnitOfWork.Commit(); var Data = new { Success = true, testMasterId = testMasterMappingViewModel.TestMasterID, msg = "location and part has been created!" }; return(Json(Data, JsonRequestBehavior.AllowGet)); }
public IHttpActionResult CreateTestMasterMapping(TestMasterMappingViewModel testMasterMappingViewModel) { itestMasterMappingService.CreateTestMasterMapping(testMasterMappingViewModel); itestMasterMappingService.SaveTest(); return(Ok()); }
public IHttpActionResult ifExistsLocationAndPartMapping(TestMasterMappingViewModel testMasterMappingViewModel) { return(Ok()); }
public IHttpActionResult RemovePartAndLocation(TestMasterMappingViewModel testMasterMappingViewModel) { itestMasterMappingService.RemovePartAndLocationMapping(testMasterMappingViewModel); itestMasterMappingService.SaveTest(); return(Ok()); }