dlmh_system/VRS/Management/ComHistory.aspx.cs

112 lines
3.2 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.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
namespace VRS.Management
{
public partial class ComHistory : BaseListPage
{
DataService.BLL.pro_com_history bll = new DataService.BLL.pro_com_history();
DataService.BLL.admin_log log = new DataService.BLL.admin_log();
protected override void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//BindMajors(dpMajor, "");
//BindGrade(grade, "");
BindYears(dp_yearInfo,"");
DataLoad();
}
}
protected override void DataLoad()
{
StringBuilder query = new StringBuilder(" 1 = 1 ");
if (!string.IsNullOrWhiteSpace(name.Text.Trim()))
{
query.AppendFormat(" AND (head LIKE '%{0}%' or dsc LIKE '%{0}%' ) ", name.Text.Trim());
}
if (!string.IsNullOrWhiteSpace(dp_yearInfo.SelectedValue))
{
query.AppendFormat(" AND (year_info = '{0}' ) ", dp_yearInfo.SelectedValue);
}
var sql = query.ToString();
var data = bll.GetModelList(sql);
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)
{
//string Id = (e.Item as GridDataItem).OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Id"].ToString();
//bll.Delete(Id);
//DataLoad();
}
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);
var soft_id = IdInput.Value;
/*
var list = bll_app.GetModelList("soft_id='" + soft_id + "' "); // 附件条件进度未完成now() < end_time
if (list.Count > 0)
{
RadAjaxManager1.Alert("无法删除,该软件类型已经在使用中!");
return;
}
*/
if (bll.Delete(IdInput.Value))
{
log.write_log("删除公司历程成功。" + "标题:" + model.head + "ID" + IdInput.Value);
}
DataLoad();
}
protected void dp_yearInfo_SelectedIndexChanged(object sender, DropDownListEventArgs e)
{
DataLoad();
}
}
}