示例#1
0
        /// <summary>
        /// 保存数据
        /// </summary>
        /// <returns>返回Json串</returns>
        public string Save()
        {
            string paymentmethodformData = System.Web.HttpContext.Current.Request.Form["paymentmethodformData"];
            string otype = System.Web.HttpContext.Current.Request.Form["otype"];
            var    paymentmethodforminfo = DataConverterHelper.JsonToEntity <PaymentMethodModel>(paymentmethodformData);

            List <PaymentMethodModel> paymentMethods = paymentmethodforminfo.AllRow;
            var checkresult = PaymentMethodService.ExecuteDataCheck(ref paymentMethods, otype);

            if (checkresult.Status == ResponseStatus.Error)
            {
                return(DataConverterHelper.SerializeObject(checkresult));
            }

            SavedResult <Int64> savedresult = new SavedResult <Int64>();

            try
            {
                savedresult = PaymentMethodService.Save <Int64>(paymentmethodforminfo.AllRow, "");
            }
            catch (Exception ex)
            {
                savedresult.Status = ResponseStatus.Error;
                savedresult.Msg    = ex.Message.ToString();
            }
            return(DataConverterHelper.SerializeObject(savedresult));
        }