/// <summary> /// 新增店家資料 /// </summary> /// <param name="uData"></param> /// <returns></returns> public string NewShopData(ShopDataEntity uData) { uData.shopID = Guid.NewGuid().ToString(); var shops = new List <ShopDataEntity>() { uData }; ShopDataAccess.AddShopData(shops); return(JsonConvert.SerializeObject(new { success = true, errorMsg = "" })); }
/// <summary> /// 修改店家資料 /// </summary> /// <param name="uData"></param> /// <returns></returns> public string EditShopData(ShopDataEntity uData) { var shops = new List <ShopDataEntity>() { uData }; var errorMsg = string.Empty; var isSuccess = true; try { ShopDataAccess.UpdateShopData(shops); } catch (Exception ex) { isSuccess = false; errorMsg = ex.Message.Replace("\n", ""); } return(JsonConvert.SerializeObject(new { success = isSuccess, errorMsg = errorMsg })); }