本文整理汇总了C#中SAPbouiCOM.LoadFromDataSource方法的典型用法代码示例。如果您正苦于以下问题:C# SAPbouiCOM.LoadFromDataSource方法的具体用法?C# SAPbouiCOM.LoadFromDataSource怎么用?C# SAPbouiCOM.LoadFromDataSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SAPbouiCOM
的用法示例。
在下文中一共展示了SAPbouiCOM.LoadFromDataSource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetMatrixAddRow
//.........这里部分代码省略.........
case BoFieldsType.ft_NotDefined:
case BoFieldsType.ft_Text:
value = "";
break;
case BoFieldsType.ft_Float:
case BoFieldsType.ft_Integer:
case BoFieldsType.ft_Measure:
case BoFieldsType.ft_Percent:
case BoFieldsType.ft_Price:
case BoFieldsType.ft_Quantity:
case BoFieldsType.ft_Rate:
case BoFieldsType.ft_ShortNumber:
case BoFieldsType.ft_Sum:
value = "0";
break;
default:
value = "";
break;
}
if (bindAlias == "U_IDX")
{
if (string.IsNullOrEmpty(pIndex) == false)
oDB.SetValue(bindAlias, oDB.Offset, pIndex);
}
else if (bindAlias == "U_DELVCD")
{
if (string.IsNullOrEmpty(pDelivCd) == false)
oDB.SetValue(bindAlias, oDB.Offset, pDelivCd);
}
else if (bindAlias == "U_STATUS")
{
oDB.SetValue(bindAlias, oDB.Offset, "UO");
}
else if (bindAlias == "U_ADDR1")
{
oDB.SetValue(bindAlias, oDB.Offset, oForm.Items.Item("edtADDR1").Specific.value);
}
else if (bindAlias == "U_ADDR1_D")
{
oDB.SetValue(bindAlias, oDB.Offset, oForm.Items.Item("edtADDR1_D").Specific.value);
}
else if (bindAlias == "U_ADDR2")
{
oDB.SetValue(bindAlias, oDB.Offset, oForm.Items.Item("edtADDR2").Specific.value);
}
else if (bindAlias == "U_ADDR2_D")
{
oDB.SetValue(bindAlias, oDB.Offset, oForm.Items.Item("edtADDR2_D").Specific.value);
}
else if (bindAlias == "U_TEL")
{
oDB.SetValue(bindAlias, oDB.Offset, oForm.Items.Item("edtTEL").Specific.value);
}
else if (bindAlias == "U_MOBILE")
{
oDB.SetValue(bindAlias, oDB.Offset, oForm.Items.Item("edtMOBILE").Specific.value);
}
else if (bindAlias == "U_DELVFR")
{
oDB.SetValue(bindAlias, oDB.Offset, oForm.Items.Item("edtR_FRDT").Specific.value);
}
else if (bindAlias == "U_DELVCNT")
{
oDB.SetValue(bindAlias, oDB.Offset, "1");
SetSumNumberOfCofies(oForm);
}
else if (bindAlias == "U_PAPERTP")
{
oDB.SetValue(bindAlias, oDB.Offset, oForm.Items.Item("cboPAPERCD").Specific.value);
}
else if (bindAlias == "U_JOINDT")
{
string strNowDate = B1Connections.theAppl.Company.ServerDate;
oDB.SetValue(bindAlias, oDB.Offset, FN.SetDateFormatToDB(strNowDate, FN.eDateType.n_YYYYMMDD));
}
else
{
oDB.SetValue(bindAlias, oDB.Offset, value);
}
}
}
}
oMatrix.LoadFromDataSource();
if (oMatrix.GetNextSelectedRow() != -1)
{
oMatrix.ClearSelections();
}
oMatrix.SelectRow(oMatrix.VisualRowCount, true, false);
}
catch (Exception ex)
{
B1Connections.theAppl.StatusBar.SetText("SetMatrixAddRow " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
}
}
示例2: SetMatrixAddRow
private void SetMatrixAddRow(ref SAPbouiCOM.Form oForm, ref SAPbouiCOM.Matrix oMatrix, ref SAPbouiCOM.DBDataSource oDB, string KeyAlias = "LineId")
{
System.Data.DataRow dr = null; ;
try
{
string bindAlias = "";
string value = string.Empty;
oMatrix.FlushToDataSource();
if (oDB.Size > 0)
{
if (oDB.GetValue(KeyAlias, oDB.Size - 1).Trim() != "")
{
oDB.InsertRecord(oDB.Size);
}
}
else
{
oDB.InsertRecord(oDB.Size);
}
oDB.Offset = oDB.Size - 1;
for (int iLooper = 0; iLooper < oMatrix.Columns.Count; iLooper++)
{
if (oMatrix.Columns.Item(iLooper).UniqueID.StartsWith("U_"))
{
if (oMatrix.Columns.Item(iLooper).DataBind.DataBound == true && !string.IsNullOrEmpty(oMatrix.Columns.Item(iLooper).DataBind.TableName))
{
bindAlias = oMatrix.Columns.Item(iLooper).DataBind.Alias.ToString();
switch (oDB.Fields.Item(bindAlias).Type)
{
case BoFieldsType.ft_AlphaNumeric:
case BoFieldsType.ft_Date:
case BoFieldsType.ft_NotDefined:
case BoFieldsType.ft_Text:
value = "";
break;
case BoFieldsType.ft_Float:
case BoFieldsType.ft_Integer:
case BoFieldsType.ft_Measure:
case BoFieldsType.ft_Percent:
case BoFieldsType.ft_Price:
case BoFieldsType.ft_Quantity:
case BoFieldsType.ft_Rate:
case BoFieldsType.ft_ShortNumber:
case BoFieldsType.ft_Sum:
value = "0";
break;
default:
value = "";
break;
}
if (bindAlias == "U_CIDX")
{
oDB.SetValue(bindAlias, oDB.Offset, oDB.Offset.ToString());
}
else if (bindAlias == "U_PIDX")
{
oDB.SetValue(bindAlias, oDB.Offset, (-1).ToString());
}
else if (bindAlias == "U_DATE")
{
string strNow = B1Connections.diCompany.GetCompanyDate().ToShortDateString();
oDB.SetValue(bindAlias, oDB.Offset, FN.SetDateFormatToDB(strNow, FN.eDateType.n_YYYYMMDD));
}
else if (bindAlias == "U_ADVRECV")
{
oDB.SetValue(bindAlias, oDB.Offset, value);
}
else if (bindAlias == "U_ADVSUBT")
{
oDB.SetValue(bindAlias, oDB.Offset, value);
}
else
{
oDB.SetValue(bindAlias, oDB.Offset, value);
}
}
}
}
oMatrix.LoadFromDataSource();
}
catch (Exception ex)
{
B1Connections.theAppl.StatusBar.SetText("SetMatrixAddRow " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
}
}