gyhlw_dotnet/网站项目/VRS/Management/Boat/EditionManage.aspx.cs

102 lines
3.3 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using VRS.Util;
namespace VRS.Management.Boat
{
public partial class EditionManage : BaseListPage
{
DataService.BLL.pro_edition bll = new DataService.BLL.pro_edition();
DataService.BLL.admin_log log = new DataService.BLL.admin_log();
protected override void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataLoad();
}
}
protected override void DataLoad()
{
StringBuilder query = new StringBuilder(" 1 = 1 "); // 过滤总管理员
if (!string.IsNullOrWhiteSpace(version_number.Text.Trim()))
{
query.AppendFormat(" AND version_number LIKE '%{0}%' ", version_number.Text.Trim());
}
if (!string.IsNullOrWhiteSpace(type.SelectedValue))
{
query.AppendFormat(" AND type = '{0}' ", type.SelectedValue);
}
query.Append(" order by `first` DESC , `second` DESC , `third` DESC ");
var data = bll.GetModelList(query.ToString());
dataList.DataSource = data;
dataList.Rebind();
}
protected override void GridList_PageIndexChanged(object sender, GridPageChangedEventArgs e)
{
DataLoad();
}
protected override void GridList_PageSizeChanged(object sender, GridPageSizeChangedEventArgs e)
{
DataLoad();
}
protected override void GridList_SortCommand(object sender, GridSortCommandEventArgs e)
{
DataLoad();
}
protected override void GrdList_DeleteCommand(object sender, GridCommandEventArgs e)
{
}
protected override void AjaxManager_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
}
protected void btnSelect_Click(object sender, EventArgs e)
{
DataLoad();
}
protected void btnDelete_Click(object sender, EventArgs e)
{
var model = bll.GetModel(IdInput.Value);
if (bll.Delete(IdInput.Value))
{
if (!string.IsNullOrEmpty(model.url))
{
string appid = ConfigInfo.cos_appid;
string region = ConfigInfo.cos_region;
string buket_name = ConfigInfo.cos_buket_name;
CosClient client = new CosClient(appid, region);
var file_path_name = model.url.Replace("https://lzy-1300932214.cos.ap-nanjing.myqcloud.com", "");
var del = client.DeleteFile(buket_name, file_path_name);
if (del.Code == 204)
{
//var message = "删除成功";
}
else
{
var fail = "删除失败 ,失败原因:" + del.Message;
}
}
RadAjaxManager1.Alert("删除版本成功!");
log.write_log("删除版本成功。" + "类型:" + model.type + ",版本号:" + model.version_number + "ID" + model.edition_id);
}
DataLoad();
}
}
}