Пример #1
0
 public static string PublishInteractPost(string title, string keywords, string contenet, int dateSpan,
                                          string contactInfo, long memberId)
 {
     try
     {
         string json = _clientService.AddInteractPost(title, contenet, keywords, contactInfo, dateSpan, memberId);
         if (json.JObjCodeTrue())
         {
             return(json);
         }
         return(string.Empty);
     }
     catch (Exception ex)
     {
         LogHelper.GetInstance().Error(ex.ToString());
         var exResult = new { Code = 0, ex.Message };
         return(JsonConvert.SerializeObject(exResult));
     }
 }
Пример #2
0
        protected void PostCommintOnClick(object sender, EventArgs e)
        {
            string title       = Convert.ToString(Request.Form["inputTitle"]);
            string keywords    = Convert.ToString(Request.Form["inputKeyword"]);
            string content     = Convert.ToString(Request.Form["inputContent"]);
            string contactInfo = Convert.ToString(Request.Form["contactInfo"]);
            int    dateSpan    = Convert.ToInt32(Request.Form["DropListDateSpan"]);
            string json        = _serviceClient.AddInteractPost(title, content, keywords, contactInfo, dateSpan, _memberId);

            if (json.JObjCodeTrue())
            {
                Server.Transfer("HomeInteractPost.aspx", false);
            }
            else
            {
                string error = json.JobjMessageConvert <string>();
                LogHelper.GetInstance().Warn("PostCommintOnClick 失败:" + error);
                Page.ClientScript.RegisterStartupScript(GetType(), "postAddFail",
                                                        "<script language='javascript'>postAddFail(" + error + ");</script>");
            }
        }