93 lines
2.8 KiB
C#
93 lines
2.8 KiB
C#
|
|
using System;
|
|||
|
|
using System.Data;
|
|||
|
|
using System.Configuration;
|
|||
|
|
using System.Collections;
|
|||
|
|
using System.Web;
|
|||
|
|
using System.Web.Security;
|
|||
|
|
using System.Web.UI;
|
|||
|
|
using System.Web.UI.WebControls;
|
|||
|
|
using System.Web.UI.WebControls.WebParts;
|
|||
|
|
using System.Web.UI.HtmlControls;
|
|||
|
|
using WeiSha.Common;
|
|||
|
|
|
|||
|
|
using Song.ServiceInterfaces;
|
|||
|
|
using Song.Entities;
|
|||
|
|
using System.Xml.Serialization;
|
|||
|
|
using System.IO;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
|
|||
|
|
|
|||
|
|
namespace Song.Site.Manage.Course
|
|||
|
|
{
|
|||
|
|
public partial class Outline_Accessory : Extend.CustomPage
|
|||
|
|
{
|
|||
|
|
//<2F>½<EFBFBD>ID
|
|||
|
|
private int id = WeiSha.Common.Request.QueryString["id"].Int32 ?? 0;
|
|||
|
|
//UID<49><44><EFBFBD><EFBFBD>ȫ<EFBFBD><C8AB>ΨһID
|
|||
|
|
private string uid = WeiSha.Common.Request.QueryString["uid"].String;
|
|||
|
|
//<2F>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
|
|||
|
|
private string _uppath = "Course";
|
|||
|
|
protected void Page_Load(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
if (!this.IsPostBack)
|
|||
|
|
{
|
|||
|
|
initBind();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
protected void initBind()
|
|||
|
|
{
|
|||
|
|
List<Song.Entities.Accessory> acs = Business.Do<IAccessory>().GetAll(uid, _uppath);
|
|||
|
|
foreach (Accessory ac in acs)
|
|||
|
|
{
|
|||
|
|
ac.As_FileName = Upload.Get[_uppath].Virtual + ac.As_FileName;
|
|||
|
|
}
|
|||
|
|
dlAcc.DataSource = acs;
|
|||
|
|
dlAcc.DataKeyField = "As_Id";
|
|||
|
|
dlAcc.DataBind();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected void btn_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
Song.Entities.Accessory dd = new Accessory();
|
|||
|
|
//ͼƬ
|
|||
|
|
if (fuLoad.HasFile)
|
|||
|
|
{ try
|
|||
|
|
{
|
|||
|
|
fuLoad.UpPath = _uppath;
|
|||
|
|
fuLoad.IsMakeSmall = false;
|
|||
|
|
fuLoad.SaveAndDeleteOld(dd.As_Name);
|
|||
|
|
dd.As_Name = fuLoad.FileName;
|
|||
|
|
dd.As_FileName = fuLoad.File.Server.FileName;
|
|||
|
|
dd.As_Size = fuLoad.PostedFile.ContentLength;
|
|||
|
|
dd.As_Extension = fuLoad.File.Server.Extension;
|
|||
|
|
dd.As_Uid = uid;
|
|||
|
|
dd.As_Type = _uppath;
|
|||
|
|
Business.Do<IAccessory>().Add(dd);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
this.Alert(ex.Message);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
initBind();
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
protected void lb_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
LinkButton lb = (LinkButton)sender;
|
|||
|
|
int accid = Convert.ToInt32(lb.CommandArgument);
|
|||
|
|
Business.Do<IAccessory>().Delete(accid);
|
|||
|
|
initBind();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|