private void pmInitPopUpDialog(string inDialogName) { switch (inDialogName.TrimEnd().ToUpper()) { case "PDGRP": if (this.pofrmGetPdGrp == null) { this.pofrmGetPdGrp = new DialogForms.dlgGetPdGrp(); this.pofrmGetPdGrp.Location = new Point(AppUtil.CommonHelper.SysMetric(1) - this.pofrmGetPdGrp.Width - 10, AppUtil.CommonHelper.SysMetric(9) + 5); } break; case "TAG_PDGRP": using (DialogForms.dlgTagItems dlg = new mBudget.DialogForms.dlgTagItems()) { dlg.Location = new Point(AppUtil.CommonHelper.SysMetric(1) - dlg.Width - 10, AppUtil.CommonHelper.SysMetric(9) + 5); string strSQLExec = "select {0}.FCSKID, {0}.FCCODE, {0}.FCNAME from {0} "; string strFMDBName = App.ConfigurationManager.ConnectionInfo.ERPDBMSName; string strEmplRTab = strFMDBName + ".dbo.EMPLR"; strSQLExec = string.Format(strSQLExec, new string[] { MapTable.Table.ProdGroup, strEmplRTab }); dlg.SetBrowView(strSQLExec, null, MapTable.Table.ProdGroup, DialogForms.dlgGetPdGrp.MAXLENGTH_CODE, DialogForms.dlgGetPdGrp.MAXLENGTH_NAME); dlg.ShowDialog(); if (dlg.PopUpResult) { dlg.LoadTagValue(ref this.pATagCode); //this.txtTagCode.Text = this.pmGetRngCode(); } } break; } }
private void pmInitPopUpDialog(string inDialogName) { switch (inDialogName.TrimEnd().ToUpper()) { case "SECT": if (this.pofrmGetSect == null) { this.pofrmGetSect = new DatabaseForms.frmSect(FormActiveMode.Report); this.pofrmGetSect.Location = new Point(AppUtil.CommonHelper.SysMetric(1) - this.pofrmGetSect.Width - 10, AppUtil.CommonHelper.SysMetric(9) + 5); } break; case "TAG_DEPT": using (DialogForms.dlgTagItems dlg = new mBudget.DialogForms.dlgTagItems()) { dlg.Location = new Point(AppUtil.CommonHelper.SysMetric(1) - dlg.Width - 10, AppUtil.CommonHelper.SysMetric(9) + 5); string strSQLExec = "select {0}.CROWID, {0}.CCODE, {0}.CNAME, {0}.DCREATE, {0}.DLASTUPD, EM1.FCLOGIN as CLOGIN_ADD, EM2.FCLOGIN as CLOGIN_UPD from {0} "; strSQLExec += " left join {1} EM1 ON EM1.FCSKID = {0}.CCREATEBY "; strSQLExec += " left join {1} EM2 ON EM2.FCSKID = {0}.CLASTUPDBY "; string strFMDBName = App.ConfigurationManager.ConnectionInfo.ERPDBMSName; string strEmplRTab = strFMDBName + ".dbo.EMPLR"; strSQLExec = string.Format(strSQLExec, new string[] { MapTable.Table.MasterDept, strEmplRTab }); dlg.SetBrowView(strSQLExec, null, MapTable.Table.MasterDept, frmDept.MAXLENGTH_CODE, frmSect.MAXLENGTH_NAME); dlg.ShowDialog(); if (dlg.PopUpResult) { dlg.LoadTagValue(ref this.pATagDept); this.txtTagDept.Text = this.pmGetRngCode2(); } } break; case "TAG_SECT": using (DialogForms.dlgTagItems dlg = new mBudget.DialogForms.dlgTagItems()) { dlg.Location = new Point(AppUtil.CommonHelper.SysMetric(1) - dlg.Width - 10, AppUtil.CommonHelper.SysMetric(9) + 5); string strSQLExec = "select {0}.CROWID, {0}.CCODE, {0}.CNAME, {0}.DCREATE, {0}.DLASTUPD, EM1.FCLOGIN as CLOGIN_ADD, EM2.FCLOGIN as CLOGIN_UPD from {0} "; strSQLExec += " left join {1} EM1 ON EM1.FCSKID = {0}.CCREATEBY "; strSQLExec += " left join {1} EM2 ON EM2.FCSKID = {0}.CLASTUPDBY "; string strFMDBName = App.ConfigurationManager.ConnectionInfo.ERPDBMSName; string strEmplRTab = strFMDBName + ".dbo.EMPLR"; strSQLExec = string.Format(strSQLExec, new string[] { MapTable.Table.MasterSect, strEmplRTab }); dlg.SetBrowView(strSQLExec, null, MapTable.Table.MasterSect, frmSect.MAXLENGTH_CODE, frmSect.MAXLENGTH_NAME); dlg.ShowDialog(); if (dlg.PopUpResult) { dlg.LoadTagValue(ref this.pATagCode); this.txtTagCode.Text = this.pmGetRngCode(); } } break; } }