private void dataSouceBind()
 {
     tb_Sound sound = new tb_Sound();
     sound = soundb.selOneSound(Convert.ToInt32(Request.Params["SoundID"]));
     SUrl = sound.SoundUrl;
     lblClickSum.Text = sound.ClickSum.ToString();
     lblFBDate.Text = sound.FBDate.ToString();
     lblName.Text = sound.Name;
     lblVideoName.Text = sound.SoundName;
     txtContent.Text = sound.SoundContent;
 }
Example #2
0
 public tb_Sound selOneSound(int SoundID)
 {
     tb_Sound sound = new tb_Sound();
     string sel = "select SoundID,SoundName,FBDate,ClickSum,Name,SoundUrl,SoundContent from tb_Sound where SoundID=@SoundID";
     ArrayList list = sqlDal.sqlOnesDr(sel,
         new string[] { "@SoundID" },
         new string[] { SoundID.ToString() });
     sound.SoundID = (int)list[0];
     sound.SoundName = list[1].ToString();
     sound.FBDate = (DateTime)list[2];
     sound.ClickSum = (int)list[3];
     sound.Name = list[4].ToString();
     sound.SoundUrl = list[5].ToString();
     sound.SoundContent = list[6].ToString();
     return sound;
 }
 protected void btnInssuance_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("上传成功");
         }
     }
     catch (Exception ee)
     {
         Response.Write(ee.Message);
         throw;
     }
 }
 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;
     }
 }
Example #5
0
 public int addSound(tb_Sound sound)
 {
     return sd.addSound(sound);
 }
Example #6
0
 public List<tb_Sound> selSearchSound(string SoundType, string SearchKey, string pageIndex, string pageSize)
 {
     tb_Sound sound = null;
     List<ArrayList> list = sqlDal.sqlProcDr("GETTUTORIALTABLEPAGE",
         new string[] { "@TABLENAME", "@TutorialID", "@SearchKey", "@pageIndex", "@pageSize" },
         new string[] { "Sound", SoundType, SearchKey, pageIndex, pageSize });
     List<tb_Sound> soundList = new List<tb_Sound>();
     foreach (ArrayList obj in list)
     {
         sound = new tb_Sound();
         sound.SoundID = (int)obj[0];
         sound.SoundName = obj[1].ToString();
         sound.FBDate = (DateTime)obj[2];
         sound.Name = obj[3].ToString();
         soundList.Add(sound);
     }
     return soundList;
 }
Example #7
0
 public DataSet selNewSound()
 {
     tb_Sound sound = new tb_Sound();
     string sel = "select top 10 SoundID,SoundName,TypeName,FBDate from tb_Sound,tb_Type where SoundType=TypeID order by FBDate desc";
     return sqlDal.sqlDs(sel, null, null);
 }
Example #8
0
 public int addSound(tb_Sound sound)
 {
     return sqlDal.sqlUpdate("insert into tb_Sound(SoundType,SoundName,SoundUrl,Name,SoundContent) values(@SoundType,@SoundName,@SoundUrl,@Name,@SoundContent)",
         new string[] { "@SoundType", "@SoundName", "@SoundUrl", "@Name","@SoundContent" },
         new string[] { sound.SoundType.ToString(), sound.SoundName, sound.SoundUrl, sound.Name,sound.SoundContent });
 }
Example #9
0
 public DataSet selTopSound()
 {
     tb_Sound sound = new tb_Sound();
     string sel = "select top 5 SoundID,SoundName,TypeName,ClickSum from tb_Sound,tb_Type where SoundType=TypeID order by ClickSum desc";
     return sqlDal.sqlDs(sel, null, null);
 }
Example #10
0
 public List<tb_Sound> selSound()
 {
     tb_Sound sound = null;
     string sel = "select SoundID,SoundName,FBDate from tb_Sound";
     List<ArrayList> list = sqlDal.sqlDr(sel, null, null);
     List<tb_Sound> soundList = new List<tb_Sound>();
     foreach (ArrayList obj in list)
     {
         sound = new tb_Sound();
         sound.SoundID = (int)obj[0];
         sound.SoundName = obj[1].ToString();
         sound.FBDate = (DateTime)obj[2];
         soundList.Add(sound);
     }
     return soundList;
 }