1、弹出已有的单据列表窗体
#region 显示列表界面
//当前选中行行号
int[] selectedIndexsR = this.View.GetControl<EntryGrid>("FEntity").GetSelectedRows();
//单据体数据
DynamicObjectCollection selectedRowsDy = this.Model.DataObject["ReqEntry"] as DynamicObjectCollection;
//选中行数据
DynamicObject selectedRow = selectedRowsDy[selectedIndexsR[0]];
string MaterialId = Convert.ToString(selectedRow["MaterialId_Id"]);
string F_paez_gys = Convert.ToString(selectedRow["F_paez_gys_Id"]);
// 打开列表界面
var showParameter = new ListShowParameter();
showParameter.FormId = "PBVD_POQuotation";
showParameter.PageId = Guid.NewGuid().ToString();
showParameter.ParentPageId = this.View.PageId;
showParameter.PermissionItemId = PermissionConst.View;
showParameter.IsLookUp = true;//是否显示返回数据菜单,显示的话,即可返回数据
showParameter.ListType = Convert.ToInt32(BOSEnums.Enu_ListType.List);
showParameter.MultiSelect = false;
if (string.IsNullOrWhiteSpace(F_paez_gys)|| F_paez_gys.Equals("0"))
{
showParameter.ListFilterParameter.Filter = " FDocumentStatus='C' and FMATERIALID ='" + MaterialId + "'"; //
}
else
{
showParameter.ListFilterParameter.Filter = " FDocumentStatus='C' and F_paez_gys='" + F_paez_gys + "' and FMATERIALID ='" + MaterialId + "'"; //
}
this.View.ShowForm(showParameter, delegate (FormResult result)//接收数据
{
ListSelectedRowCollection returnData = (ListSelectedRowCollection)result.ReturnData;
if (returnData != null)
{
foreach (ListSelectedRow item in returnData)
{
if (item.Selected)
{
DynamicObjectDataRow row = item.DataRow as DynamicObjectDataRow;
DynamicObject obj = (DynamicObject)row.DynamicObject;
if (obj["t1_FENTRYID"] != null)
{
string sqlNew = string.Format(@"/*dialect*/select FMATERIALID,F_paez_gys from t_PBVD_POQuotationEntry where FEntryID='{0}'", Convert.ToString(obj["t1_FENTRYID"]));
DataSet dsNew = DBUtils.ExecuteDataSet(this.Context, sqlNew);
if (dsNew != null && dsNew.Tables[0].Rows.Count > 0)
{
for (int i = 0; i < dsNew.Tables[0].Rows.Count; i++)
{
this.View.Model.SetItemValueByID("F_paez_gys_Id", Convert.ToString(dsNew.Tables[0].Rows[i]["F_paez_gys"]), selectedIndexsR[0]);
this.View.Model.SetItemValueByID("F_paez_gys", Convert.ToString(dsNew.Tables[0].Rows[i]["F_paez_gys"]), selectedIndexsR[0]);
}
}
}
}
}
}
});
2、弹出动态表单窗体
// 打开动态表单界面
// using Kingdee.BOS.Core.DynamicForm;
string pageId = Guid.NewGuid().ToString();
DynamicFormShowParameter showParameter = new DynamicFormShowParameter();
showParameter.FormId = "a6fe71c4beda4f7baf60411c4b5f3b3e";
showParameter.PageId = pageId;
//showParameter.OpenStyle.ShowType = ShowType.InContainer;
//showParameter.OpenStyle.TagetKey = "FTab_P2";
this.View.ShowForm(showParameter);
3、弹出即时库存窗体
// 打开即时库存查询界面,传入过滤条件
DynamicFormShowParameter inventoryQueryShowParameter = new DynamicFormShowParameter();
inventoryQueryShowParameter.FormId = "STK_InventoryQuery";
inventoryQueryShowParameter.PageId = Guid.NewGuid().ToString();
inventoryQueryShowParameter.CustomParams.Add("QueryMode", "1");
inventoryQueryShowParameter.CustomParams.Add("NeedReturnData", "0");
inventoryQueryShowParameter.CustomParams.Add("QueryOrgId", "100003");
inventoryQueryShowParameter.CustomParams.Add("StockOrgIds", "100003");
inventoryQueryShowParameter.CustomParams.Add("QueryFilter", " FMaterialId.FNumber = '1.01.001' and FStockId.FNumber = 'CK001' ");
this.View.ShowForm(inventoryQueryShowParameter);
4、弹出维护的窗体界面
// 打开单据维护界面:以打开销售订单100001为例
// using Kingdee.BOS.Core.Bill;
string pageId = Guid.NewGuid().ToString();
BillShowParameter showParameter = new BillShowParameter();
showParameter.FormId = "SAL_SaleOrder";
showParameter.OpenStyle.ShowType = ShowType.MainNewTabPage;
showParameter.PageId = pageId;
showParameter.Status = OperationStatus.EDIT;
// 传入需要修改的销售订单内码,演示代码直接固定写死为100001
showParameter.PKey = "100001";
this.View.ShowForm(showParameter);
5、弹出直接sql报表窗体
// 打开直接SQL报表
// using Kingdee.BOS.Core.Report;
string pageId = Guid.NewGuid().ToString();
SQLReportShowParameter showParameter = new SQLReportShowParameter();
showParameter.FormId = "a9e51595c6c1433ebb623c8e340f7b5b";
showParameter.PageId = pageId;
this.View.ShowForm(showParameter);
6、打开简单系统账表
// using Kingdee.BOS.Core.Report;
string pageId = Guid.NewGuid().ToString();
SysReportShowParameter showParameter = new SysReportShowParameter();
showParameter.FormId = "c3329ed2a55c4c31b9420d104f29af9b";
showParameter.PageId = pageId;
showParameter.IsShowFilter = true;
this.View.ShowForm(showParameter);
7、打开分页账表
// using Kingdee.BOS.Core.Report;
string pageId = Guid.NewGuid().ToString();
MoveReportShowParameter showParameter = new MoveReportShowParameter();
showParameter.FormId = "c3329ed2a55c4c31b9420d104f29af8b";
showParameter.PageId = pageId;
this.View.ShowForm(showParameter);
8、打开树形账表
// using Kingdee.BOS.Core.Report;
string pageId = Guid.NewGuid().ToString();
TreeReportShowParameter showParameter = new TreeReportShowParameter();
showParameter.FormId = "c3329ed2a55c4c31b9420d104f29af7b";
showParameter.PageId = pageId;
this.View.ShowForm(showParameter);
9、打开透视表
// using Kingdee.BOS.Core.Report;
string pageId = Guid.NewGuid().ToString();
CrossReportShowParameter showParameter = new CrossReportShowParameter();
showParameter.FormId = "c3329ed2a55c4c31b9420d104f29ae59";
showParameter.PageId = pageId;
this.View.ShowForm(showParameter);
10、打开万能报表(SQL增强报表是一种万能报表)
// using Kingdee.BOS.Core.WNReport;
string pageId = Guid.NewGuid().ToString();
WNReportShowParameter showParameter = new WNReportShowParameter();
showParameter.FormId = "c3329ed2a55c4c31b9420d104f29ae69";
showParameter.PageId = pageId;
showParameter.ReporType = Kingdee.BOS.Core.Enums.BOSEnums.Enu_DevReportType.SqlOver;// SQL增强报表
this.View.ShowForm(showParameter);
推荐阅读