Exemplo n.º 1
0
        /// <summary>
        /// 修改成功案例
        /// </summary>
        /// <returns></returns>
        public int UpdateAnLi(JiaJiModels.Anli model, int teamid)
        {
            try
            {
                //查出关系表中的内容
                string sql       = "select * from successful_relation where SRelationID=" + model.SRelationID + "";
                int    successid = Convert.ToInt32(MySqlDB.GetDataTable(sql, CommandType.Text, null).Rows[0][1]);
                string teamidsql = "select count(1) from team_anli where SuccessID=" + successid + " ";
                int    countteam = MySqlDB.scalar(teamidsql, CommandType.Text, null);
                sql = "update successful set SuccessTitle='" + model.SuccessTitle + "',SuccessContent='" + model.SuccessContent + "',SuccessDate='" + model.SuccessDate + "' where SuccessID=" + successid + "; ";
                if (countteam > 0)
                {
                    sql += "update team_anli set team_anli.TeamID=" + teamid + " where SuccessID=" + successid + ";";
                }
                else
                {
                    sql += "insert into team_anli(TeamID,SuccessID) VALUES(" + teamid + "," + successid + ");";
                }
                sql += "update successful_relation set StudentID=" + model.StudentID + " where SuccessID=" + successid + " ";

                int he = MySqlDB.nonquery(sql, CommandType.Text, null);
                return(he);
            }
            catch (Exception ex)
            {
                return(0);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 修改成功案例
 /// </summary>
 /// <returns></returns>
 public int UpdateAnLi(JiaJiModels.Anli model, int teamid)
 {
     try
     {
         return(new JiaJiDAL.Anlidal().UpdateAnLi(model, teamid));
     }
     catch (Exception ex)
     {
         return(0);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// 成功案例添加
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int Anliadd(JiaJiModels.Anli model, int teamid)
 {
     try
     {
         return(new JiaJiDAL.Anlidal().Anliadd(model, teamid));
     }
     catch (Exception)
     {
         return(0);
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// 成功案例添加
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Anliadd(JiaJiModels.Anli model, int teamid)
        {
            try
            {
                string sql = "insert into successful(SuccessTitle,SuccessContent,SuccessDate) VALUES('" + model.SuccessTitle + "', '" + model.SuccessContent + "', '" + model.SuccessDate + "');select @@IDENTITY";

                int successid = Convert.ToInt32(MySqlDB.GetDataTable(sql, CommandType.Text, null).Rows[0][0]);

                sql = "insert into successful_relation(SuccessID,StudentID) VALUES(" + successid + "," + model.StudentID + ");";
                //sql += "insert into team_anli(TeamID,SuccessID) VALUES("+ teamid + "," + successid + ")";

                int he = MySqlDB.nonquery(sql, CommandType.Text, null);
                return(he);
            }
            catch (Exception)
            {
                return(0);
            }
        }