public JsonResult UpdatePostage(PostageModel postage) { if (ModelState.IsValid) { if (postage.PostageID == null || postage.PostageID == 0) return Json(new { success = false }); var result = ECommerceService.SavePostage(postage.PST_Description, postage.PST_Amount, postage.PST_DomainID, postage.PST_PostageBand, postage.PST_PostageWeight, postage.PST_PostageZone, (int)postage.PostageID); if (result != null) return Json(new { success = true }); } return Json(new { success = false }); }
public JsonResult AddPostage(PostageModel postage) { if (ModelState.IsValid) { //return Json(new { success = postage != null, postageID = postage != null ? .DomainID : 0 }); var result = ECommerceService.SavePostage(postage.PST_Description, postage.PST_Amount, postage.PST_DomainID, postage.PST_PostageBand, postage.PST_PostageWeight, postage.PST_PostageZone, 0); if (result != null) return Json(new { success = true }); } return Json(new { success = false }); }
public JsonResult GetPostageData(int postageID = 0) { if (postageID == 0) return Json(new { success = false }); var entity = ECommerceService.GetPostageByID(postageID); if (entity == null) return Json(new { success = false }); var model = new PostageModel() { PostageID = postageID, PST_Description = entity.PST_Description, PST_Amount = entity.PST_Amount, PST_DomainID = entity.PST_DomainID, PST_PostageBand = entity.PST_PostageBandID, PST_PostageWeight = entity.PST_PostageWeightID, PST_PostageZone = entity.PST_PostageZoneID }; return Json(new { success = true, postage = model }); }