双击行:在WebPart的DataGrid1_GridRowDbClicked_Extend中
//DataGrid1_GridRowDbClicked...
private void DataGrid1_GridRowDbClicked_Extend(object sender, GridDBClickEventArgs e)
{
//调用模版提供的默认实现.--默认实现可能会调用相应的Action.
string DataID = this.Model.RtnProfitOrder.FocusedRecord["MainID"].ToString();
OnNavigatCard("Browse", DataID, "UFIDA.U9.DW.QXQ.RtnProfitOrderBE.RtnProfitOrderUrl");
DataGrid1_GridRowDbClicked_DefaultImpl(sender,e);
}
private void OnNavigatCard(string type, string dataID, string formID)
{
if (dataID == String.Empty && type == "Browse") return;
System.Collections.Specialized.NameValueCollection nameValCol = new System.Collections.Specialized.NameValueCollection();
nameValCol.Add("PDPageStatus", type);
nameValCol.Add("ID", dataID);
this.NavigatePage(formID, nameValCol);
}
新增:在Action的OnNew_Extend中
private void OnNew_Extend(object sender, UIActionEventArgs e)
{
NavigateToCard("UFIDA.U9.DW.QXQ.RtnProfitOrderBE.RtnProfitOrderUrl", string.Empty, "New", "");
//调用模版定义的默认实现方法.如需扩展,请直接在此编程.
this.OnNew_DefaultImpl(sender,e);
}
private void NavigateToCard(string pageID, string dataID, string type, string fieldName)
{
//页面参数,将传递到页面
NaviteParamter parameter = new NaviteParamter();
//如果当前表头记录不为空
if (!string.IsNullOrEmpty(fieldName))
{
if (this.MainView.FocusedRecord != null && this.MainView.Fields.Contains(fieldName) && this.MainView.FocusedRecord[fieldName] != null)
parameter.NameValues.Add(fieldName, this.MainView.FocusedRecord[fieldName].ToString());
}
string DataID = dataID;
if (DataID == string.Empty && type == "Browse") return;
parameter.NameValues.Add("PDPageStatus", type);
//设置数据状态New,Browse
parameter.AddPDPageID(DataID);
//传递一条数据记录ID,在IPart.NameValues[PDPageID]中
parameter.NameValues.Add("ID", DataID);
NavigateManager.NavigatePage(this.CurrentPart, pageID, parameter);
}
评论 (0)