示例#1
0
 /// <summary>
 /// 修改学员分享列表
 /// </summary>
 /// <returns></returns>
 public int UpdateInformation(JiaJiModels.ShareModel model)
 {
     try
     {
         string sql = "Update study_abroad.information set Title = '" + model.Title + "', Content = '" + model.Content + "', InfoDate = '" + model.InfoDate + "', `Source`= '" + model.Source + "', Author = '" + model.Author + "', ReadCount =" + model.ReadCount + ", LookYes =" + model.LookYes + ", CountryID =" + model.CountryID + ",site =" + model.Site + " where informationID =" + model.InformationID + " ";
         int    he  = MySqlDB.nonquery(sql, System.Data.CommandType.Text, null);
         return(he);
     }
     catch (Exception ex)
     {
         return(0);
     }
 }
示例#2
0
 /// <summary>
 /// 添加学员分享列表
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int infoadd(JiaJiModels.ShareModel model)
 {
     try
     {
         string sql = "INSERT INTO study_abroad.information (Title, Content, InfoDate, Source, Author, ReadCount, LookYes, CountryID,Site)VALUES ('" + model.Title + "', '" + model.Content + "', '" + model.InfoDate + "', '" + model.Source + "', '" + model.Author + "', " + model.ReadCount + ", " + model.LookYes + ", " + model.CountryID + "," + model.Site + ")";
         int    he  = MySqlDB.nonquery(sql, System.Data.CommandType.Text, null);
         return(he);
     }
     catch (Exception ex)
     {
         return(0);
     }
 }
示例#3
0
 public ActionResult addIndex(JiaJiModels.ShareModel model)
 {
     try
     {
         model.ShareImg = "/image/" + model.ShareImg;
         var i = new JiaJiBLL.LanguageBLL().AddShare(model);
         if (i > 0)
         {
             return(Json(new { Success = true, Message = "添加成功" }));
         }
         else
         {
             return(Json(new { Success = false, Message = "添加失败" }));
         }
     }
     catch
     {
         return(Json(new { Success = false, Message = "添加失败" }));
     }
 }
示例#4
0
        public JsonResult editIndex(JiaJiModels.ShareModel model)
        {
            try
            {
                int id = model.ShareID;

                var i = new JiaJiBLL.LanguageBLL().UpdateShare(model);
                if (i > 0)
                {
                    return(Json(new { Success = true, Message = "修改成功" }));
                }
                else
                {
                    return(Json(new { Success = false, Message = "修改失败" }));
                }
            }
            catch
            {
                return(Json(new { Success = false, Message = "修改失败" }));
            }
        }