/// <summary> /// 创建团队活动 /// </summary> public static int CreateAct(TeamActInfo tacinfo) { int aid = 0; aid = Data.DbProvider.GetInstance().CreateAct(tacinfo); SASCache.GetCacheService().RemoveObject("/Sirius/ActList_" + tacinfo.Teamid); return aid; }
private void BuildActInfo(int aid) { TeamActInfo tinfo = new TeamActInfo(); tinfo = spb.GetTeamActInfo(aid); picsliststr = tinfo.Piccollect; title.Text = tinfo.Name; starttime.Text = tinfo.Start; endtime.Text = tinfo.End; shortdesc.Text = tinfo.Shortdesc; listpic.Text = tinfo.Img; listbak.Text = tinfo.Imgbak; teams.SelectedValue = tinfo.Teamid.ToString(); }
private TeamActInfo LoadActInfo() { TeamActInfo tainfo = new TeamActInfo(); tainfo.Id = actid; tainfo.Name = title.Text.Trim(); tainfo.Start = starttime.Text.Trim(); tainfo.End = endtime.Text.Trim(); tainfo.Shortdesc = shortdesc.Text.Trim(); tainfo.Img = listpic.Text.Trim(); tainfo.Imgbak = listbak.Text.Trim(); tainfo.Teamid = TypeConverter.StrToInt(teams.SelectedValue, 0); tainfo.Atype = 0; tainfo.Piccollect = SASRequest.GetString("selitems").Trim().Trim(','); return tainfo; }
public int CreateAct(TeamActInfo tai) { DbParameter[] parms = { DbHelper.MakeInParam("@name",(DbType)SqlDbType.NVarChar,50,tai.Name), DbHelper.MakeInParam("@start",(DbType)SqlDbType.SmallDateTime,4,tai.Start), DbHelper.MakeInParam("@end",(DbType)SqlDbType.SmallDateTime,4,tai.End), DbHelper.MakeInParam("@shortdesc",(DbType)SqlDbType.VarChar,500,tai.Shortdesc), DbHelper.MakeInParam("@img",(DbType)SqlDbType.VarChar,200,tai.Img), DbHelper.MakeInParam("@imgbak",(DbType)SqlDbType.VarChar,200,tai.Imgbak), DbHelper.MakeInParam("@teamid",(DbType)SqlDbType.Int,4,tai.Teamid), DbHelper.MakeInParam("@atype",(DbType)SqlDbType.Int,4,tai.Atype), DbHelper.MakeInParam("@piccollect",(DbType)SqlDbType.Text,0,tai.Piccollect) }; string commandText = String.Format("INSERT INTO [{0}teamactivity] ([name],[start],[end],[shortdesc],[img],[imgbak],[teamid],[atype],[piccollect]) VALUES (@name,@start,@end,@shortdesc,@img,@imgbak,@teamid,@atype,@piccollect);SELECT SCOPE_IDENTITY()", BaseConfigs.GetTablePrefix); return TypeConverter.ObjectToInt(DbHelper.ExecuteScalar(CommandType.Text, commandText, parms)); }
/// <summary> /// 团队活动信息实体列表 /// </summary> public static TeamActInfo GetTeamActEntity(IDataReader reader) { if (reader.Read()) { TeamActInfo tinfo = new TeamActInfo(); tinfo.Id = TypeConverter.StrToInt(reader["id"].ToString()); tinfo.Name = reader["name"].ToString(); tinfo.Start = reader["start"].ToString(); tinfo.End = reader["end"].ToString(); tinfo.Shortdesc = reader["shortdesc"].ToString(); tinfo.Img = reader["img"].ToString(); tinfo.Imgbak = reader["imgbak"].ToString(); tinfo.Teamid = TypeConverter.StrToInt(reader["teamid"].ToString()); tinfo.Atype = TypeConverter.StrToInt(reader["atype"].ToString()); tinfo.Piccollect = reader["piccollect"].ToString(); reader.Close(); return tinfo; } return null; }
/// <summary> /// 团队活动信息实体列表 /// </summary> public static List<TeamActInfo> GetTeamActInfoList(IDataReader reader) { List<TeamActInfo> tlist = new List<TeamActInfo>(); while (reader.Read()) { TeamActInfo tinfo = new TeamActInfo(); tinfo.Id = TypeConverter.StrToInt(reader["id"].ToString()); tinfo.Name = reader["name"].ToString(); tinfo.Start = reader["start"].ToString(); tinfo.End = reader["end"].ToString(); tinfo.Shortdesc = reader["shortdesc"].ToString(); tinfo.Img = reader["img"].ToString(); tinfo.Imgbak = reader["imgbak"].ToString(); tinfo.Teamid = TypeConverter.StrToInt(reader["teamid"].ToString()); tinfo.Atype = TypeConverter.StrToInt(reader["atype"].ToString()); tinfo.Piccollect = reader["piccollect"].ToString(); tlist.Add(tinfo); } reader.Close(); return tlist; }
/// <summary> /// 创建团队活动 /// </summary> public override int CreateAct(TeamActInfo tacinfo) { return Sirius.CreateAct(tacinfo); }
public override void UpdateTeamAct(TeamActInfo tinfo) { Sirius.UpdateTeamAct(tinfo); }
public void UpdateTeamAct(TeamActInfo tinfo) { DbParameter[] parms = { DbHelper.MakeInParam("@id",(DbType)SqlDbType.Int,4,tinfo.Id), DbHelper.MakeInParam("@name",(DbType)SqlDbType.NVarChar,50,tinfo.Name), DbHelper.MakeInParam("@start",(DbType)SqlDbType.SmallDateTime,4,tinfo.Start), DbHelper.MakeInParam("@end",(DbType)SqlDbType.SmallDateTime,4,tinfo.End), DbHelper.MakeInParam("@shortdesc",(DbType)SqlDbType.VarChar,500,tinfo.Shortdesc), DbHelper.MakeInParam("@img",(DbType)SqlDbType.VarChar,200,tinfo.Img), DbHelper.MakeInParam("@imgbak",(DbType)SqlDbType.VarChar,200,tinfo.Imgbak), DbHelper.MakeInParam("@teamid",(DbType)SqlDbType.Int,4,tinfo.Teamid), DbHelper.MakeInParam("@atype",(DbType)SqlDbType.Int,4,tinfo.Atype), DbHelper.MakeInParam("@piccollect",(DbType)SqlDbType.Text,0,tinfo.Piccollect) }; string commandText = String.Format("UPDATE [{0}teamactivity] SET [name] = @name,[start] = @start,[end] = @end,[shortdesc] = @shortdesc,[img] = @img,[imgbak] = @imgbak,[teamid] = @teamid,[atype] = @atype,[piccollect] = @piccollect WHERE [id] = @id", BaseConfigs.GetTablePrefix); DbHelper.ExecuteNonQuery(CommandType.Text, commandText, parms); }
/// <summary> /// 更新团队活动 /// </summary> /// <param name="tinfo"></param> public abstract void UpdateTeamAct(TeamActInfo tinfo);
/// <summary> /// 创建团队活动 /// </summary> public abstract int CreateAct(TeamActInfo tacinfo);
/// <summary> /// 更新团队活动 /// </summary> /// <param name="tinfo"></param> public static void UpdateTeamAct(TeamActInfo tinfo) { Data.DbProvider.GetInstance().UpdateTeamAct(tinfo); SASCache.GetCacheService().RemoveObject("/Sirius/ActList_" + tinfo.Teamid); }