Пример #1
0
        /// <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 = "" }));
        }
Пример #2
0
        /// <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 }));
        }