/// <summary> /// 修改tuandui信息 /// </summary> /// <param name="model"></param> /// <returns></returns> public int UpdateTitle(JiaJiModels.Team model) { try { return(new JiaJiDAL.teamdal().UpdateTitle(model)); } catch (Exception ex) { return(0); } }
/// <summary> /// 添加tuandui信息 /// </summary> /// <param name="model"></param> /// <returns></returns> public int addTeam(JiaJiModels.Team model) { try { return(new JiaJiDAL.teamdal().addTeam(model)); } catch (Exception ex) { return(0); } }
/// <summary> /// 修改tuandui信息 /// </summary> /// <param name="model"></param> /// <returns></returns> public int UpdateTeam(JiaJiModels.Team model) { try { string sql = "select TeamID from arearelation where AreaRelaID=" + model.AreaRelaID + ""; int teamid = Convert.ToInt32(MySqlDB.GetDataTable(sql, CommandType.Text, null).Rows[0]["TeamID"]); sql = "update team set `Name`='" + model.Name + "',`Position`='" + model.Position + "',WorkDate='" + model.WorkDate + "',ShenQing='" + model.ShenQing + "',Image1='" + model.Image1 + "',Image2='" + model.Image2 + "',TeamProduce='" + model.TeamProduce + "',SuccessCount='" + model.SuccessCount + "',SuccessContent='" + model.SuccessContent + "',SuccessKeyWord='" + model.SuccessKeyWord + "',SuccessProfile='" + model.SuccessProfile + "' where TeamID=" + teamid + "; "; sql += "update arearelation set TeamID=" + teamid + ",AreaID=" + model.AreaID + " where arearelation.AreaRelaID=" + model.AreaRelaID + ""; int he = MySqlDB.nonquery(sql, CommandType.Text, null); return(he); } catch (Exception ex) { return(0); } }
/// <summary> /// 添加团队信息 /// </summary> /// <param name="model"></param> /// <returns></returns> public int addTeam(JiaJiModels.Team model) { try { string sql = "INSERT INTO study_abroad.team (`Name`, `Position`,WorkDate,ShenQing,Image1,Image2,TeamProduce,SuccessCount,SuccessContent,SuccessKeyWord,SuccessProfile) VALUE ('" + model.Name + "','" + model.Position + "','" + model.WorkDate + "','" + model.ShenQing + "','" + model.Image1 + "','" + model.Image2 + "','" + model.TeamProduce + "','" + model.SuccessCount + "','" + model.SuccessContent + "','" + model.SuccessKeyWord + "','" + model.SuccessProfile + "');select @@IDENTITY;"; int Teamid = Convert.ToInt32(MySqlDB.GetDataTable(sql, CommandType.Text, null).Rows[0][0]); sql = "insert into arearelation(TeamID, AreaID) values(" + Teamid + "," + model.AreaID + ")"; int he = MySqlDB.nonquery(sql, CommandType.Text, null); return(he); } catch (Exception ex) { return(0); } }
public JsonResult addTitle(JiaJiModels.Team infor) { try { var i = new JiaJiBLL.teambll().InsertTitle(infor); if (i > 0) { return(Json(new { Success = true, Message = "添加成功" })); } else { return(Json(new { Success = false, Message = "添加失败" })); } } catch { return(Json(new { Success = false, Message = "添加失败" })); } }
/// <summary> /// 修改团队标题 /// </summary> /// <param name="model"></param> /// <returns></returns> public int UpdateTitle(JiaJiModels.Team model) { try { string sql = "select * from term_relation where TermRealID=" + model.TermRealID + ""; int titleid = Convert.ToInt32(MySqlDB.GetDataTable(sql, CommandType.Text, null).Rows[0][2]); int contentid = Convert.ToInt32(MySqlDB.GetDataTable(sql, CommandType.Text, null).Rows[0][3]); sql = "update team_content set Content='" + model.Content + "' where team_content.ContentID=" + contentid + ";"; sql += " update team_title set TitleName='" + model.TitleName + "' where TeamTitleID=" + titleid + "; "; sql += "update term_relation set term_relation.TeamID=" + model.TeamID + ",term_relation.TeamTitleID=" + titleid + ",term_relation.ContentID=" + contentid + " where term_relation.TermRealID=" + model.TermRealID + ""; int he = MySqlDB.nonquery(sql, CommandType.Text, null); return(he); } catch (Exception ex) { return(0); } }
public JsonResult addInsertTeam(JiaJiModels.Team infor) { try { infor.Image1 = "/image/" + infor.Image1; infor.Image2 = "/image/" + infor.Image2; var i = new JiaJiBLL.teambll().addTeam(infor); if (i > 0) { return(Json(new { Success = true, Message = "添加成功" })); } else { return(Json(new { Success = false, Message = "添加失败" })); } } catch { return(Json(new { Success = false, Message = "添加失败" })); } }
public JsonResult editTitle(JiaJiModels.Team model) { try { int id = model.TermRealID; var i = new JiaJiBLL.teambll().UpdateTitle(model); if (i > 0) { return(Json(new { Success = true, Message = "修改成功" })); } else { return(Json(new { Success = false, Message = "修改失败" })); } } catch { return(Json(new { Success = false, Message = "修改失败" })); } }