大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。
Jetbrains全系列IDE稳定放心使用
dtData.Rows.Clear();
//Detail Table
public static void AddColumns(ref DataTable table)
{
table.Columns.Add(“BusinessType”,typeof(string));
table.Columns.Add(“BusinessUnit”,typeof(string));
table.Columns.Add(“SourceCode”,typeof(string));
table.Columns.Add(“UserName”,typeof(string));
table.Columns.Add(“SONO”,typeof(string));
table.Columns.Add(“CustomerCode_Market”,typeof(string));
table.Columns.Add(“Customer_Plantid”,typeof(string));
table.Columns.Add(“InvoiceNo”,typeof(string));
table.Columns.Add(“OCNO_PLNo”,typeof(string));
table.Columns.Add(“ItemNo”,typeof(string));
table.Columns.Add(“PCS”,typeof(string));
table.Columns.Add(“CTNS”,typeof(string));
table.Columns.Add(“CBM”,typeof(string));
table.Columns.Add(“KGS”,typeof(string));
table.Columns.Add(“ClosingDate”,typeof(string));
table.Columns.Add(“JobNO”,typeof(string));
table.Columns.Add(“DestinationID”,typeof(string));
table.Columns.Add(“Status”,typeof(string));
}
public static void updColumns(ref DataTable table)
{
table.Columns.Add(“BusinessType”,typeof(string));
table.Columns.Add(“BusinessUnit”,typeof(string));
table.Columns.Add(“SourceCode”,typeof(string));
table.Columns.Add(“UserName”,typeof(string));
table.Columns.Add(“SONO”,typeof(string));
table.Columns.Add(“CustomerCode_Market”,typeof(string));
table.Columns.Add(“Customer_Plantid”,typeof(string));
table.Columns.Add(“InvoiceNo”,typeof(string));
table.Columns.Add(“OCNO_PLNo”,typeof(string));
table.Columns.Add(“ItemNo”,typeof(string));
table.Columns.Add(“PCS”,typeof(string));
table.Columns.Add(“CTNS”,typeof(string));
table.Columns.Add(“CBM”,typeof(string));
table.Columns.Add(“KGS”,typeof(string));
table.Columns.Add(“ClosingDate”,typeof(string));
table.Columns.Add(“JobNO”,typeof(string));
table.Columns.Add(“DestinationID”,typeof(string));
table.Columns.Add(“FID”,typeof(string));
table.Columns.Add(“Status”,typeof(string));
}
****************** Datagrid ItemCommand Operator **************************
DataRow[] drsDel = dtData.Select(string.Format(“FID in ({0})”, FID.ToString()));
//直接在集合中删除 foreach (DataRow drDel in drsDel)
{ dtData.Rows.Remove(drDel); }
if( FID > 0)
{
m_objSQLBLL.DeleteTADetail(FID.ToString());
txtHiddenFID.Value += FID.ToString() + “,”; }
private void dg_FCL_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
****************** Datagrid ItemDataBound Operator **************************
private void dg_FCL_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
DropDownList listBusinessType = new DropDownList();
listBusinessType= (DropDownList)(e.Item.FindControl(“dropBusinessType”));
DataView dv = m_objSQLBLL.GetBusinessType();
if ( !( ViewState[Constants.VENDOR_CODE].ToString().Trim() == “09420” || ViewState[Constants.VENDOR_CODE].ToString().Trim() == “09421”
|| ViewState[Constants.VENDOR_CODE].ToString().Trim() == “09422” || ViewState[Constants.VENDOR_CODE].ToString().Trim() == “09415”
|| ViewState[Constants.VENDOR_CODE].ToString().Trim() == “09407”
) )
{
dv.RowFilter = ” BusinessType in (‘DI-US’,’DI-INT’,’TRADE’)”;
}
listBusinessType.DataSource = dv;
listBusinessType.DataTextField = “BusinessName”;
listBusinessType.DataValueField = “BusinessType”;
listBusinessType.DataBind();
listBusinessType.SelectedValue = ((string)DataBinder.Eval(e.Item.DataItem, “BusinessType”));
DropDownList listBusinessUnit = new DropDownList();
listBusinessUnit= (DropDownList)(e.Item.FindControl(“dropBusinessUnit”));
DataView dvBusinessUnit = m_objSQLBLL.GetBusinessUnit();
listBusinessUnit.DataSource = dvBusinessUnit;
listBusinessUnit.DataTextField = “BusinessUnit”;
listBusinessUnit.DataValueField = “BusinessUnit”;
listBusinessUnit.DataBind();
listBusinessUnit.SelectedValue = ((string)DataBinder.Eval(e.Item.DataItem, “BusinessUnit”));
DropDownList listSourceCode = new DropDownList();
listSourceCode= (DropDownList)(e.Item.FindControl(“dropSourceCode”));
DataView dvSourceCode = m_objSQLBLL.GetSourceCode();
listSourceCode.DataSource = dvSourceCode;
listSourceCode.DataTextField = “SourceCode”;
listSourceCode.DataValueField = “SourceCode”;
listSourceCode.DataBind();
listSourceCode.SelectedValue = ((string)DataBinder.Eval(e.Item.DataItem, “SourceCode”));
//20100328
DropDownList listDestinationID = new DropDownList();
listDestinationID= (DropDownList)(e.Item.FindControl(“dropDestinationID”));
DataView dvDestination = m_objSQLBLL.GetDestinationForPlant();
listDestinationID.DataSource = dvDestination;
listDestinationID.DataTextField = “DestinationAddr”;
listDestinationID.DataValueField = “DestinationID”;
listDestinationID.DataBind();
listDestinationID.SelectedValue = ((string)DataBinder.Eval(e.Item.DataItem, “DestinationID”));
if(dg_FCL.Items.Count == 0)
{
((ImageButton)(e.Item.FindControl(“Imagebutton1”))).Visible = false;
}
((ImageButton)(e.Item.FindControl(“Imagebutton1”))).Attributes.Add(“onclick”, “return confirm(‘Are you sure to delete the record ?’);”);
}
}
转载于:https://www.cnblogs.com/zhangchenliang/archive/2010/08/16/1800561.html
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/182495.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...