本文整理汇总了C#中SAPbouiCOM.Matrix.FlushToDataSource方法的典型用法代码示例。如果您正苦于以下问题:C# Matrix.FlushToDataSource方法的具体用法?C# Matrix.FlushToDataSource怎么用?C# Matrix.FlushToDataSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SAPbouiCOM.Matrix
的用法示例。
在下文中一共展示了Matrix.FlushToDataSource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetTR
private void SetTR(string TYPE)
{
bool bModify = false;
SAPbobsCOM.Recordset oRS = null;
oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
try
{
oForm.Freeze(true);
oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_FI0020M_HRD");
oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_FI00201_HRD");
oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx").Specific;
//oMatrix.LoadFromDataSource();
oMatrix.FlushToDataSource();
string strNowDate = B1Connections.diCompany.GetCompanyDate().ToShortDateString();
strNowDate = FN.SetDateFormatToDB(strNowDate, FN.eDateType.p_YYYYMMDD);
string Code = string.Empty;
string YYYYMM = string.Empty;
string sQry = string.Empty;
if (SelectRow != -1)
{
if (TYPE == "TR")
{
Code = oForm.Items.Item("Code").Specific.value.Trim();
YYYYMM = oDB_1.GetValue("U_YYYYMM", SelectRow).ToString().Trim();
sQry = " EXEC KIS_SP_FI0020B1_HRD '" + YYYYMM + "'";
oRS.DoQuery(sQry);
if (oRS.RecordCount == 0)
{
oDB_1.SetValue("U_UPDATEDT", SelectRow, strNowDate.Replace(".", ""));
oDB_1.SetValue("U_STATUS", SelectRow, "Y");
}
sQry = "UPDATE [@KIS_FI00201_HRD] SET U_UPDATEDT = '" + strNowDate.Replace(".", "") + "' ,U_STATUS = 'Y' WHERE Code = '" + Code + "' AND U_YYYYMM = '" + YYYYMM + "'";
oRS.DoQuery(sQry);
}
else
{
Code = oForm.Items.Item("Code").Specific.value.Trim();
YYYYMM = oDB_1.GetValue("U_YYYYMM", SelectRow).ToString().Trim();
sQry = " DELETE FROM [@KIS_FI0020B1_HRD] WHERE U_YYYYMM = '" + YYYYMM + "'";
sQry = sQry + " DELETE FROM [@KIS_FI0020B2_HRD] WHERE U_YYYYMM = '" + YYYYMM + "'";
oRS.DoQuery(sQry);
if (oRS.RecordCount == 0)
{
oDB_1.SetValue("U_UPDATEDT", SelectRow, "");
oDB_1.SetValue("U_STATUS", SelectRow, "N");
}
sQry = "UPDATE [@KIS_FI00201_HRD] SET U_UPDATEDT = NULL ,U_STATUS = 'N' WHERE Code = '" + Code + "' AND U_YYYYMM = '" + YYYYMM + "'";
oRS.DoQuery(sQry);
}
bModify = true;
}
if (bModify)
{
oMatrix.LoadFromDataSource();
SelectRow = -1;
}
B1Connections.theAppl.StatusBar.SetText("배치가 적용되었습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다
}
catch (Exception ex)
{
oForm.Freeze(false);
B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
}
finally
{
oForm.Freeze(false);
oRS = null;
}
}
示例2: ET_AFRowDataMenu_Delete
public virtual void ET_AFRowDataMenu_Delete(MenuEvent pVal)
{
oForm = B1Connections.theAppl.Forms.ActiveForm;
// ADD YOUR ACTION CODE HERE ...
try
{
oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx").Specific;
oForm.Freeze(true);
oMatrix.AddRow(1, -1);
int i = oMatrix.VisualRowCount;
oMatrix.DeleteRow(i);
oMatrix.FlushToDataSource();
oForm.Freeze(false);
}
catch (Exception)
{
throw;
}
}
示例3: ET_btnSTOP_AFItemPressed
public virtual void ET_btnSTOP_AFItemPressed(ItemEvent pVal)
{
oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnSTOP").Specific));
// ADD YOUR ACTION CODE HERE ...
int idx = 0;
string strRowStat = string.Empty;
try
{
oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_DUMY").Specific;
oDB1_Z = oForm.DataSources.DBDataSources.Item("@KIS_SO00301Z_HRD");
string strNowDate = B1Connections.diCompany.GetCompanyDate().ToShortDateString();
strNowDate = FN.SetDateFormatToDB(strNowDate, FN.eDateType.n_YYYYMMDD);
string strStopDate = oForm.DataSources.UserDataSources.Item("edtSTOPDT").ValueEx;
//if (String.IsNullOrEmpty(strNowDate))
//{
// B1Connections.theAppl.StatusBar.SetText("중지 일자가 입력되지 않았습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
// //oForm.Items.Item("btnSTOP").Click(0);
// return ;
//}
for (int i = 1; i <= oMatrix.VisualRowCount; i++)
{
idx = GetDataTableIndexByMatrix(oMatrix, i);
strRowStat = gDs.Tables[oForm.UniqueID + "_Deliver"].Rows[idx]["ROWSTATE"].ToString(); //Row상태값
if (strNowDate.CompareTo(strStopDate) >= 0)
{
// 상태값
oMatrix.SetCellWithoutValidation(i, "U_STATUS", "US");
gDs.Tables[oForm.UniqueID + "_Deliver"].Rows[idx]["STATUS"] = "US";
}
else
{
// 상태값
oMatrix.SetCellWithoutValidation(i, "U_STATUS", "UO");
gDs.Tables[oForm.UniqueID + "_Deliver"].Rows[idx]["STATUS"] = "UO";
}
// 중지일자
//oMatrix.SetCellWithoutValidation(i, "U_CLOSEDT", strStopDate);
//gDs.Tables[oForm.UniqueID + "_Deliver"].Rows[idx]["CLOSEDT"] = FN.SetDateFormatToDB(strStopDate, FN.eDateType.n_YYYYMMDD);
oMatrix.SetCellWithoutValidation(i, "U_CLOSEDT", strNowDate);
gDs.Tables[oForm.UniqueID + "_Deliver"].Rows[idx]["CLOSEDT"] = FN.SetDateFormatToDB(strNowDate, FN.eDateType.n_YYYYMMDD);
// 배달종료일자
oMatrix.SetCellWithoutValidation(i, "U_DELVTO", strStopDate);
gDs.Tables[oForm.UniqueID + "_Deliver"].Rows[idx]["DELVTO"] = FN.SetDateFormatToDB(strStopDate, FN.eDateType.n_YYYYMMDD);
if (string.IsNullOrEmpty(strRowStat))
{
gDs.Tables[oForm.UniqueID + "_Deliver"].Rows[idx]["ROWSTATE"] = "M";
SetSumNumberOfCofies(oForm);
}
}
if (oMatrix.VisualRowCount > 0)
{
oMatrix.FlushToDataSource();
if (oForm.Mode == BoFormMode.fm_OK_MODE)
oForm.Mode = BoFormMode.fm_UPDATE_MODE;
}
}
catch (Exception)
{
throw;
}
}
示例4: DBDataSourcesBindingData
private void DBDataSourcesBindingData(SAPbouiCOM.Form oForm, System.Data.DataTable dt, string strFileName)
{
try
{
//string U_RELDT = B1Connections.diCompany.GetCompanyDate().ToString("yyyy-MM-dd");//임포트 실행일
string U_RELDT = B1Connections.diCompany.GetCompanyDate().ToString("yyyyMMdd");//임포트 실행일
string U_RELUSER = B1Connections.diCompany.UserName;//임포트 실행 사용자
oMatrix = oForm.Items.Item("mtx").Specific;
oForm.Freeze(true);
oMatrix.Clear();
oMatrix.FlushToDataSource();
heDataTable.Clear();
boDataTable.Clear();
trDataTable.Clear();
for (int i = 0; i < dt.Rows.Count; i++)
{
//oMatrix.AddRow();
//oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_ERRCD", dt.Rows[i][0].ToString());
//oMatrix.SetCellWithoutValidation(oMatrix.RowCount, "U_ERRMSG", dt.Rows[i][0].ToString());
string upRowText = dt.Rows[i][0].ToString();
string dataType = string.Empty;
// dataType - 11 : 헤더, 22 : 바디, 33 : 합계
dataType = dt.Rows[i][0].ToString().Substring(0, 2);
switch (dataType)
{
case "11":
SetGiroTable(ref heDataTable, upRowText, dataType);
break;
case "22":
SetGiroTable(ref boDataTable, upRowText, dataType);
break;
case "33":
SetGiroTable(ref trDataTable, upRowText, dataType);
break;
default:
break;
}
}
// 수납자료의 고객관리번호를 Concat
var linqTable = (from a in boDataTable.AsEnumerable() select new { U_RDNO = "'" + a.Field<string>("0140").Trim() + "'" });
string output = String.Join(",", linqTable.AsEnumerable().Select(a => a.U_RDNO).ToArray());
#region 유효성 체크 - 지로청구 자료가 삭제된 고객관리번호 표시 (개별입금에서 처리하기로 함)
DBDataSourcesBindingData(oForm, output.Replace("'", ""));
#endregion
// 수납자료의 고객관리번호에 해당하는 청구자료 조회
//output = "14030000000040204118";
System.Data.DataTable sKIS_SO01601_HRD = null;
System.Data.DataTable sKIS_SO0220M_HRD = null;
sKIS_SO01601_HRD = FN.GetRecordsetToDataTable(string.Format("SELECT * FROM [@KIS_SO01601_HRD] WHERE U_RDNO IN ({0})", output)); // 지로청구 테이블
sKIS_SO0220M_HRD = FN.GetRecordsetToDataTable(string.Format("SELECT * FROM [@KIS_SO0220M_HRD] WHERE U_RDNO IN ({0})", output)); // 지로개별인쇄 테이블
#region 헤더
string U_GIRONO = heDataTable.Rows[0]["0020"].ToString().Substring(2, 7);
FN.SetDataSourceValue(oForm, "@KIS_SO0170T_HRD.U_TRNSDT", heDataTable.Rows[0]["0050"].ToString());
FN.SetDataSourceValue(oForm, "@KIS_SO0170T_HRD.U_RELUSER", U_RELUSER);
FN.SetDataSourceValue(oForm, "@KIS_SO0170T_HRD.U_RELDT", U_RELDT);
FN.SetDataSourceValue(oForm, "@KIS_SO0170T_HRD.U_FILENM", Path.GetFileName(strFileName));
//FN.SetItemValue(ref oForm, "edtTRNSDT", heDataTable.Rows[0]["0050"].ToString()); //이체일자
//FN.SetItemValue(ref oForm, "edtRELUSER", U_RELUSER); //실행자
//FN.SetItemValue(ref oForm, "edtRELDT", U_RELDT); //실행일
//FN.SetItemValue(ref oForm, "edtFILENM", Path.GetFileName(strFileName)); //업로드파일
#endregion
#region 바디
string U_RDNO = string.Empty;
string U_DEPAMT = string.Empty;
string U_CMMAMT = string.Empty;
string U_DEPDT = string.Empty;
string U_ERRCD = string.Empty;
string U_ERRMSG = string.Empty;
string U_PREQYM = string.Empty;
string U_CENTGBN = string.Empty;
string U_BPPER = string.Empty;
int U_NOMCNT_S = 0;
int U_UNSCNT_S = 0;
int U_TOTCNT_S = boDataTable.Rows.Count;
int U_NOMAMT_S = 0;
int U_UNSAMT_S = 0;
//.........这里部分代码省略.........
示例5: DataToDbDataSource_DELIVER
private bool DataToDbDataSource_DELIVER(SAPbouiCOM.Form oForm)
{
bool rtnValue = false;
try
{
oDB1_O = oForm.DataSources.DBDataSources.Item("@KIS_SO00301_HRD");
oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_ORIG").Specific;
oMatrix.FlushToDataSource();
/*
// 1. 메트릭스 삭제대상 삭제 적용
var objDelete = from row in gDs.Tables[oForm.UniqueID + "_Deliver"].AsEnumerable()
where row.Field<string>("ROWSTATE") == "D"
select new
{
vIDX = row.Field<Int32>("IDX") +1
};
foreach (var itemSub in objDelete)
{
//삭제할것들 선택한다.
oMatrix.SelectRow(itemSub.vIDX, true, true);
}
// 선택된 Rows를 삭제한다.
int iSelectIdx = 0;
while (iSelectIdx != -1)
{
iSelectIdx = oMatrix.GetNextSelectedRow(0, BoOrderType.ot_SelectionOrder);
if (iSelectIdx != -1)
oMatrix.DeleteRow(iSelectIdx);
}
if(objDelete.Count() > 0)
oMatrix.FlushToDataSource();
*/
// 2. 수정, 추가된내역 적용
var objModify = from row in gDs.Tables[oForm.UniqueID + "_Deliver"].AsEnumerable()
where row.Field<string>("ROWSTATE") == "M" || row.Field<string>("ROWSTATE") == "I"
select new
{
vIDX = row.Field<Int32>("IDX")
,
vDELVCD = row.Field<string>("DELVCD")
,
vRDEPT = row.Field<string>("RDEPT")
,
vPAPERTP = row.Field<string>("PAPERTP")
,
vPAYCD = row.Field<string>("PAYCD")
,
vPAYNM = row.Field<string>("PAYNM")
,
vTEL = row.Field<string>("TEL")
,
vMOBILE = row.Field<string>("MOBILE")
,
vADDR1 = row.Field<string>("ADDR1")
,
vADDR2 = row.Field<string>("ADDR2")
,
vADDR1_D = row.Field<string>("ADDR1_D")
,
vADDR2_D = row.Field<string>("ADDR2_D")
,
vCENTCD = row.Field<string>("CENTCD")
,
vCENTNM = row.Field<string>("CENTNM")
,
vDELVFR = row.Field<string>("DELVFR")
,
vDELVTO = row.Field<string>("DELVTO")
,
vDELVCNT = row.Field<Int32>("DELVCNT")
,
vMETHOD = row.Field<string>("METHOD")
,
vSAILCD = row.Field<string>("SAILCD")
,
vSAILNM = row.Field<string>("SAILNM")
,
vSDEPT = row.Field<string>("SDEPT")
,
vSTATUS = row.Field<string>("STATUS")
,
vNOTE = row.Field<string>("NOTE")
,
vJOINDT = row.Field<string>("JOINDT")
,
vCLOSEDT = row.Field<string>("CLOSEDT")
,
vUSERSG1 = row.Field<string>("USERSG1")
,
vREADTP = row.Field<string>("READTP")
,
vBTEL1 = row.Field<string>("BTEL1")
,
vBTEL2 = row.Field<string>("BTEL2")
,
vROWSTATE = row.Field<string>("ROWSTATE")
//.........这里部分代码省略.........
示例6: DeleteMatrixRows_CALL
private bool DeleteMatrixRows_CALL(string pDeliveryCode)
{
bool bRtnValue = true;
System.Data.DataRow[] findRows = null;
string strIdx = string.Empty;
int iBtnValue = -1;
try
{
oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx2_ORIG").Specific;
findRows = gDs.Tables[oForm.UniqueID + "_Call"].Select(string.Format(" DELVCD = '{0}' ", pDeliveryCode));
// 1. 메트릭스 삭제대상 삭제 적용
if (findRows.Count() > 0)
{
iBtnValue = B1Connections.theAppl.MessageBox("상담이력이 존재 합니다. 삭제하시겠습니까?", 1, "&Yes", "&No", "");
if (iBtnValue == 1)
{
foreach (System.Data.DataRow dr in findRows)
{
//삭제할것들 선택한다.
strIdx = dr["IDX"].ToString();
oMatrix.SelectRow(int.Parse(strIdx) + 1, true, true);
gDs.Tables[oForm.UniqueID + "_Call"].Rows.Remove(dr);
}
// 선택된 Rows를 삭제한다.
int iSelectIdx = 0;
while (iSelectIdx != -1)
{
iSelectIdx = oMatrix.GetNextSelectedRow(0, BoOrderType.ot_SelectionOrder);
if (iSelectIdx != -1)
oMatrix.DeleteRow(iSelectIdx);
}
if (findRows.Count() > 0)
oMatrix.FlushToDataSource();
}
else
bRtnValue = false;
}
}
catch (Exception)
{
bRtnValue = false;
throw;
}
finally
{
findRows = null;
}
return bRtnValue;
}
示例7: ET_btnSAVE_BFItemPressed
public virtual bool ET_btnSAVE_BFItemPressed(ItemEvent pVal) {
oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnSAVE").Specific));
// ADD YOUR ACTION CODE HERE ...'
oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1").Specific));
SAPbouiCOM.DBDataSource oKIS_HR00203_HRD = oForm.DataSources.DBDataSources.Item("@KIS_HR00203_HRD");
oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
string TMP = "";
oMatrix.FlushToDataSource();
for (int i = 0 ; i < oKIS_HR00203_HRD.Size; i++)
{
TMP = TMP + oKIS_HR00203_HRD.GetValue("U_CHEKER", i).Trim() + ",";
}
string sQry = " EXEC KIS_SP_HR0010B0_HRD '" + TMP + "'";
oRS.DoQuery(sQry);
if (oRS.RecordCount != 0)
{
B1Connections.theAppl.StatusBar.SetText("중복된 고과구분이 있습니다", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
oKIS_HR00203_HRD = null;
oRS = null;
oMatrix = null;
return false;
}
string Keys = SelectCode(oForm, "grd1", "Code");
UDO_Add_Data(Keys);
oKIS_HR00203_HRD = null;
oRS = null;
oMatrix = null;
return true;
}
示例8: ET_mtx1_AFChooseFromList
public virtual void ET_mtx1_AFChooseFromList(ItemEvent pVal)
{
oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1").Specific));
// ADD YOUR ACTION CODE HERE ...
SAPbouiCOM.DataTable oDataTable = null;
oDataTable = FN.GetCFLSelectedObjects(pVal);
SAPbouiCOM.DBDataSource oKIS_SD00301_HRD = oForm.DataSources.DBDataSources.Item("@KIS_SD00301_HRD");
string edtORDERRA = ((SAPbouiCOM.EditText)oForm.Items.Item("edtORDERRA").Specific).Value;
string edtBPRATE = ((SAPbouiCOM.EditText)oForm.Items.Item("edtBPRATE").Specific).Value;
try
{
if (oDataTable != null)
{
oMatrix.FlushToDataSource();
int iRow = pVal.Row - 1;
switch (pVal.ColUID)
{
case "U_ITMGRPCD":
case "U_ITMGRPNM":
for (int iLooper = 0; iLooper < oDataTable.Rows.Count; iLooper++)
{
if (oKIS_SD00301_HRD.Size - 1 < iRow)
{
oKIS_SD00301_HRD.InsertRecord(oKIS_SD00301_HRD.Size);
}
oKIS_SD00301_HRD.Offset = iRow;
oKIS_SD00301_HRD.SetValue("U_ITMGRPCD", oKIS_SD00301_HRD.Offset, oDataTable.GetValue("Code", iLooper).ToString());
oKIS_SD00301_HRD.SetValue("U_ITMGRPNM", oKIS_SD00301_HRD.Offset, oDataTable.GetValue("Name", iLooper).ToString());
//01.우선순위 로드.
oMatrix.LoadFromDataSource();
//02.실수주자 수수료 계산
oMatrix.SetCellWithoutValidation(iRow +1, "U_ORDERRAT", edtORDERRA);
SetCalc("U_ORDERRAT", iRow + 1);
//02.대행사 수수료 계산
oMatrix.SetCellWithoutValidation(iRow + 1, "U_BPRATE", edtBPRATE);
SetCalc("U_BPRATE", iRow + 1);
iRow++;
}
break;
default:
break;
}
//행추가
//FN.SetMatrixAddRow(ref oForm, ref oMatrix, ref oKIS_SD00301, FN.RowSelectMode.CellClick, "U_ITMGRPCD");
//SetMatrixColumnVATGRP(gl_U_VATCD, gl_U_VATCDBP);
//SetMatrixRowNumbering(oMatrix, "U_LINENUM");
SetMatrixAddRow(FN.RowSelectMode.None);
SetMatrixCalc_Sum();
if (oForm.Mode == BoFormMode.fm_OK_MODE)
oForm.Mode = BoFormMode.fm_UPDATE_MODE;
}
}
catch (Exception ex)
{
B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
}
finally
{
oKIS_SD00301_HRD = null;
oDataTable = null;
}
}
示例9: UDO_Add_Data_UPDATE
//고과자 업데이트
private bool UDO_Add_Data_UPDATE(string KeyValue)
{
SAPbobsCOM.GeneralService oGeneralService = null;
SAPbobsCOM.GeneralData oGeneralData = null;
SAPbobsCOM.GeneralDataCollection oChildren = null;
SAPbobsCOM.GeneralData oChild = null;
SAPbobsCOM.GeneralDataParams oGeneralParams = null;
SAPbobsCOM.CompanyService oCompanyService = (SAPbobsCOM.CompanyService)B1Connections.diCompany.GetCompanyService();
oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd1").Specific;
oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1").Specific));
SAPbouiCOM.DBDataSource oKIS_HR00203_HRD = oForm.DataSources.DBDataSources.Item("@KIS_HR00203_HRD");
oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
int CNT = 0;
string SAVE = ""; //저장유무
try
{
EXAMCD = oForm.Items.Item("cboYEAR").Specific.Value;
CNT = CNT + 1;
string SaveCheck = string.Empty;
string sQry = string.Empty;
string KeyAlias = "Code";
//string KeyValue = oGrid.DataTable.GetValue("Code", i);
decimal CHKRATE = 0;//평가비율
oGeneralService = oCompanyService.GetGeneralService("KIS_HR0020_HRD");
oGeneralParams = (SAPbobsCOM.GeneralDataParams)oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams);
oGeneralParams.SetProperty(KeyAlias, KeyValue);
oGeneralData = oGeneralService.GetByParams(oGeneralParams);
oChildren = oGeneralData.Child("KIS_HR00203_HRD");
oMatrix.FlushToDataSource();
for (int j = 0; j < oMatrix.RowCount + 1; j++)
{
int LINENUM = j + 1;//라인번호
string CHEKER = string.Empty; ;//고과구분
string EMPNO = string.Empty; ;//사원코드
string EMPNM = string.Empty; ;//사원명
string JIKGBCD = string.Empty; ;//직급
string JIKCHKCD = string.Empty; ; ;//직책
string DEPTCD = string.Empty; ;//부서
string EMPCD = string.Empty; ;//본인여부
string DBEMPCD = string.Empty; ;//DB본인여부
/*고과상태 시작이면 변경상태확인하여 UPDATE 및 INSERT*/
sQry = string.Format("SELECT U_CHEKER,U_EMPNO,U_EMPCD FROM [@KIS_HR00203_HRD] WHERE Code = '{0}' AND U_LINENUM = '{1}'",KeyValue,LINENUM);
oRS.DoQuery(sQry);
if (oRS.RecordCount > 0)
{
if (oRS.Fields.Item("U_EMPCD").Value == "T")
{
if ((FN.GetMatirxCellValue(ref oMatrix, "U_CHEKER", LINENUM - 1) == oRS.Fields.Item("U_CHEKER").Value) && (FN.GetMatirxCellValue(ref oMatrix, "U_EMPNO", LINENUM - 1) == oRS.Fields.Item("U_EMPNO").Value))
{
//평가비율 수정
SAVE = "T";
CHKRATE = Convert.ToDecimal(oKIS_HR00203_HRD.GetValue("U_CHKRATE", j - 1));//평가비율
SaveCheck = "U";
}
else
{
//고과자 변경
SAVE = "T";
CHEKER = oKIS_HR00203_HRD.GetValue("U_CHEKER", j - 1).Trim();//고과구분
EMPNO = oKIS_HR00203_HRD.GetValue("U_EMPNO", j - 1).Trim();//사원코드
EMPNM = oKIS_HR00203_HRD.GetValue("U_EMPNM", j - 1).Trim();//사원명
JIKGBCD = oKIS_HR00203_HRD.GetValue("U_JIKGBCD", j - 1).Trim();//직급
JIKCHKCD = oKIS_HR00203_HRD.GetValue("U_JIKCHKCD", j - 1).Trim();//직책
DEPTCD = oKIS_HR00203_HRD.GetValue("U_DEPTCD", j - 1).Trim();//부서
CHKRATE = Convert.ToDecimal(oKIS_HR00203_HRD.GetValue("U_CHKRATE", j - 1));//평가비율
EMPCD = "T";//본인여부
SaveCheck = "D";
}
DBEMPCD = "T";
}
else
{
DBEMPCD = "L";
}
}
else
{
if (oMatrix.VisualRowCount >= LINENUM - 1)
{
if (FN.GetMatirxCellValue(ref oMatrix, "U_EMPNO", LINENUM - 1) != "")
{
//고과자 추가
SAVE = "T";
CHEKER = oKIS_HR00203_HRD.GetValue("U_CHEKER", j - 1).Trim();//고과구분
EMPNO = oKIS_HR00203_HRD.GetValue("U_EMPNO", j - 1).Trim();//사원코드
EMPNM = oKIS_HR00203_HRD.GetValue("U_EMPNM", j - 1).Trim();//사원명
JIKGBCD = oKIS_HR00203_HRD.GetValue("U_JIKGBCD", j - 1).Trim();//직급
JIKCHKCD = oKIS_HR00203_HRD.GetValue("U_JIKCHKCD", j - 1).Trim();//직책
DEPTCD = oKIS_HR00203_HRD.GetValue("U_DEPTCD", j - 1).Trim();//부서
CHKRATE = Convert.ToDecimal(oKIS_HR00203_HRD.GetValue("U_CHKRATE", j - 1));//평가비율
EMPCD = "T";//본인여부
DBEMPCD = "";
//.........这里部分代码省略.........
示例10: ET_mtx1_AFChooseFromList
public virtual void ET_mtx1_AFChooseFromList(ItemEvent pVal) {
oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1").Specific));
// ADD YOUR ACTION CODE HERE ...
SAPbouiCOM.DataTable oDataTable = null;
SAPbouiCOM.DBDataSource oKIS_HR00203_HRD = oForm.DataSources.DBDataSources.Item("@KIS_HR00203_HRD");
oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
oDataTable = FN.GetCFLSelectedObjects(pVal);
if (pVal.ColUID == "U_EMPNO")
{
try
{
if (oDataTable != null)
{
oMatrix.FlushToDataSource();
string sQry = " SELECT B.U_DEPTCD FROM [@KIS_HR0120M] A INNER JOIN [@KIS_HR01202] B ON A.Code = B.Code";
sQry = sQry + "\r\n" + " WHERE A.U_EMPNO = '" + oDataTable.GetValue("U_EMPNO", 0).ToString() + "'";
oRS.DoQuery(sQry);
oKIS_HR00203_HRD.SetValue("U_EMPNO", pVal.Row-1, oDataTable.GetValue("U_EMPNO", 0).ToString());
oKIS_HR00203_HRD.SetValue("U_EMPNM", pVal.Row - 1, oDataTable.GetValue("U_EMPNM", 0).ToString());
oKIS_HR00203_HRD.SetValue("U_DEPTCD", pVal.Row - 1, oRS.Fields.Item("U_DEPTCD").Value);
oKIS_HR00203_HRD.SetValue("U_JIKGBCD", pVal.Row - 1, oDataTable.GetValue("U_JIKGBCD", 0).ToString());
oKIS_HR00203_HRD.SetValue("U_JIKCHKCD", pVal.Row - 1, oDataTable.GetValue("U_JIKCHCD", 0).ToString());
oMatrix.LoadFromDataSource();
}
}
catch (Exception ex)
{
B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
}
finally
{
oRS = null;
oDataTable = null;
oKIS_HR00203_HRD = null; ;
}
}
}
示例11: BeforeSave
/// <summary>
/// 저장 전에 필수 항목을 체크 합니다.
/// </summary>
/// <param name="oForm"></param>
/// <returns></returns>
private bool BeforeSave(SAPbouiCOM.Form oForm)
{
SAPbouiCOM.DBDataSource oKIS_SO00401_HRD = oForm.DataSources.DBDataSources.Item("@KIS_SO00401_HRD");
try
{
oMatrix = oForm.Items.Item("mtx1").Specific;
oMatrix.FlushToDataSource();
FN.SetDBDataSourceDeleteRow(ref oKIS_SO00401_HRD, "U_CENTCD");
oMatrix.LoadFromDataSource();
// 1.필수 항목 체크
string chkColumnList = string.Empty;
string chkStaticList = string.Empty;
chkColumnList = "cboAREA,edtCode,edtName,cboBRCGBN,edtCARDCD,edtCARDNM"; //cboPAPERTP,edtPAYCNT
chkStaticList = "sttAREA,sttCode,sttName,sttBRCGBN,sttCARDCD,sttCARDNM"; //sttPAPERTP,sttPAYCNT
if (!FN.CondValidationChk(oForm, chkColumnList, chkStaticList)) return false;
chkColumnList = "U_CENTCD,U_CENTNM,U_SNM,U_STATUS||U_CENTGBN";
//if (!FN.ValidationChk(oForm, "mtx1", chkColumnList)) return false;
if (!SO.SO_COMMON_HRD.ValidationChk(oForm, "mtx1", chkColumnList)) return false;
}
catch (Exception ex)
{
B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
return false;
}
finally
{
oKIS_SO00401_HRD = null;
}
return true;
}
示例12: ET_CallBack_AFClick
public virtual void ET_CallBack_AFClick(ItemEvent pVal)
{
oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("CallBack").Specific));
// ADD YOUR ACTION CODE HERE ...
string popupID = string.Empty;
popupID = oButton.Caption.ToString();
if (string.IsNullOrEmpty(popupID)) return;
// 리턴 DataTable
SAPbouiCOM.DataTable rDT = KIS_SO0000F_HRD.GetReturnDT(popupID, oForm.UniqueID);
int rowIdx = KIS_SO0000F_HRD.GetSelectRowIdx(popupID, oForm.UniqueID);
switch (popupID)
{
case "지번주소":
oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1").Specific;
oMatrix.SetCellWithoutValidation(rowIdx, "U_ZIPCD1", rDT.GetValue("ZIP_CD", 0));
oMatrix.SetCellWithoutValidation(rowIdx, "U_ADDR1", rDT.GetValue("RADDR_KOR", 0));
oMatrix.FlushToDataSource();
break;
case "거리주소":
oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1").Specific;
oMatrix.SetCellWithoutValidation(rowIdx, "U_ZIPCD2", rDT.GetValue("ZIP_CD", 0));
oMatrix.SetCellWithoutValidation(rowIdx, "U_ADDR2", rDT.GetValue("RADDR_KOR", 0));
oMatrix.FlushToDataSource();
break;
case "분국조회":
string KeyValue = rDT.GetValue("U_BRCCD", 0).ToString();
if (!string.IsNullOrEmpty(KeyValue))
{
GetDataLoad(oForm, KeyValue);
}
break;
default:
break;
}
}
示例13: ET_mtx1_AFComboSelect
public virtual void ET_mtx1_AFComboSelect(ItemEvent pVal) {
oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1").Specific));
// ADD YOUR ACTION CODE HERE ...
oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
string sQry = "";
if (pVal.ColUID == "U_DTCD")
{
string DTCD = FN.GetMatirxCellValue(ref oMatrix, "U_DTCD", pVal.Row);
string DTNM = "";
sQry = string.Format(" SELECT U_SMLNM FROM [@KIS_AD00201] WHERE CODE = 'HR02' AND U_USEYN = 'Y' AND U_SMLCD = '{0}'", DTCD);
oRS.DoQuery(sQry);
DTNM = oRS.Fields.Item("U_SMLNM").Value.ToString();
oMatrix.SetCellWithoutValidation(pVal.Row, "U_DTNM", DTNM);
oMatrix.FlushToDataSource();
}
else if (pVal.ColUID == "U_ABILCD")
{
string ABILCD = FN.GetMatirxCellValue(ref oMatrix, "U_ABILCD", pVal.Row);
string ABILNM = "";
sQry = string.Format(" SELECT U_SMLNM FROM [@KIS_AD00201] WHERE CODE = 'HR03' AND U_USEYN = 'Y' AND U_SMLCD = '{0}'", ABILCD);
oRS.DoQuery(sQry);
ABILNM = oRS.Fields.Item("U_SMLNM").Value.ToString();
oMatrix.SetCellWithoutValidation(pVal.Row, "U_ABILNM", ABILNM);
oMatrix.FlushToDataSource();
}
else if (pVal.ColUID == "U_COMPOCD")
{
string COMPOCD = FN.GetMatirxCellValue(ref oMatrix, "U_COMPOCD", pVal.Row);
string COMPONM = "";
sQry = string.Format(" SELECT U_SMLNM FROM [@KIS_AD00201] WHERE CODE = 'HR04' AND U_USEYN = 'Y' AND U_SMLCD = '{0}'", COMPOCD);
oRS.DoQuery(sQry);
COMPONM = oRS.Fields.Item("U_SMLNM").Value.ToString();
oMatrix.SetCellWithoutValidation(pVal.Row, "U_COMPONM", COMPONM);
oMatrix.FlushToDataSource();
}
}
示例14: SetChildDataToMatrix
private void SetChildDataToMatrix(SAPbouiCOM.Form oForm)
{
SAPbouiCOM.Form cForm = B1Connections.theAppl.Forms.Item(oForm.DataSources.UserDataSources.Item("cFORMUID").ValueEx);
oMatrix = oForm.Items.Item("mtx").Specific;
string strREADCD = string.Empty;
string strCENTCD = string.Empty;
string strADVRECV = string.Empty;
string strUpLineId = string.Empty;
bool bModify = false;
try
{
oForm.Freeze(true);
SAPbouiCOM.Grid cGrid = cForm.Items.Item("grd").Specific;
for (int i = 0; i < cGrid.DataTable.Rows.Count; i++)
{
if (FN.GetGridCellValue(ref cGrid, "CHK", i) == "Y")
{
strREADCD = FN.GetGridCellValue(ref cGrid, "U_READCD", i);
strCENTCD = FN.GetGridCellValue(ref cGrid, "U_CENTCD", i);
strADVRECV = FN.GetGridCellValue(ref cGrid, "U_ADVRECV", i);
strUpLineId = oForm.DataSources.UserDataSources.Item("U_BLINEID").ValueEx;
oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_SO04201_HRD");
if (string.IsNullOrEmpty(strCENTCD) == false)
{
SetMatrixAddRow(ref oForm, ref oMatrix, ref oDB_1, "U_READCD");
oMatrix.SetCellWithoutValidation(oMatrix.VisualRowCount, "U_READCD", FN.GetGridCellValue(ref cGrid, "U_READCD", i));
oMatrix.SetCellWithoutValidation(oMatrix.VisualRowCount, "U_READNM", FN.GetGridCellValue(ref cGrid, "U_READNM", i));
oMatrix.SetCellWithoutValidation(oMatrix.VisualRowCount, "U_ADVAMT", FN.GetGridCellValue(ref cGrid, "U_ADVRECV", i));
oMatrix.SetCellWithoutValidation(oMatrix.VisualRowCount, "U_ADVSUBT", FN.GetGridCellValue(ref cGrid, "U_ADVRECV", i));
bModify = true;
}
}
}
if (bModify)
{
oMatrix.FlushToDataSource();
if (oForm.Mode == BoFormMode.fm_OK_MODE)
oForm.Mode = BoFormMode.fm_UPDATE_MODE;
}
}
catch (Exception)
{
throw;
}
finally
{
oForm.Freeze(false);
if (oMatrix != null) { Marshal.ReleaseComObject(oMatrix); } oMatrix = null;
if (cForm != null) { Marshal.ReleaseComObject(cForm); } cForm = null;
}
}
示例15: UDO_Add_Data
private bool UDO_Add_Data(string Keys)
{
oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd1").Specific;
oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1").Specific));
SAPbouiCOM.DBDataSource oKIS_HR00203_HRD = oForm.DataSources.DBDataSources.Item("@KIS_HR00203_HRD");
oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
int CNT = 0;
decimal CHKRATECHK = 0;
Boolean Status = false;
string[] strData;
string Key = string.Empty;
EXAMCD = oForm.Items.Item("cboYEAR").Specific.Value;
strData = Keys.Split(',');
SAPbouiCOM.ProgressBar ProgressBar01 = B1Connections.theAppl.StatusBar.CreateProgressBar(String.Format("고과항목생성중...(0/{0})", strData.Length), strData.Length, false);
KIS_COMMON.GLOBAL.PrograssBarExcute = true;
try
{
for (int i = 0; i < strData.Length; i++)
{
if (KIS_COMMON.GLOBAL.PrograssBarExcute == true)
{
ProgressBar01.Value++;
ProgressBar01.Text = String.Format("고과자생성중 ... ({0}/{1})", ProgressBar01.Value, strData.Length);
System.Windows.Forms.Application.DoEvents();
}
Status = true;
CNT = CNT + 1;
string sQry = string.Empty;
string KeyValue = strData[i].Trim();
//string KeyValue = oGrid.DataTable.GetValue("Code", i);
string TmpStatus = FN.GetRecordsetValue(string.Format("SELECT U_RMK2 FROM [@KIS_AD00201] WHERE Code = 'HR01' AND U_SMLCD = '{0}'", EXAMCD));
decimal CHKRATE = 0;//평가비율
/*고과상태가 설정이면 DELETE INSERT*/
if (TmpStatus == "U02")
{
sQry = " DELETE FROM [@KIS_HR00203_HRD] WHERE Code = '" + KeyValue + "'";
oRS.DoQuery(sQry);
}
sQry = " SELECT * FROM [@KIS_HR00201_HRD] WHERE Code = '" + KeyValue + "'";
oRS.DoQuery(sQry);
if (oRS.RecordCount > 0)
{
CHECK = true;
}
else
{
CHECK = false;
}
oMatrix.FlushToDataSource();
/* 평가비율합 100 Check*/
CHKRATECHK = 0;
for (int j = 0; j < oMatrix.RowCount; j++)
{
CHKRATE = Convert.ToDecimal(oKIS_HR00203_HRD.GetValue("U_CHKRATE", j));
CHKRATECHK = CHKRATECHK + CHKRATE;
}
if (CHKRATECHK != 100)
{
CHKRATECHK = -1;
return false;
}
/*고과상태 시작이면 변경상태확인하여 UPDATE 및 INSERT*/
if (TmpStatus == "U03")
{
string NewCHEKER = FN.GetRecordsetValue(string.Format("SELECT U_EMPNO FROM [@KIS_HR00203_HRD] WHERE Code = '{0}'", KeyValue));
if (NewCHEKER == "")
{
//신규 추가
UDO_Add_Data_NEW(KeyValue);
}
else
{
//UPDATE 문
UDO_Add_Data_UPDATE(KeyValue);
}
}
else
{
//신규 추가
UDO_Add_Data_NEW(KeyValue);
}
//고과자 평가항목 등록
if (CHECK == true)
{
UDO_Add_Data_2(KeyValue);
}
}
//.........这里部分代码省略.........