fsSbo.AddItem2Form(ref oForm, "2", BoFormItemTypes.it_BUTTON, 315, 80, 65, 20);
grd.DataTable = oForm.DataSources.DataTables.Add("dtData");
grd.SelectionMode = BoMatrixSelect.ms_Single;
for (int i = 0; i < grd.DataTable.Columns.Count; i++)
{
if (grd.DataTable.Columns.Item(i).Type == BoFieldsType.ft_Integer || grd.DataTable.Columns.Item(i).Type == BoFieldsType.ft_Float)
grd.Columns.Item(i).RightJustified = true;
}
string[] strValues = new string[strFatherFields.Length == 0 || frmFather != null ? dt.Columns.Count : strColumns.Length];
for (int i = 0; i < strValues.Length; i++)
{
string strValue = "";
if (dt.Columns.Item(i).Cells.Item(nSelectedRow).Value != null) strValue = dt.Columns.Item(i).Cells.Item(nSelectedRow).Value.ToString();
if (i < dt.Columns.Count) strValues[i] = strValue;
}
{
Form frm = fsSbo.fsSboApplication.Forms.Item(strFatherFId);
for (int i = 0; i < strColumns.Length; i++)
{
if (strMtxId.Length > 0 && nMtxRow > 0)
{
Matrix mtx = (Matrix)frm.Items.Item(strMtxId).Specific;
Column oColumn = mtx.Columns.Item(strColumns[i]);
fsSbo.SetValue2MtxEditText(ref mtx, strColumns[i], nMtxRow, strValues[i]);
else if (oColumn.Type == BoFormItemTypes.it_COMBO_BOX)
fsSbo.SetValue2MtxCombox(ref mtx, strColumns[i], nMtxRow, strValues[i]);
}
else
{
Item oItem = frm.Items.Item(strColumns[i]);
if (oItem.Type == BoFormItemTypes.it_COMBO_BOX)
fsSbo.SetValue2Combox(ref frm, strColumns[i], strValues[i]);
else if (oItem.Type == BoFormItemTypes.it_EDIT || oItem.Type == BoFormItemTypes.it_EXTEDIT)
fsSbo.SetValue2EditText(ref frm, strColumns[i], strValues[i]);
}
}
frm.Refresh();
frm.Update();
}
else if (frmFather != null)
{
string strFormId = oForm.UniqueID;
}
{
Boolean bRet = false;
try
{
fsSboChooseDataBase frm = new fsSboChooseDataBase(this);
frm.ChooseDataSQL = strQuerySQL;
frm.FatherFields = strFatherFields;
frm.FatherFormId = strFatherId;
if (strMtxId.Length > 0 && nMtxRow > 0)
{
frm.FatherMatrixId = strMtxId;
frm.FatherMatrixRow = nMtxRow;
}
bRet = ShowForm(frm, "ChooseData" + strFatherId, strTitle);
}
catch (Exception ex)
{
ShowMsg("错误:" + ex.Message);
}
}
strSQL = "SELECT DocEntry as [$$DocEntry], U_DealCode 加工协议, U_DealName 协议描述, U_DealNo 档案编号, U_WrkBatNo 生产批次, U_CardCode 委托方, U_CardName 委托方名称, U_PlanSD 计划开始, U_PlanED 计划结束 FROM [@FSCXFWORKDEALINFO] WHERE IsNull(U_Stts,'0') in ('2','3')";
strFields = "DealEntry,emDealCode,emDealName,emDealNo,emBatNo,emCardCode,emCardName";
if (strDealEntry.Length > 0)
{
strSQL = "SELECT U_ItemCode 物料代码, U_ItemName 物料描述, U_BaseItem as [$$BaseItem], U_BaseCode as [$$BaseCode], U_GrdEntry as [$$GrdEntry], U_GrdCode 等级, U_FromCode as [$$FromCode], U_FromName [产地], U_ItemAge 年限, IsNull(U_Qty,0) - IsNull(U_Qtyed,0) [$$RemQty], U_ItemGrp [$$ItemGrp], U_WhsCode [$$WhsCode], DocEntry as [$$DocEntry], U_Qty 计划加工, U_Qtyed 已加工, U_Notes 备注 FROM [@FSCXFWORKDEALLINE1] WHERE U_ItemGrp in (" + fsSbo.fsSboMes4CxF.ItemGroupCodeBeforePick + ") AND DocEntry=" + strDealEntry + (strItemList.Length > 0 ? " AND U_ItemCode not in (" + strItemList + ")" : "");
bRet = fsSbo.OpenChooseDataForm(strTitle, this, strSQL, "REQUEST");
}