public JsonResult SaveTemplate(DTO.FreightTemplate templateinfo) { if (templateinfo.SourceAddress == null || templateinfo.SourceAddress.Value == 0) { return(Json(new { successful = false })); } templateinfo.ShopID = CurrentSellerManager.ShopId; FreightTemplateApplication.AddOrUpdateFreightTemplate(templateinfo); return(Json(new { successful = true })); }
public JsonResult SaveTemplate(DTO.FreightTemplate templateinfo) { if (templateinfo.SourceAddress == null || templateinfo.SourceAddress.Value == 0) { return(Json(new { success = false })); } if (templateinfo.Name.Length > 20) { return(Json(new { success = false })); } foreach (var item in templateinfo.FreightArea) { item.FirstUnitMonry = (float)Math.Round(item.FirstUnitMonry.Value, 2); item.AccumulationUnitMoney = (float)Math.Round(item.AccumulationUnitMoney.Value, 2); } templateinfo.ShopID = CurrentSellerManager.ShopId; FreightTemplateApplication.AddOrUpdateFreightTemplate(templateinfo); return(Json(new { success = true })); }