private void dataSouceBind()
 {
     tb_Video video = new tb_Video();
     video = vb.selOneVideo(Convert.ToInt32(Request.Params["VideoID"]));
     VUrl = video.VideoUrl;
     lblClickSum.Text = video.ClickSum.ToString();
     lblFBDate.Text = video.FBDate.ToString();
     lblName.Text = video.Name;
     lblVideoName.Text = video.VideoName;
     txtContent.Text = video.VideoContent;
 }
Exemplo n.º 2
0
 public tb_Video selOneVideo(int VideoID)
 {
     tb_Video video = new tb_Video();
     string sel = "select VideoID,VideoName,FBDate,ClickSum,Name,VideoUrl,VideoContent from tb_Video where VideoID=@VideoID";
     ArrayList list = sqlDal.sqlOnesDr(sel,
         new string[] { "@VideoID" },
         new string[] { VideoID.ToString() });
     video.VideoID = (int)list[0];
     video.VideoName = list[1].ToString();
     video.FBDate = (DateTime)list[2];
     video.ClickSum = (int)list[3];
     video.Name = list[4].ToString();
     video.VideoUrl = list[5].ToString();
     video.VideoContent = list[6].ToString();
     return video;
 }
Exemplo n.º 3
0
 protected void btnIssuanced_Click(object sender, EventArgs e)
 {
     try
     {
         if (ddlType.SelectedIndex == 0)
         {
             Response.Write("<script>alert('请选择课程类型')</script>");
         }
         else
         {
             string fileName = FileUpload1.FileName;
             string newFileName = Guid.NewGuid().ToString() + fileName.Substring(fileName.LastIndexOf("."));
             if (rdoVideo.Checked == true)
             {
                 string filePath = Server.MapPath("./video/");
                 FileUpload1.SaveAs(filePath + newFileName);
                 tb_Video video = new tb_Video();
                 video.VideoContent = txtContainer.Text;
                 video.VideoName = txtTitle.Text;
                 video.VideoUrl = filePath + newFileName;
                 video.Name = Session["UserName"].ToString();
                 video.VideoType = Convert.ToInt32(ddlType.SelectedIndex);
                 vb.addVideo(video);
             }
             else
             {
                 string filePath = Server.MapPath("./sound/");
                 FileUpload1.SaveAs(filePath + newFileName);
                 tb_Sound sound = new tb_Sound();
                 sound.SoundContent = txtContainer.Text;
                 sound.SoundName = txtTitle.Text;
                 sound.SoundUrl = filePath + newFileName;
                 sound.Name = Session["UserName"].ToString();
                 sound.SoundType = Convert.ToInt32(ddlType.SelectedIndex);
                 sb.addSound(sound);
             }
             Response.Write("<script>alert('上传成功')</script>");
             Response.AddHeader("Refresh", "0");
         }
     }
     catch (Exception ee)
     {
         Response.Write(ee.Message);
         throw;
     }
 }
Exemplo n.º 4
0
 private void dataSouceBind()
 {
     if (Request.Params["TutorialType"] == "Sound")
     {
         tb_Sound sound = new tb_Sound();
         int SoundID = Convert.ToInt32(Request.Params["TutorialID"]);
         soundb.AddClickNum(SoundID);
         sound = soundb.selOneSound(SoundID);
         Url = sound.SoundUrl;
         lblClickSum.Text = sound.ClickSum.ToString();
         lblFBDate.Text = sound.FBDate.ToString();
         lblName.Text = sound.Name;
         lblTutorialName.Text = sound.SoundName;
         txtContainer.Text = sound.SoundContent;
     }
     else
     {
         tb_Video video = new tb_Video();
         int VideoID = Convert.ToInt32(Request.Params["TutorialID"]);
         videob.AddClickNum(VideoID);
         video = videob.selOneVideo(VideoID);
         Url = video.VideoUrl;
         lblClickSum.Text = video.ClickSum.ToString();
         lblFBDate.Text = video.FBDate.ToString();
         lblName.Text = video.Name;
         lblTutorialName.Text = video.VideoName;
         txtContainer.Text = video.VideoContent;
     }
 }
Exemplo n.º 5
0
 public List<tb_Video> selSearchVideo(string VideoType, string SearchKey, string pageIndex, string pageSize)
 {
     tb_Video video = null;
     List<ArrayList> list = sqlDal.sqlProcDr("GETTUTORIALTABLEPAGE",
         new string[] { "@TABLENAME", "@TutorialID", "@SearchKey", "@pageIndex", "@pageSize" },
         new string[] { "Video", VideoType, SearchKey, pageIndex, pageSize });
     List<tb_Video> videoList = new List<tb_Video>();
     foreach (ArrayList obj in list)
     {
         video = new tb_Video();
         video.VideoID = (int)obj[0];
         video.VideoName = obj[1].ToString();
         video.FBDate = (DateTime)obj[2];
         video.Name = obj[3].ToString();
         videoList.Add(video);
     }
     return videoList;
 }
Exemplo n.º 6
0
 public DataSet selNewVideo()
 {
     tb_Video video = new tb_Video();
     string sel = "select top 10 VideoID,VideoName,TypeName,FBDate from tb_Video,tb_Type where VideoType=TypeID order by FBDate desc";
     return sqlDal.sqlDs(sel, null, null);
 }
Exemplo n.º 7
0
 public int addVideo(tb_Video video)
 {
     return sqlDal.sqlUpdate("insert into tb_Video(VideoType,VideoName,VideoUrl,Name,VideoContent) values(@VideoType,@VideoName,@VideoUrl,@Name,@VideoContent)",
         new string[] { "@VideoType", "@VideoName", "@VideoUrl", "@Name", "@VideoContent" },
         new string[] { video.VideoType.ToString(), video.VideoName, video.VideoUrl, video.Name,video.VideoContent });
 }
Exemplo n.º 8
0
 public List<tb_Video> selVideo()
 {
     tb_Video video = null;
     string sel = "select VideoID,VideoName,FBDate from tb_Video";
     List<ArrayList> list = sqlDal.sqlDr(sel, null, null);
     List<tb_Video> videoList = new List<tb_Video>();
     foreach (ArrayList obj in list)
     {
         video = new tb_Video();
         video.VideoID = (int)obj[0];
         video.VideoName = obj[1].ToString();
         video.FBDate = (DateTime)obj[2];
         videoList.Add(video);
     }
     return videoList;
 }
Exemplo n.º 9
0
 public DataSet selTopVideo()
 {
     tb_Video video = new tb_Video();
     string sel = "select top 5 VideoID,VideoName,TypeName,ClickSum from tb_Video,tb_Type where VideoType=TypeID order by ClickSum desc";
     return sqlDal.sqlDs(sel, null, null);
 }
Exemplo n.º 10
0
 public int addVideo(tb_Video video)
 {
     return vd.addVideo(video);
 }