Esempio n. 1
0
        /// <summary>
        /// 保存发布信息到Json
        /// </summary>
        /// <param name="data">数据集</param>
        /// <param name="accessor"></param>
        /// <returns></returns>
        protected String SaveRelease(DataSet data, GeneralAccessor accessor)
        {
            #region
            JsonHelper jsonhlp = new JsonHelper();
            try
            {
                accessor.SaveSingleT(data);
                jsonhlp.GetTopicsJson(data.Tables[0]);
                jsonhlp.AddObjectToJson("success", "true");
                if (data.Tables[0].Rows.Count > 0)
                {
                    jsonhlp.AddObjectToJson("exit", "false");
                }
                else
                {
                    jsonhlp.AddObjectToJson("exit", "true");
                }
            }
            catch (Exception e)
            {
                jsonhlp.AddObjectToJson("success", "false");
                jsonhlp.AddObjectToJson("msg", e.Message);
            }
            return(jsonhlp.ToString());

            #endregion
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="data"></param>
        /// <param name="accessor"></param>
        /// <returns></returns>
        protected String Save(DataSet data, GeneralAccessor accessor)
        {
            #region

            return(UtiSave(() => {
                accessor.SaveSingleT(data);
            }));

            #endregion
        }
Esempio n. 3
0
        protected String Save(DataSet data, GeneralAccessor accessor)
        {
            #region
            JsonHelper jsonhlp = new JsonHelper();
            try
            {
                accessor.SaveSingleT(data);
                jsonhlp.AddObjectToJson("success", "true");
            }
            catch (Exception e)
            {
                jsonhlp.AddObjectToJson("success", "false");
                jsonhlp.AddObjectToJson("msg", e.Message);
            }
            return(jsonhlp.ToString());

            #endregion
        }