public override void Initialize(ArpsAward arpsAward) { Conditions.Add(new PhaseNominator(arpsAward.Phase)); }
internal void AddConditions(DicModel dic) { if (!string.IsNullOrWhiteSpace(dic.CsValue) && dic.CsValue.Contains(",") && dic.Option == OptionEnum.In) { var vals = dic.CsValue.Split(',').Select(it => it); var i = 0; foreach (var val in vals) { // i++; var op = OptionEnum.None; if (i == 1) { op = OptionEnum.In; } else { op = OptionEnum.InHelper; } // var dicx = new DicModel { TableOne = dic.TableOne, ClassFullName = dic.ClassFullName, ColumnOne = dic.ColumnOne, TableAliasOne = dic.TableAliasOne, TableTwo = dic.TableTwo, KeyTwo = dic.KeyTwo, AliasTwo = dic.AliasTwo, Param = dic.Param, ParamRaw = dic.ParamRaw, CsValue = val, ValueType = dic.ValueType, ColumnType = dic.ColumnType, Option = op, Action = dic.Action, Crud = dic.Crud, Compare = dic.Compare, TvpIndex = dic.TvpIndex }; AddConditions(dicx); } Conditions.Remove(dic); } else if (!string.IsNullOrWhiteSpace(dic.Param) && Conditions.Any(it => dic.Param.Equals(it.Param, StringComparison.OrdinalIgnoreCase))) { if (dic.Param.Contains("__")) { var arr = dic.Param.Split(new string[] { "__" }, StringSplitOptions.RemoveEmptyEntries); var val = Convert.ToInt32(arr[arr.Length - 1]); val++; dic.Param = dic.ParamRaw + "__" + val.ToString(); } else { dic.Param += "__1"; } AddConditions(dic); } else { Conditions.Add(dic); } }
private void SetConditions_PRCCD(ItemEvent pVal) { SAPbouiCOM.ChooseFromList oCFL; SAPbouiCOM.IChooseFromListEvent oCFLEvento = (SAPbouiCOM.IChooseFromListEvent)pVal; SAPbouiCOM.ChooseFromListCreationParams oCFLCreationParams; SAPbouiCOM.Conditions oCons = new SAPbouiCOM.Conditions(); SAPbouiCOM.Condition oCon; try { oCFLCreationParams = (SAPbouiCOM.ChooseFromListCreationParams)B1Connections.theAppl.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams); oCFL = oForm.ChooseFromLists.Item(oCFLEvento.ChooseFromListUID); oCons = new Conditions(); ; oCon = oCons.Add(); oCon.Alias = "DimCode"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "1"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Locked"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Active"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; oCFL.SetConditions(oCons); } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } finally { oCFL = null; oCFLEvento = null; oCFLCreationParams = null; oCons = null; oCon = null; } }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting() { // '// ADD YOUR ACTION CODE HERE ... try { #region Form Setting oForm.SupportedModes = 1; oForm.Settings.EnableRowFormat = false; oForm.Settings.Enabled = false; oForm.AutoManaged = true; #endregion #region ComboBox string sql = string.Empty; // 간행물 oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboPUBLICA").Specific; FN.SetComboBoxValidValues(oForm, " SELECT U_SMLCD,U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SD01' AND U_USEYN = 'Y'", "cboPUBLICA", FN.Enum_WholeTp.m_TotalTxt); #endregion #region EditText //코스트센터 #region ProfitCenter Conditions SAPbouiCOM.Conditions oCons = new Conditions(); ; SAPbouiCOM.Condition oCon = oCons.Add(); oCon.Alias = "CardType"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "C"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtCARDCD", "CardCode", BoFormItemTypes.it_EDIT, oCons); #endregion #region Default oForm.DataSources.UserDataSources.Item("optTYPE").ValueEx = "Y"; oForm.DataSources.UserDataSources.Item("edtDATE").ValueEx = Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMMdd"); #endregion #region Grid oForm.DataSources.DataTables.Add("grd"); oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific; oGrid.SelectionMode = BoMatrixSelect.ms_NotSupported; oGrid.DataTable = oForm.DataSources.DataTables.Item("grd"); //데이터 그리드에 Display SetGridTitle(oForm); #endregion foreach (SAPbouiCOM.Item item in oForm.Items) { item.AffectsFormMode = false; } } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } }
private void BuildCommonControls() { Conditions.Clear(); Blocks.Clear(); Assignations.Clear(); //Load the required XMl File XmlDocument doc = new XmlDocument(); doc.Load(XML_FILES_PATH + CurrentType + ".xml"); //Load all the children of the root node XmlNodeList xmlNodeList = doc.DocumentElement?.SelectNodes("//Assignations/Control"); if (xmlNodeList == null) { return; } foreach (XmlNode node in xmlNodeList) { if (node.Attributes != null) { Assignations.Add(new AssignationModel { LocalizationKey = node.Attributes["Text"].Value, Code = node.Attributes["Code"].Value, IsNotEditable = Convert.ToBoolean(node.Attributes["IsNotEditable"].Value), CanHaveChild = Convert.ToBoolean(node.Attributes["CanHaveChild"].Value), BackgroundColor = ASSIGNATIONS_COLORS[0], BorderColor = ASSIGNATIONS_COLORS[1], Color = ASSIGNATIONS_COLORS[2] }); } } XmlNodeList selectNodes = doc.DocumentElement.SelectNodes("//Blocks/Control"); if (selectNodes != null) { foreach (XmlNode node in selectNodes) { if (node.Attributes != null) { Conditions.Add(new AssignationModel { LocalizationKey = node.Attributes["Text"].Value, Code = node.Attributes["Code"].Value, IsNotEditable = Convert.ToBoolean(node.Attributes["IsNotEditable"].Value), CanHaveChild = Convert.ToBoolean(node.Attributes["CanHaveChild"].Value), BackgroundColor = CONDITIONS_COLORS[0], BorderColor = CONDITIONS_COLORS[1], Color = CONDITIONS_COLORS[2] }); } } } XmlNodeList nodeList = doc.DocumentElement.SelectNodes("//Conditions/Control"); if (nodeList != null) { foreach (XmlNode node in nodeList) { if (node.Attributes != null) { Blocks.Add(new AssignationModel { LocalizationKey = node.Attributes["Text"].Value, Code = node.Attributes["Code"].Value, IsNotEditable = Convert.ToBoolean(node.Attributes["IsNotEditable"].Value), CanHaveChild = Convert.ToBoolean(node.Attributes["CanHaveChild"].Value), BackgroundColor = BLOCKS_COLORS[0], BorderColor = BLOCKS_COLORS[1], Color = BLOCKS_COLORS[2] }); } } } }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting() { // '// ADD YOUR ACTION CODE HERE ... StringBuilder sb = new StringBuilder(); try { #region Form oForm.SupportedModes = 1; oForm.Settings.EnableRowFormat = false; oForm.Settings.Enabled = false; oForm.AutoManaged = true; foreach (SAPbouiCOM.Item item in oForm.Items) { item.AffectsFormMode = false; } #endregion oForm.DataSources.UserDataSources.Item("edtDOCDTF").Value = Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMM01"); oForm.DataSources.UserDataSources.Item("edtDOCDTT").Value = Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMMdd"); #region EditText //매출처 #region BusinessPartner Conditions SAPbouiCOM.Conditions oCons = new Conditions(); ; SAPbouiCOM.Condition oCon = oCons.Add(); oCons = new Conditions(); ; oCon = oCons.Add(); oCon.Alias = "CardType"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "C"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "frozenFor"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtCARDCDF", "CardCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtCARDNMF", "CardName", BoFormItemTypes.it_EDIT, oCons); //대행사 #region BusinessPartner Conditions oCons = new Conditions(); ; oCon = oCons.Add(); oCon.Alias = "CardType"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "S";//공급업체 oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "frozenFor"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtBPCDF", "CardCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtBPNMF", "CardName", BoFormItemTypes.it_EDIT, oCons); #endregion #region ComboBox //매출부서 FN.SetComboBoxValidValues(oForm, "SELECT PrcCode,PrcName FROM OPRC WHERE DimCode = '1' AND Locked = 'N' ORDER BY PrcCode ", "cboPRCCD", FN.Enum_WholeTp.m_TotalTxt); oCombo = oForm.Items.Item("cboPRCCD").Specific; if (oCombo.ValidValues.Count > 0) { oForm.DataSources.UserDataSources.Item("cboPRCCD").Value = oCombo.ValidValues.Item(0).Value; } //영업사원 FN.SetComboBoxValidValues(oForm, "SELECT SlpCode,SlpName FROM OSLP WHERE Active = 'Y' AND Locked = 'N' ORDER BY SlpCode ", "cboSLPCD", FN.Enum_WholeTp.m_TotalTxt); oCombo = oForm.Items.Item("cboSLPCD").Specific; if (oCombo.ValidValues.Count > 0) { oForm.DataSources.UserDataSources.Item("cboSLPCD").Value = oCombo.ValidValues.Item(0).Value; } //간행물 FN.SetComboBoxValidValues(oForm, "SELECT U_SMLCD,U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SD01' AND U_USEYN = 'Y' ", "cboPUBLICA", FN.Enum_WholeTp.m_TotalTxt); oCombo = oForm.Items.Item("cboPUBLICA").Specific; if (oCombo.ValidValues.Count > 0) { oForm.DataSources.UserDataSources.Item("cboPUBLICA").Value = oCombo.ValidValues.Item(0).Value; } #endregion oForm.DataSources.DataTables.Add("grd"); SetGridTitle(oForm); } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } }
public DataSet DeleteCheckList(DataSet reqDS) { DataSet resDS = new DataSet(); if (reqDS != null && reqDS.ExtendedProperties.ContainsKey(PARAMETERS.INPUT_KEY) && reqDS.ExtendedProperties.ContainsKey(PARAMETERS.INPUT_EDITOR) && reqDS.ExtendedProperties.ContainsKey(PARAMETERS.INPUT_EDIT_TIME)) { string checkListKey = reqDS.ExtendedProperties[PARAMETERS.INPUT_KEY].ToString(); string editor = reqDS.ExtendedProperties[PARAMETERS.INPUT_EDITOR].ToString(); string editTime = reqDS.ExtendedProperties[PARAMETERS.INPUT_EDIT_TIME].ToString(); try { EMS_CHECKLIST_FIELDS checkListFields = new EMS_CHECKLIST_FIELDS(); #region Build Delete SQL Conditions Conditions conditions = new Conditions(); Condition condition; if (string.IsNullOrEmpty(checkListKey)) { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_CHECKLIST_FIELDS.FIELD_CHECKLIST_KEY, GlobalEnums.DatabaseCompareOperator.Null, string.Empty); } else { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_CHECKLIST_FIELDS.FIELD_CHECKLIST_KEY, GlobalEnums.DatabaseCompareOperator.Equal, checkListKey); } conditions.Add(condition); if (string.IsNullOrEmpty(editor)) { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_CHECKLIST_FIELDS.FIELD_EDITOR, GlobalEnums.DatabaseCompareOperator.Null, string.Empty); } else { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_CHECKLIST_FIELDS.FIELD_EDITOR, GlobalEnums.DatabaseCompareOperator.Equal, editor); } conditions.Add(condition); if (string.IsNullOrEmpty(editTime)) { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_CHECKLIST_FIELDS.FIELD_EDIT_TIME, GlobalEnums.DatabaseCompareOperator.Null, string.Empty); } else { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_CHECKLIST_FIELDS.FIELD_EDIT_TIME, GlobalEnums.DatabaseCompareOperator.Equal, editTime); } conditions.Add(condition); List <Conditions> conditionsList = new List <Conditions>() { conditions }; #endregion List <string> sqlStringList = DatabaseTable.BuildDeleteSqlStatements(checkListFields, conditionsList); string sqlString = string.Empty; if (sqlStringList.Count > 0) { sqlString = sqlStringList[0]; } using (DbConnection connection = db.CreateConnection()) { connection.Open(); using (DbTransaction transaction = connection.BeginTransaction()) { try { #region Validate Check List Jobs Reference conditions = new Conditions(); conditions.Add(GlobalEnums.DatabaseLogicOperator.And, EMS_CHECKLIST_JOBS_FIELDS.FIELD_CHECKLIST_KEY, GlobalEnums.DatabaseCompareOperator.Equal, checkListKey); EMS_CHECKLIST_JOBS_FIELDS checkListJobsFields = new EMS_CHECKLIST_JOBS_FIELDS(); List <string> interestColumns = new List <string>() { EMS_CHECKLIST_JOBS_FIELDS.FIELD_CHECKLIST_KEY }; string checkSqlString = DatabaseTable.BuildQuerySqlStatement(checkListJobsFields, interestColumns, conditions); object scalar = db.ExecuteScalar(transaction, CommandType.Text, checkSqlString); if (scalar != null && scalar != DBNull.Value) { throw new Exception("检查表单已经关联检查表单任务,不能删除!"); } #endregion #region Validate PM Schedule Reference conditions = new Conditions(); conditions.Add(GlobalEnums.DatabaseLogicOperator.And, EMS_PM_SCHEDULE_FIELDS.FIELD_CHECKLIST_KEY, GlobalEnums.DatabaseCompareOperator.Equal, checkListKey); EMS_PM_SCHEDULE_FIELDS schedulePMFields = new EMS_PM_SCHEDULE_FIELDS(); interestColumns = new List <string>() { EMS_PM_SCHEDULE_FIELDS.FIELD_SCHEDULE_KEY }; checkSqlString = DatabaseTable.BuildQuerySqlStatement(schedulePMFields, interestColumns, conditions); scalar = db.ExecuteScalar(transaction, CommandType.Text, checkSqlString); if (scalar != null && scalar != DBNull.Value) { throw new Exception("检查表单已经关联计划PM,不能删除!"); } #endregion #region Validate PM Condition Reference conditions = new Conditions(); conditions.Add(GlobalEnums.DatabaseLogicOperator.And, EMS_PM_CONDITION_FIELDS.FIELD_CHECKLIST_KEY, GlobalEnums.DatabaseCompareOperator.Equal, checkListKey); EMS_PM_CONDITION_FIELDS conditionPMFields = new EMS_PM_CONDITION_FIELDS(); interestColumns = new List <string>() { EMS_PM_CONDITION_FIELDS.FIELD_CONDITION_KEY }; checkSqlString = DatabaseTable.BuildQuerySqlStatement(conditionPMFields, interestColumns, conditions); scalar = db.ExecuteScalar(transaction, CommandType.Text, checkSqlString); if (scalar != null && scalar != DBNull.Value) { throw new Exception("检查表单已经关联条件PM,不能删除!"); } #endregion #region Delete Check List Items Data db.ExecuteNonQuery(transaction, CommandType.Text, string.Format("DELETE EMS_CHECKLIST_ITEM WHERE CHECKLIST_KEY = '{0}'", checkListKey)); #endregion #region Delete Check List Data if (db.ExecuteNonQuery(transaction, CommandType.Text, sqlString) <= 0) { throw new Exception("数据处理失败,请重新刷新数据后再提交!"); } #endregion transaction.Commit(); } catch { transaction.Rollback(); throw; } finally { connection.Close(); } } } resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_MESSAGE, string.Empty); } catch (Exception ex) { resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_MESSAGE, ex.Message); LogService.LogError("DeleteCheckList Error: " + ex.Message); } } else { resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_MESSAGE, "提交数据不存在,请重新提交!"); } return(resDS); }
// ========================================================= ADDERS public ITask <StateType> AddCondition(ICondition <StateType> condition) { Conditions.Add(condition); return(this); }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting() { // '// ADD YOUR ACTION CODE HERE ... StringBuilder sb = new StringBuilder(); try { #region Form oForm.SupportedModes = 1; oForm.Settings.EnableRowFormat = false; oForm.Settings.Enabled = false; oForm.AutoManaged = true; foreach (SAPbouiCOM.Item item in oForm.Items) { item.AffectsFormMode = false; } #endregion oForm.Items.Add("edtFORCUS", BoFormItemTypes.it_EDIT);//아이템 Enalbled = false 처리시 커서를 빈 텍스트 박스로 옴기기 위해 임시 아이템 추가 SAPbouiCOM.Item oItem = (SAPbouiCOM.Item)oForm.Items.Item("edtFORCUS"); oItem.Left = -100; oItem.Click(); oForm.DataSources.UserDataSources.Item("edtDOCDTF").Value = Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMM01"); oForm.DataSources.UserDataSources.Item("edtDOCDTT").Value = Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMMdd"); #region EditText //매출부서 #region ProfitCenter Conditions SAPbouiCOM.Conditions oCons = new Conditions(); ; SAPbouiCOM.Condition oCon = oCons.Add(); oCon.Alias = "DimCode"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "1"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Locked"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Active"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCCD", "PrcCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCNM", "PrcName", BoFormItemTypes.it_EDIT, oCons); oCon = null; oCons = null; //영업사원 #region SalesPersons Conditions oCons = new Conditions(); ; oCon = oCons.Add(); oCon.Alias = "Active"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Locked"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_SalesEmployee).ToString(), "edtSLPCD", "SlpCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_SalesEmployee).ToString(), "edtSLPNM", "SlpName", BoFormItemTypes.it_EDIT, oCons); oCon = null; oCons = null; //매출처 #region BusinessPartner Conditions oCons = new Conditions(); ; oCon = oCons.Add(); oCon.Alias = "CardType"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "C"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "frozenFor"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtCARDCDF", "CardCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtCARDNMF", "CardName", BoFormItemTypes.it_EDIT, oCons); //대행사 #region BusinessPartner Conditions oCons = new Conditions(); ; oCon = oCons.Add(); oCon.Alias = "CardType"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "S";//공급업체 oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "frozenFor"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtBPCDF", "CardCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtBPNMF", "CardName", BoFormItemTypes.it_EDIT, oCons); #endregion #region ComboBox //간행물 FN.SetComboBoxValidValues(oForm, "SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SD01' ", "cboPUBLICA", FN.Enum_WholeTp.m_TotalTxt); SAPbouiCOM.ComboBox oCombo = oForm.Items.Item("cboPUBLICA").Specific; if (oCombo.ValidValues.Count > 0) { oForm.DataSources.UserDataSources.Item("cboPUBLICA").Value = oCombo.ValidValues.Item(0).Value; } //문서상태 oCombo = oForm.Items.Item("cboSTATUS").Specific; FN.SetComboBoxValidValues(oForm, "SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SD04' and U_SMLCD <> 'SC' ", "cboSTATUS", FN.Enum_WholeTp.m_Nothing); if (oCombo.ValidValues.Count > 0) { oForm.DataSources.UserDataSources.Item("cboSTATUS").Value = oCombo.ValidValues.Item(0).Value; } #endregion } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting() { // ADD YOUR ACTION CODE HERE ... try { #region Form oForm.SupportedModes = (int)BoAutoFormMode.afm_All; oForm.Settings.EnableRowFormat = false;//서식설정 oForm.Settings.Enabled = false;//기본서식 oForm.AutoManaged = true; if (oForm.Mode != BoFormMode.fm_FIND_MODE && oForm.Mode != BoFormMode.fm_VIEW_MODE) { oForm.Mode = BoFormMode.fm_FIND_MODE; } oForm.DataBrowser.BrowseBy = "edtDOCNUM"; #endregion SAPbouiCOM.DBDataSource oKIS_TR0041T_HRD = oForm.DataSources.DBDataSources.Item("@KIS_TR0041T_HRD"); #region EditText //코스트센터 #region ProfitCenter Conditions SAPbouiCOM.Conditions oCons = new Conditions(); ; SAPbouiCOM.Condition oCon = oCons.Add(); oCon.Alias = "DimCode"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "1"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Locked"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Active"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCCD", "PrcCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCNM", "PrcName", BoFormItemTypes.it_EDIT, oCons); //출금계좌 #region HouseBankAccounts #endregion FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oHouseBankAccounts).ToString(), "edtACCOUNT", "Account", BoFormItemTypes.it_EDIT, null); FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oHouseBankAccounts).ToString(), "edtACCTCD", "GLAccount", BoFormItemTypes.it_EDIT, null); #endregion #region ComboBox ////문서상태 //SAPbouiCOM.ComboBox oCombo = oForm.Items.Item("cboSTATUS").Specific; //FN.SetComboBoxValidValues(oForm, "SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SD04' ", "cboSTATUS", FN.Enum_WholeTp.m_Nothing); //if (oCombo.ValidValues.Count > 0) //{ // oForm.DataSources.UserDataSources.Item("cboSTATUS").Value = oCombo.ValidValues.Item(0).Value; //} //사업장 SAPbouiCOM.ComboBox oCombo = oForm.Items.Item("cboBPLID").Specific; FN.SetComboBoxValidValues(oForm, "SELECT BPLID,BPLName FROM [OBPL] ORDER BY 1 ASC", "cboBPLID", FN.Enum_WholeTp.m_Nothing); //if (oCombo.ValidValues.Count > 0) //{ // oKIS_TR0041T_HRD.SetValue("U_BPLID", 0, oCombo.ValidValues.Item(0).Value); //} #endregion #region Grid SAPbouiCOM.Grid oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd1").Specific; oGrid.SelectionMode = BoMatrixSelect.ms_NotSupported; #endregion ////문서상태 정의 //SetcboSTATUS(); #region SetAutoManagedAttribute System.Text.StringBuilder AllString = new System.Text.StringBuilder(); AllString.Append("cboBPLID,edtVATRNUM,edtACCOUNT,edtACCTCD,edtACCTNM,edtPAYDT,edtPRCCD,edtPRCNM,edtFILENM,edtDOCNUM,edtDOCDT,edtCNT,grd1"); string FindString = AllString.ToString(); FN.SetAutoManagedAttribute(ref oForm, AllString.ToString(), BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_False); FN.SetAutoManagedAttribute(ref oForm, FindString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Find, BoModeVisualBehavior.mvb_True); AllString = null; #endregion oKIS_TR0041T_HRD = null; } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting() { // '// ADD YOUR ACTION CODE HERE ... try { #region Form Setting oForm.SupportedModes = 1; oForm.Settings.EnableRowFormat = false; oForm.Settings.Enabled = false; oForm.AutoManaged = true; #endregion #region ComboBox string sql = string.Empty; // 사업장 oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboBPLID").Specific; FN.SetComboBoxValidValues(oForm, " SELECT BPLId,BPLName FROM OBPL ORDER BY BPLId ", "cboBPLID", FN.Enum_WholeTp.m_TotalTxt); oComboBox.Select(1, BoSearchKey.psk_Index); // 문서상태 oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboSTATUS").Specific; oComboBox.ValidValues.Add("", "전체"); oComboBox.ValidValues.Add("O", "미결"); oComboBox.ValidValues.Add("C", "마감"); oComboBox.Select(0, BoSearchKey.psk_Index); #endregion #region ChooseFromList SAPbouiCOM.Conditions oCons = new Conditions(); // USER #region User Conditions oCons = new Conditions(); SAPbouiCOM.Condition oCon = oCons.Add(); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_User).ToString(), "edtBTFCRE", "USER_CODE", BoFormItemTypes.it_EDIT); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_User).ToString(), "edtAPPR", "USER_CODE", BoFormItemTypes.it_EDIT); #endregion // 계정코드 #region GLAccounts Conditions oCons = new Conditions(); oCon = oCons.Add(); oCon.Alias = "Postable"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_GLAccounts).ToString(), "edtACCTCDF", "AcctCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_GLAccounts).ToString(), "edtACCTCDT", "AcctCode", BoFormItemTypes.it_EDIT, oCons); #endregion // 코스트센터 #region ProfitCenter Conditions oCons = new Conditions(); oCon = oCons.Add(); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtHPRCF", "PrcCode", BoFormItemTypes.it_EDIT); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtHPRCT", "PrcCode", BoFormItemTypes.it_EDIT); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtLPRCF", "PrcCode", BoFormItemTypes.it_EDIT); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtLPRCT", "PrcCode", BoFormItemTypes.it_EDIT); #endregion #endregion #region grd oForm.DataSources.DataTables.Add("grd"); oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific; oGrid.SelectionMode = BoMatrixSelect.ms_Single; SetGridTitle(oForm); #endregion #region default DateTime dateDoc = DateTime.Today; string strDate = " SELECT DATEADD(DD,-1,DATEADD(MM, 1, '" + Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMM01") + "')) "; dateDoc = Convert.ToDateTime(FN.GetRecordsetValue(strDate)); oForm.DataSources.UserDataSources.Item("edtFDATE").ValueEx = Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMM01"); oForm.DataSources.UserDataSources.Item("edtTDATE").ValueEx = Convert.ToDateTime(dateDoc).ToString("yyyyMMdd"); #endregion foreach (SAPbouiCOM.Item item in oForm.Items) { item.AffectsFormMode = false; } } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> /// <param name="oForm"></param> private void Act3_DefualtSetting(string pformuid = "") { try { oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); #region Form oForm.SupportedModes = 1; oForm.Settings.EnableRowFormat = false; oForm.Settings.Enabled = false; oForm.AutoManaged = false; if (oForm.Mode != BoFormMode.fm_OK_MODE && oForm.Mode != BoFormMode.fm_VIEW_MODE) { oForm.Mode = BoFormMode.fm_OK_MODE; } #endregion if (pformuid != "") { oForm.DataSources.UserDataSources.Item("pformuid").ValueEx = pformuid; SAPbouiCOM.Form pForm = (SAPbouiCOM.Form)B1Connections.theAppl.Forms.Item(pformuid); pForm.DataSources.UserDataSources.Item("cformuid").ValueEx = oForm.UniqueID; } #region ComboBox //사업장 FN.SetComboBoxValidValues(oForm, "SELECT BPLID,BPLName FROM [OBPL] ORDER BY 1 ASC", "cboBPLID", FN.Enum_WholeTp.m_Nothing); SAPbouiCOM.ComboBox oCombo = oForm.Items.Item("cboBPLID").Specific; if (oCombo.ValidValues.Count > 0) { oForm.DataSources.UserDataSources.Item("cboBPLID").ValueEx = oCombo.ValidValues.Item(0).Value; } //임포트 유형 FN.SetComboBoxValidValues(oForm, "SELECT U_RMK1,U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'TR06' AND U_USEYN = 'Y'", "cboTYPE", FN.Enum_WholeTp.m_Nothing); oCombo = oForm.Items.Item("cboTYPE").Specific; if (oCombo.ValidValues.Count > 0) { oForm.DataSources.UserDataSources.Item("cboTYPE").ValueEx = oCombo.ValidValues.Item(0).Value; } #endregion #region EditText //코스트센터 #region ProfitCenter Conditions SAPbouiCOM.Conditions oCons = new Conditions(); ; SAPbouiCOM.Condition oCon = oCons.Add(); oCon.Alias = "DimCode"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "1"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Locked"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Active"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCCD", "PrcCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCNM", "PrcName", BoFormItemTypes.it_EDIT, oCons); //코스트센터 정보 oForm.DataSources.UserDataSources.Item("edtPRCCD").Value = FN.GetRecordsetValue("SELECT PrcCode FROM dbo.OPRC WHERE PrcCode = (SELECT TOP 1 U_RMK1 FROM [dbo].[@KIS_AD00201] WHERE Code = 'TR03' AND U_SMLCD = 'UPRCCD')"); ; oForm.DataSources.UserDataSources.Item("edtPRCNM").Value = FN.GetRecordsetValue("SELECT PrcName FROM dbo.OPRC WHERE PrcCode = (SELECT TOP 1 U_RMK1 FROM [dbo].[@KIS_AD00201] WHERE Code = 'TR03' AND U_SMLCD = 'UPRCCD')"); ; //출금계좌 #region HouseBankAccounts #endregion FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oHouseBankAccounts).ToString(), "edtACCOUNT", "Account", BoFormItemTypes.it_EDIT, null); FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oHouseBankAccounts).ToString(), "edtACCTCD", "GLAccount", BoFormItemTypes.it_EDIT, null); //출금계좌 정보 oForm.DataSources.UserDataSources.Item("edtACCOUNT").Value = FN.GetRecordsetValue("SELECT Account FROM dbo.DSC1 WHERE Account = (SELECT TOP 1 U_RMK1 FROM [dbo].[@KIS_AD00201] WHERE Code = 'TR03' AND U_SMLCD = 'UACCOUNT')"); oForm.DataSources.UserDataSources.Item("edtACCTCD").Value = FN.GetRecordsetValue("SELECT GLAccount FROM dbo.DSC1 WHERE Account = (SELECT TOP 1 U_RMK1 FROM [dbo].[@KIS_AD00201] WHERE Code = 'TR03' AND U_SMLCD = 'UACCOUNT')"); oForm.DataSources.UserDataSources.Item("edtACCTNM").Value = FN.GetRecordsetValue(string.Format("SELECT AcctName FROM dbo.OACT WHERE AcctCode = '{0}'", oForm.DataSources.UserDataSources.Item("edtACCTCD").Value)); #endregion #region Validation DataTable StringBuilder pQuery = new StringBuilder(); // 거래처코드 pQuery.AppendLine("SELECT 'U_CARDCD' AS GUBUN, CardCode AS CODE, CardName AS NAME , '' AS CON FROM OCRD"); // 은행코드 pQuery.AppendLine("UNION ALL"); pQuery.AppendLine("SELECT 'U_BANKCD' AS GUBUN, U_BANKCD AS CODE, BankName AS NAME , '' AS CON FROM dbo.ODSC"); // 계정코드 pQuery.AppendLine("UNION ALL"); pQuery.AppendLine("SELECT 'U_ACCTCD' AS GUBUN, AcctCode AS CODE, AcctName AS NAME ,LocManTran AS CON FROM dbo.OACT"); // 코스트센터 pQuery.AppendLine("UNION ALL"); pQuery.AppendLine("SELECT 'U_PRCCD' AS GUBUN, PrcCode AS CODE, PrcName AS NAME , '' AS CON FROM dbo.OPRC"); validationDataTable = FN.GetRecordsetToDataTable(pQuery.ToString()); #endregion string VatRNum = FN.GetRecordsetValue(string.Format(("SELECT VATRegNum FROM OBPL WHERE BPLId = {0}"), oForm.DataSources.UserDataSources.Item("cboBPLID").Value.ToString())); oForm.DataSources.UserDataSources.Item("edtVATRNUM").ValueEx = VatRNum; } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting() { // '// ADD YOUR ACTION CODE HERE ... #region Form Setting oForm.SupportedModes = 1; oForm.Settings.EnableRowFormat = false; oForm.Settings.Enabled = false; oForm.AutoManaged = true; #endregion #region ComboBox string sql = string.Empty; // 사업장 oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboBPLID").Specific; FN.SetComboBoxValidValues(oForm, " SELECT BPLId,BPLName FROM OBPL ORDER BY BPLId ", "cboBPLID", FN.Enum_WholeTp.m_TotalTxt); oComboBox.Select(1, BoSearchKey.psk_Index); // 입력경로 oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboTRANSTY").Specific; FN.SetComboBoxValidValues(oForm, " SELECT U_SMLCD,U_SMLNM FROM [@KIS_AD00101] WHERE Code = 'AD00' AND U_USEYN = 'Y' AND U_RMK2 <> 'N' ", "cboTRANSTY", FN.Enum_WholeTp.m_TotalTxt); #endregion #region ChooseFromList SAPbouiCOM.Conditions oCons = new Conditions(); SAPbouiCOM.Condition oCon = oCons.Add(); // 코스트센터 #region ProfitCenter Conditions oCons = new Conditions(); oCon = oCons.Add(); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtFRPRCCD", "PrcCode", BoFormItemTypes.it_EDIT); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtTOPRCCD", "PrcCode", BoFormItemTypes.it_EDIT); #endregion #endregion #region default DateTime dateDoc = DateTime.Today; string strDate = " SELECT DATEADD(DD,-1,DATEADD(MM, 1, '" + Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMM01") + "')) "; dateDoc = Convert.ToDateTime(FN.GetRecordsetValue(strDate)); oForm.DataSources.UserDataSources.Item("edtFRDT").ValueEx = Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMM01"); oForm.DataSources.UserDataSources.Item("edtTODT").ValueEx = Convert.ToDateTime(dateDoc).ToString("yyyyMMdd"); #endregion }
public override void ReadData(ESPReader reader, long dataEnd) { while (reader.BaseStream.Position < dataEnd) { string subTag = reader.PeekTag(); switch (subTag) { case "EDID": if (EditorID == null) { EditorID = new SimpleSubrecord <String>(); } EditorID.ReadBinary(reader); break; case "FULL": if (Name == null) { Name = new SimpleSubrecord <String>(); } Name.ReadBinary(reader); break; case "CTDA": if (Conditions == null) { Conditions = new List <Condition>(); } Condition tempCTDA = new Condition(); tempCTDA.ReadBinary(reader); Conditions.Add(tempCTDA); break; case "DATA": if (Data == null) { Data = new RecipeData(); } Data.ReadBinary(reader); break; case "RCIL": if (Ingredients == null) { Ingredients = new List <RecipeIngredient>(); } RecipeIngredient tempRCIL = new RecipeIngredient(); tempRCIL.ReadBinary(reader); Ingredients.Add(tempRCIL); break; case "RCOD": if (Outputs == null) { Outputs = new List <RecipeOutput>(); } RecipeOutput tempRCOD = new RecipeOutput(); tempRCOD.ReadBinary(reader); Outputs.Add(tempRCOD); break; default: throw new Exception(); } } }
public override void ReadBinary(ESPReader reader) { List <string> readTags = new List <string>(); while (reader.BaseStream.Position < reader.BaseStream.Length) { string subTag = reader.PeekTag(); switch (subTag) { case "QSDT": if (readTags.Contains("QSDT")) { return; } if (StageFlags == null) { StageFlags = new SimpleSubrecord <QuestStageFlags>(); } StageFlags.ReadBinary(reader); break; case "CTDA": if (Conditions == null) { Conditions = new List <Condition>(); } Condition tempCTDA = new Condition(); tempCTDA.ReadBinary(reader); Conditions.Add(tempCTDA); break; case "CNAM": if (readTags.Contains("CNAM")) { return; } if (LogEntry == null) { LogEntry = new SimpleSubrecord <String>(); } LogEntry.ReadBinary(reader); break; case "SCHR": if (readTags.Contains("SCHR")) { return; } Script.ReadBinary(reader); break; case "NAM0": if (readTags.Contains("NAM0")) { return; } if (NextQuest == null) { NextQuest = new RecordReference(); } NextQuest.ReadBinary(reader); break; default: return; } readTags.Add(subTag); } }
public TapAndHoldState() { StateEnum = InteractionStateEnum.TapAndHold; Conditions.Add(new ElapsedTimeIsHigherThan()); }
public override void Initialize(IPlayerHandInformation info) { m_OnePairsCondition.Cards = info.Cards.ToArray(); Conditions.Add(m_OnePairsCondition); }
private void AddCondition(Func <bool> condition, string failureReason) { Conditions.Add(new KeyValuePair <Func <bool>, string>(condition, failureReason)); }
public DataSet DeleteCheckItem(DataSet reqDS) { DataSet resDS = new DataSet(); if (reqDS != null && reqDS.ExtendedProperties.ContainsKey(PARAMETERS.INPUT_KEY) && reqDS.ExtendedProperties.ContainsKey(PARAMETERS.INPUT_EDITOR) && reqDS.ExtendedProperties.ContainsKey(PARAMETERS.INPUT_EDIT_TIME)) { string checkItemKey = reqDS.ExtendedProperties[PARAMETERS.INPUT_KEY].ToString(); string editor = reqDS.ExtendedProperties[PARAMETERS.INPUT_EDITOR].ToString(); string editTime = reqDS.ExtendedProperties[PARAMETERS.INPUT_EDIT_TIME].ToString(); try { EMS_CHECKITEMS_FIELDS checkItemsFields = new EMS_CHECKITEMS_FIELDS(); #region Build Delete SQL Conditions Conditions conditions = new Conditions(); Condition condition; if (string.IsNullOrEmpty(checkItemKey)) { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_CHECKITEMS_FIELDS.FIELD_CHECKITEM_KEY, GlobalEnums.DatabaseCompareOperator.Null, string.Empty); } else { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_CHECKITEMS_FIELDS.FIELD_CHECKITEM_KEY, GlobalEnums.DatabaseCompareOperator.Equal, checkItemKey); } conditions.Add(condition); if (string.IsNullOrEmpty(editor)) { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_CHECKITEMS_FIELDS.FIELD_EDITOR, GlobalEnums.DatabaseCompareOperator.Null, string.Empty); } else { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_CHECKITEMS_FIELDS.FIELD_EDITOR, GlobalEnums.DatabaseCompareOperator.Equal, editor); } conditions.Add(condition); if (string.IsNullOrEmpty(editTime)) { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_CHECKITEMS_FIELDS.FIELD_EDIT_TIME, GlobalEnums.DatabaseCompareOperator.Null, string.Empty); } else { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_CHECKITEMS_FIELDS.FIELD_EDIT_TIME, GlobalEnums.DatabaseCompareOperator.Equal, editTime); } conditions.Add(condition); List <Conditions> conditionsList = new List <Conditions>() { conditions }; #endregion List <string> sqlStringList = DatabaseTable.BuildDeleteSqlStatements(checkItemsFields, conditionsList); string sqlString = string.Empty; if (sqlStringList.Count > 0) { sqlString = sqlStringList[0]; } #region Validate Check List Reference conditions = new Conditions(); conditions.Add(GlobalEnums.DatabaseLogicOperator.And, EMS_CHECKLIST_ITEM_FIELDS.FIELD_CHECKITEM_KEY, GlobalEnums.DatabaseCompareOperator.Equal, checkItemKey); EMS_CHECKLIST_ITEM_FIELDS checkListItemFields = new EMS_CHECKLIST_ITEM_FIELDS(); List <string> interestColumns = new List <string>() { EMS_CHECKLIST_ITEM_FIELDS.FIELD_CHECKITEM_KEY }; string checkSqlString = DatabaseTable.BuildQuerySqlStatement(checkListItemFields, interestColumns, conditions); object scalar = db.ExecuteScalar(CommandType.Text, checkSqlString); if (scalar != null && scalar != DBNull.Value) { throw new Exception("检查项已经关联检查表单,不能删除!"); } #endregion #region Delete Check Item Data if (db.ExecuteNonQuery(CommandType.Text, sqlString) > 0) { resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_MESSAGE, string.Empty); } else { throw new Exception("数据处理失败,请重新刷新数据后再提交!"); } #endregion } catch (Exception ex) { resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_MESSAGE, ex.Message); LogService.LogError("DeleteCheckItem Error: " + ex.Message); } } else { resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_MESSAGE, "提交数据不存在,请重新提交!"); } return(resDS); }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting() { // '// ADD YOUR ACTION CODE HERE ... //메트릭스 첫줄 선택시 팝업박스 뜨는것 막는다. oForm.Settings.EnableRowFormat = false; oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1").Specific; oMatrix.SelectionMode = BoMatrixSelect.ms_Single; FN.SetComboBoxValidValues(oMatrix, "U_VATGRP", " SELECT Code, [Name] FROM OVTG WHERE Code = 'A0' ", FN.Enum_WholeTp.m_Nothing); oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx2").Specific; oMatrix.SelectionMode = BoMatrixSelect.ms_Single; FN.SetComboBoxValidValues(oMatrix, "U_VATGRP", " SELECT Code, [Name] FROM OVTG WHERE Code = 'A0' ", FN.Enum_WholeTp.m_Nothing); oForm.DataBrowser.BrowseBy = "edtENTRY"; #region 독자마스터 Condition SAPbouiCOM.Conditions oCons = new Conditions(); SAPbouiCOM.Condition oCon = oCons.Add(); //oCon.Alias = "U_VATGRUP"; //계산서발행구분 //oCon.Operation = BoConditionOperation.co_EQUAL; //oCon.CondVal = "U3"; // 수기발행 oCon.Alias = "U_ADVPOST"; //선후납구분 oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "U10"; // 선납발행 //oCon.Relationship = BoConditionRelationship.cr_AND; //oCon = oCons.Add(); //oCon.Alias = "U_TYPE"; // 독자구분 //oCon.Operation = BoConditionOperation.co_EQUAL; //oCon.CondVal = "U10"; // 정상독자 #endregion // 메트릭스 독자 FN.SetChooseFromListAdd(oForm, "KIS_SO0030_HRD", "mtx1", "Code", BoFormItemTypes.it_MATRIX, oCons, "U_READCD"); #region 지국마스터 Condition oCons = new Conditions(); ; oCon = oCons.Add(); oCon.Alias = "U_BILLGBN"; //계산서발행구분 oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "U3"; // 수기발행 #endregion // 메트릭스 지국 FN.SetChooseFromListAdd(oForm, "KIS_SO0040_HRD", "mtx2", "Code", BoFormItemTypes.it_MATRIX, oCons, "U_CENTCD"); FN.SetAutoManagedAttribute(ref oForm, "edtENTRY,cboSTATUS", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_False); FN.SetAutoManagedAttribute(ref oForm, "edtENTRY,cboSTATUS", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Find, BoModeVisualBehavior.mvb_True); SAPbouiCOM.Item oItem = oForm.Items.Item("fld02"); oItem.Click(); }
/*/// <summary> * /// Process the Text template. * /// </summary> * private void ProcessTextTemplate(string content) * { * ActiveUp.Net.Mail.Logger.AddEntry("Processing the TEXT template.", 1); * * // Initialize strings to be used later * string line = string.Empty, lineUpper = string.Empty; * * // Initialize the StringReader to read line per line * StringReader reader = new StringReader(content); * * // Initialize the actual body count * int bodyCount = _bodies.Count, lineNumber = 0; * * // Read and parse each line. Append the data in the properties. * while (reader.Peek() > -1) * { * ActiveUp.Net.Mail.Logger.AddEntry("Line parsed. Body count: + " + bodyCount.ToString() + ".", 0); * * line = reader.ReadLine(); * lineNumber++; * lineUpper = line.ToUpper(); * * // If a property, then set value * if (lineUpper.StartsWith("TO:")) * { * ActiveUp.Net.Mail.Logger.AddEntry("TO property found: + " + line + " (raw).", 0); * this.Message.To.Add(Parser.ParseAddress(ExtractValue(line))); * } * else if (lineUpper.StartsWith("BCC:")) * { * ActiveUp.Net.Mail.Logger.AddEntry("BCC property found: + " + line + " (raw).", 0); * this.Message.Bcc.Add(Parser.ParseAddress(ExtractValue(line))); * } * else if (lineUpper.StartsWith("CC:")) * { * ActiveUp.Net.Mail.Logger.AddEntry("CC property found: + " + line + " (raw).", 0); * this.Message.Cc.Add(Parser.ParseAddress(ExtractValue(line))); * } * else if (lineUpper.StartsWith("FROM:")) * { * ActiveUp.Net.Mail.Logger.AddEntry("FROM property found: + " + line + " (raw).", 0); * this.Message.From = Parser.ParseAddress(ExtractValue(line)); * } * else if (lineUpper.StartsWith("SUBJECT:")) * { * ActiveUp.Net.Mail.Logger.AddEntry("SUBJECT property found: + " + line + " (raw).", 0); * this.Message.Subject += ExtractValue(line); * } * else if (lineUpper.StartsWith("SMTPSERVER:")) * { * ActiveUp.Net.Mail.Logger.AddEntry("SMTPSERVER property found: + " + line + " (raw).", 0); * this.SmtpServers.Add(ExtractValue(line), 25); * } * else if (lineUpper.StartsWith("BODYTEXT:")) * { * ActiveUp.Net.Mail.Logger.AddEntry("BODYTEXT property found: + " + line + " (raw).", 0); * this.Bodies.Add(ExtractValue(line), BodyFormat.Text); * bodyCount++; * } * else if (lineUpper.StartsWith("BODYHTML:")) * { * ActiveUp.Net.Mail.Logger.AddEntry("BODYHTML property found: + " + line + " (raw).", 0); * this.Bodies.Add(ExtractValue(line), BodyFormat.Html); * bodyCount++; * } * else if (lineUpper.StartsWith("FIELDFORMAT:") && lineUpper.IndexOf("=") > -1) * { * ActiveUp.Net.Mail.Logger.AddEntry("FIELDFORMAT property found: + " + line + " (raw).", 0); * this.FieldsFormats.Add(ExtractFormat(line)); * } * else if (lineUpper.StartsWith("//")) * { * ActiveUp.Net.Mail.Logger.AddEntry("COMMENT line found: + " + line + " (raw).", 0); * // Line is a comment, so do nothing * } * // If not a property, then it's a message line * else * { * ActiveUp.Net.Mail.Logger.AddEntry("BODY line found: + " + line + " (raw).", 0); * this.Bodies[bodyCount-1].Content += line + "\r\n"; * } * } * }*/ /*/// <summary> * /// Extract the format options from a text template line. * /// </summary> * /// <param name="line">The text template line.</param> * /// <returns>A FieldFormat object with the options.</returns> * private FieldFormat ExtractFormat(string line) * { * ActiveUp.Net.Mail.Logger.AddEntry("Extracting FieldFormat from line: + " + line + " (raw).", 0); * * FieldFormat fieldFormat = new FieldFormat(); * string property, val; * * foreach(string format in ExtractValue(line).Split(';')) * { * string[] lineSplit = format.Split('='); * * if (lineSplit.Length > 1) * { * property = lineSplit[0]; * val = lineSplit[1]; * * switch (property.ToUpper()) * { * case "NAME": fieldFormat.Name = val; break; * case "FORMAT": fieldFormat.Format = val; break; * case "PADDINGDIR": * if (val.ToUpper() == "LEFT") * fieldFormat.PaddingDir = PaddingDirection.Left; * else * fieldFormat.PaddingDir = PaddingDirection.Right; * break; * case "TOTALWIDTH": * try * { * fieldFormat.TotalWidth = Convert.ToInt16(val); * } * catch * { * throw new Exception("Specified Total Width is not a valid number."); * } * break; * case "PADDINGCHAR": fieldFormat.PaddingChar = Convert.ToChar(val.Substring(0, 1)); break; * } * * }// End if line split length > 1 * } * * return fieldFormat; * }*/ /// <summary> /// Process the Xml template. /// </summary> private void ProcessXmlTemplate(string content) { ActiveUp.Net.Mail.Logger.AddEntry("Processing the XML template.", 1); StringReader stringReader = new StringReader(content); XmlTextReader reader = new XmlTextReader(stringReader); string element = string.Empty; while (reader.Read()) { switch (reader.NodeType) { case XmlNodeType.Element: element = reader.Name; ActiveUp.Net.Mail.Logger.AddEntry(string.Format("New element found: {0}", element), 0); switch (element.ToUpper()) { case "MESSAGE": { if (reader.GetAttribute("PRIORITY") != null && reader.GetAttribute("PRIORITY") != string.Empty) { this.Message.Priority = (MessagePriority)Enum.Parse(typeof(MessagePriority), reader.GetAttribute("PRIORITY"), true); } else if (reader.GetAttribute("priority") != null && reader.GetAttribute("priority") != string.Empty) { this.Message.Priority = (MessagePriority)Enum.Parse(typeof(MessagePriority), reader.GetAttribute("priority"), true); } } break; case "FIELDFORMAT": if (reader.HasAttributes) { ActiveUp.Net.Mail.Logger.AddEntry("Element has attributes.", 0); FieldFormat fieldFormat = new FieldFormat(); if (reader.GetAttribute("NAME") != null && reader.GetAttribute("NAME") != string.Empty) { fieldFormat.Name = reader.GetAttribute("NAME"); ActiveUp.Net.Mail.Logger.AddEntry(string.Format("Attribute NAME: {0}", fieldFormat.Name), 0); } else if (reader.GetAttribute("name") != null && reader.GetAttribute("name") != string.Empty) { fieldFormat.Name = reader.GetAttribute("name"); ActiveUp.Net.Mail.Logger.AddEntry(string.Format("Attribute name: {0}", fieldFormat.Name), 0); } if (reader.GetAttribute("FORMAT") != null && reader.GetAttribute("FORMAT") != string.Empty) { fieldFormat.Format = reader.GetAttribute("FORMAT"); ActiveUp.Net.Mail.Logger.AddEntry(string.Format("Attribute FORMAT: {0}", fieldFormat.Format), 0); } else if (reader.GetAttribute("format") != null && reader.GetAttribute("format") != string.Empty) { fieldFormat.Format = reader.GetAttribute("format"); ActiveUp.Net.Mail.Logger.AddEntry(string.Format("Attribute format: {0}", fieldFormat.Format), 0); } if (reader.GetAttribute("PADDINGDIR") != null && reader.GetAttribute("PADDINGDIR") != string.Empty) { if (reader.GetAttribute("PADDINGDIR").ToUpper() == "LEFT") { fieldFormat.PaddingDir = PaddingDirection.Left; } else { fieldFormat.PaddingDir = PaddingDirection.Right; } ActiveUp.Net.Mail.Logger.AddEntry(string.Format("Attribute PADDINGDIR: {0}", reader.GetAttribute("PADDINGDIR")), 0); } else if (reader.GetAttribute("paddingdir") != null && reader.GetAttribute("paddingdir") != string.Empty) { if (reader.GetAttribute("paddingdir").ToUpper() == "left") { fieldFormat.PaddingDir = PaddingDirection.Left; } else { fieldFormat.PaddingDir = PaddingDirection.Right; } ActiveUp.Net.Mail.Logger.AddEntry(string.Format("Attribute paddingdir: {0}", reader.GetAttribute("paddingdir")), 0); } if (reader.GetAttribute("TOTALWIDTH") != null && reader.GetAttribute("TOTALWIDTH") != string.Empty) { try { fieldFormat.TotalWidth = Convert.ToInt16(reader.GetAttribute("TOTALWIDTH")); } catch { throw new Exception("Specified Total Width is not a valid number."); } ActiveUp.Net.Mail.Logger.AddEntry(string.Format("Attribute TOTALWIDTH: {0}", fieldFormat.TotalWidth.ToString()), 0); } else if (reader.GetAttribute("totalwidth") != null && reader.GetAttribute("totalwidth") != string.Empty) { try { fieldFormat.TotalWidth = Convert.ToInt16(reader.GetAttribute("totalwidth")); } catch { throw new Exception("Specified Total Width is not a valid number."); } ActiveUp.Net.Mail.Logger.AddEntry(string.Format("Attribute totalwidth: {0}", fieldFormat.TotalWidth.ToString()), 0); } if (reader.GetAttribute("PADDINGCHAR") != null && reader.GetAttribute("PADDINGCHAR") != string.Empty) { fieldFormat.PaddingChar = Convert.ToChar(reader.GetAttribute("PADDINGCHAR").Substring(0, 1)); ActiveUp.Net.Mail.Logger.AddEntry(string.Format("Attribute PADDINGCHAR: '{0}'", fieldFormat.PaddingChar), 0); } else if (reader.GetAttribute("paddingchar") != null && reader.GetAttribute("paddingchar") != string.Empty) { fieldFormat.PaddingChar = Convert.ToChar(reader.GetAttribute("paddingchar").Substring(0, 1)); ActiveUp.Net.Mail.Logger.AddEntry(string.Format("Attribute paddingchar: '{0}'", fieldFormat.PaddingChar), 0); } this.FieldsFormats.Add(fieldFormat); } break; case "FROM": case "TO": case "CC": case "BCC": if (reader.HasAttributes) { ActiveUp.Net.Mail.Address address = new ActiveUp.Net.Mail.Address(); if (reader.GetAttribute("NAME") != null && reader.GetAttribute("NAME") != string.Empty) { address.Name = reader.GetAttribute("NAME"); } else if (reader.GetAttribute("name") != null && reader.GetAttribute("name") != string.Empty) { address.Name = reader.GetAttribute("name"); } if (reader.GetAttribute("EMAIL") != null && reader.GetAttribute("EMAIL") != string.Empty) { address.Email = reader.GetAttribute("EMAIL"); } else if (reader.GetAttribute("email") != null && reader.GetAttribute("email") != string.Empty) { address.Email = reader.GetAttribute("email"); } if (element.ToUpper() == "FROM") { if (reader.GetAttribute("REPLYNAME") != null && reader.GetAttribute("REPLYNAME") != string.Empty) { InitReplyTo(); this.Message.ReplyTo.Name = reader.GetAttribute("REPLYNAME"); } else if (reader.GetAttribute("replyname") != null && reader.GetAttribute("replyname") != string.Empty) { InitReplyTo(); this.Message.ReplyTo.Name = reader.GetAttribute("replyname"); } if (reader.GetAttribute("REPLYEMAIL") != null && reader.GetAttribute("REPLYEMAIL") != string.Empty) { InitReplyTo(); this.Message.ReplyTo.Email = reader.GetAttribute("REPLYEMAIL"); } else if (reader.GetAttribute("replyemail") != null && reader.GetAttribute("replyemail") != string.Empty) { InitReplyTo(); this.Message.ReplyTo.Email = reader.GetAttribute("replyemail"); } if (reader.GetAttribute("RECEIPTEMAIL") != null && reader.GetAttribute("RECEIPTEMAIL") != string.Empty) { this.Message.ReturnReceipt.Email = reader.GetAttribute("RECEIPTEMAIL"); } else if (reader.GetAttribute("receiptemail") != null && reader.GetAttribute("receiptemail") != string.Empty) { this.Message.ReturnReceipt.Email = reader.GetAttribute("receiptemail"); } } switch (reader.Name.ToUpper()) { case "FROM": /*this.Message.From.Add(address);*/ this.Message.From = address; break; case "TO": this.Message.To.Add(address); break; case "CC": this.Message.Cc.Add(address); break; case "BCC": this.Message.Bcc.Add(address); break; } } break; case "LISTTEMPLATE": { ListTemplate template = new ListTemplate(); string RegionID = string.Empty; string NullText = string.Empty; if (reader.GetAttribute("REGIONID") != null && reader.GetAttribute("REGIONID") != string.Empty) { RegionID = reader.GetAttribute("REGIONID"); } else if (reader.GetAttribute("regionid") != null && reader.GetAttribute("regionid") != string.Empty) { RegionID = reader.GetAttribute("regionid"); } if (reader.GetAttribute("NULLTEXT") != null && reader.GetAttribute("NULLTEXT") != string.Empty) { NullText = reader.GetAttribute("NULLTEXT"); } else if (reader.GetAttribute("nulltext") != null && reader.GetAttribute("nulltext") != string.Empty) { NullText = reader.GetAttribute("nulltext"); } if (reader.HasAttributes && reader.GetAttribute("NAME") != null && reader.GetAttribute("NAME") != string.Empty) { template = new ListTemplate(reader.GetAttribute("NAME"), reader.ReadString()); } else if (reader.HasAttributes && reader.GetAttribute("name") != null && reader.GetAttribute("name") != string.Empty) { template = new ListTemplate(reader.GetAttribute("name"), reader.ReadString()); } template.RegionID = RegionID; template.NullText = NullText; this.ListTemplates.Add(template); } break; case "SMTPSERVER": { Server server = new Server(); if (reader.GetAttribute("SERVER") != null && reader.GetAttribute("SERVER") != string.Empty) { server.Host = reader.GetAttribute("SERVER"); } else if (reader.GetAttribute("server") != null && reader.GetAttribute("server") != string.Empty) { server.Host = reader.GetAttribute("server"); } if (reader.GetAttribute("PORT") != null && reader.GetAttribute("PORT") != string.Empty) { server.Port = int.Parse(reader.GetAttribute("PORT")); } else if (reader.GetAttribute("port") != null && reader.GetAttribute("port") != string.Empty) { server.Port = int.Parse(reader.GetAttribute("port")); } if (reader.GetAttribute("USERNAME") != null && reader.GetAttribute("USERNAME") != string.Empty) { server.Username = reader.GetAttribute("USERNAME"); } else if (reader.GetAttribute("username") != null && reader.GetAttribute("username") != string.Empty) { server.Username = reader.GetAttribute("username"); } if (reader.GetAttribute("PASSWORD") != null && reader.GetAttribute("PASSWORD") != string.Empty) { server.Password = reader.GetAttribute("PASSWORD"); } else if (reader.GetAttribute("password") != null && reader.GetAttribute("password") != string.Empty) { server.Password = reader.GetAttribute("password"); } SmtpServers.Add(server); } break; case "CONDITION": { Condition condition = new Condition(); if (reader.GetAttribute("REGIONID") != null && reader.GetAttribute("REGIONID") != string.Empty) { condition.RegionID = reader.GetAttribute("REGIONID"); } else if (reader.GetAttribute("regionid") != null && reader.GetAttribute("regionid") != string.Empty) { condition.RegionID = reader.GetAttribute("regionid"); } if (reader.GetAttribute("OPERATOR") != null && reader.GetAttribute("OPERATOR") != string.Empty) { condition.Operator = (OperatorType)Enum.Parse(typeof(OperatorType), reader.GetAttribute("OPERATOR"), true); } else if (reader.GetAttribute("operator") != null && reader.GetAttribute("operator") != string.Empty) { condition.Operator = (OperatorType)Enum.Parse(typeof(OperatorType), reader.GetAttribute("operator"), true); } if (reader.GetAttribute("NULLTEXT") != null && reader.GetAttribute("NULLTEXT") != string.Empty) { condition.NullText = reader.GetAttribute("NULLTEXT"); } else if (reader.GetAttribute("nulltext") != null && reader.GetAttribute("nulltext") != string.Empty) { condition.NullText = reader.GetAttribute("nulltext"); } if (reader.GetAttribute("FIELD") != null && reader.GetAttribute("FIELD") != string.Empty) { condition.Field = reader.GetAttribute("FIELD"); } else if (reader.GetAttribute("field") != null && reader.GetAttribute("field") != string.Empty) { condition.Field = reader.GetAttribute("field"); } if (reader.GetAttribute("VALUE") != null && reader.GetAttribute("VALUE") != string.Empty) { condition.Value = reader.GetAttribute("VALUE"); } else if (reader.GetAttribute("value") != null && reader.GetAttribute("value") != string.Empty) { condition.Value = reader.GetAttribute("value"); } if (reader.GetAttribute("CASESENSITIVE") != null && reader.GetAttribute("CASESENSITIVE") != string.Empty) { condition.CaseSensitive = bool.Parse(reader.GetAttribute("CASESENSITIVE")); } else if (reader.GetAttribute("casesensitive") != null && reader.GetAttribute("casesensitive") != string.Empty) { condition.CaseSensitive = bool.Parse(reader.GetAttribute("casesensitive")); } Conditions.Add(condition); } break; case "REGION": { Region region = new Region(); if (reader.GetAttribute("REGIONID") != null && reader.GetAttribute("REGIONID") != string.Empty) { region.RegionID = reader.GetAttribute("REGIONID"); } else if (reader.GetAttribute("regionid") != null && reader.GetAttribute("regionid") != string.Empty) { region.RegionID = reader.GetAttribute("regionid"); } if (reader.GetAttribute("NULLTEXT") != null && reader.GetAttribute("NULLTEXT") != string.Empty) { region.NullText = reader.GetAttribute("NULLTEXT"); } else if (reader.GetAttribute("nulltext") != null && reader.GetAttribute("nulltext") != string.Empty) { region.NullText = reader.GetAttribute("nulltext"); } if (reader.GetAttribute("URL") != null && reader.GetAttribute("URL") != string.Empty) { region.URL = reader.GetAttribute("URL"); } else if (reader.GetAttribute("url") != null && reader.GetAttribute("url") != string.Empty) { region.URL = reader.GetAttribute("url"); } Regions.Add(region); } break; } break; case XmlNodeType.Text: switch (element.ToUpper()) { case "SUBJECT": this.Message.Subject += reader.Value; break; /*case "SMTPSERVER": * this.SmtpServers.Add(reader.Value, 25); * break;*/ case "BODYHTML": //this.Bodies.Add(reader.Value, BodyFormat.Html); this.Message.BodyHtml.Text += reader.Value; break; case "BODYTEXT": //this.Bodies.Add(reader.Value, BodyFormat.Text); this.Message.BodyText.Text += reader.Value; break; } break; case XmlNodeType.EndElement: element = string.Empty; break; } } }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting() { // '// ADD YOUR ACTION CODE HERE ... StringBuilder sb = new StringBuilder(); try { #region Form oForm.SupportedModes = 1; oForm.Settings.EnableRowFormat = false; oForm.Settings.Enabled = false; oForm.AutoManaged = true; foreach (SAPbouiCOM.Item item in oForm.Items) { item.AffectsFormMode = false; } #endregion //전기일:시작 oForm.DataSources.UserDataSources.Item("edtSALDTF").Value = Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMM01"); //전기일:종료 oForm.DataSources.UserDataSources.Item("edtSALDTT").Value = Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMMdd"); //매출부서 #region ProfitCenter Conditions SAPbouiCOM.Conditions oCons = new Conditions(); ; SAPbouiCOM.Condition oCon = oCons.Add(); oCon.Alias = "DimCode"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "1"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Locked"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCCD", "PrcCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCNM", "PrcName", BoFormItemTypes.it_EDIT, oCons); oCon = null; oCons = null; //영업사원 #region SalesPersons Conditions oCons = new Conditions(); ; oCon = oCons.Add(); oCon.Alias = "Active"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Locked"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_SalesEmployee).ToString(), "edtSLPCD", "SlpCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_SalesEmployee).ToString(), "edtSLPNM", "SlpName", BoFormItemTypes.it_EDIT, oCons); oCon = null; oCons = null; #region ComboBox //간행물 FN.SetComboBoxValidValues(oForm, "SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SD01' ", "cboPUBLICA", FN.Enum_WholeTp.m_TotalTxt); SAPbouiCOM.ComboBox oCombo = oForm.Items.Item("cboPUBLICA").Specific; if (oCombo.ValidValues.Count > 0) { oForm.DataSources.UserDataSources.Item("cboPUBLICA").Value = oCombo.ValidValues.Item(0).Value; } #endregion } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting() { // ADD YOUR ACTION CODE HERE ... try { #region Form oForm.SupportedModes = -1; oForm.Settings.EnableRowFormat = false;//서식설정 oForm.Settings.Enabled = false;//기본서식 oForm.AutoManaged = true; if (oForm.Mode != BoFormMode.fm_ADD_MODE && oForm.Mode != BoFormMode.fm_VIEW_MODE) { oForm.Mode = BoFormMode.fm_ADD_MODE; } oForm.DataBrowser.BrowseBy = "edtDOCNUM"; #endregion SAPbouiCOM.DBDataSource oKIS_SD0070T_HRD = oForm.DataSources.DBDataSources.Item("@KIS_SD0070T_HRD"); //문서번호 oKIS_SD0070T_HRD.SetValue("DocEntry", 0, FN.GetNextDocEntry("KIS_SD0070_HRD")); //전기일 oKIS_SD0070T_HRD.SetValue("U_DOCDT", 0, Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMMdd")); #region EditText //담당부서 #region ProfitCenter Conditions SAPbouiCOM.Conditions oCons = new Conditions(); ; SAPbouiCOM.Condition oCon = oCons.Add(); oCon.Alias = "DimCode"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "1"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Locked"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Active"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCCD", "PrcCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCNM", "PrcName", BoFormItemTypes.it_EDIT, oCons); oCon = null; oCons = null; //대행사 #region BusinessPartner Conditions oCons = new Conditions(); ; oCon = oCons.Add(); oCon.Alias = "CardType"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "S";//공급업체 oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "frozenFor"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtBPCD", "CardCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtBPNM", "CardName", BoFormItemTypes.it_EDIT, oCons); //관리계정 #region BusinessPartner Conditions oCons = new Conditions(); ; oCon = oCons.Add(); //자산계정이이고 oCon.Alias = "Postable"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; oCon.Relationship = BoConditionRelationship.cr_AND; //기밀이 'N'이고 oCon = oCons.Add(); oCon.Alias = "Protected"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; //비활성이 'N' oCon = oCons.Add(); oCon.Alias = "FrozenFor"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; //관리계정이이고 oCon = oCons.Add(); oCon.Alias = "LocManTran"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oChartOfAccounts).ToString(), "edtACCTCD", "AcctCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oChartOfAccounts).ToString(), "edtACCTNM", "AcctName", BoFormItemTypes.it_EDIT, oCons); #endregion #region ComboBox //문서상태 SAPbouiCOM.ComboBox oCombo = oForm.Items.Item("cboSTATUS").Specific; FN.SetComboBoxValidValues(oForm, "SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SD04' ", "cboSTATUS", FN.Enum_WholeTp.m_Nothing); if (oCombo.ValidValues.Count > 0) { oForm.DataSources.UserDataSources.Item("cboSTATUS").Value = oCombo.ValidValues.Item(0).Value; } //사업장 oCombo = oForm.Items.Item("cboBPLID").Specific; FN.SetComboBoxValidValues(oForm, "SELECT BPLID,BPLName FROM [OBPL] ORDER BY 1 ASC", "cboBPLID", FN.Enum_WholeTp.m_Nothing); if (oCombo.ValidValues.Count > 0) { oKIS_SD0070T_HRD.SetValue("U_BPLID", 0, oCombo.ValidValues.Item(0).Value); } //간행물 FN.SetComboBoxValidValues(oForm, "SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SD01' ", "cboPUBLICA", FN.Enum_WholeTp.m_TotalTxt); oCombo = oForm.Items.Item("cboPUBLICA").Specific; if (oCombo.ValidValues.Count > 0) { oForm.DataSources.UserDataSources.Item("cboPUBLICA").Value = oCombo.ValidValues.Item(0).Value; } #endregion //문서상태 정의 SetcboSTATUS(); #region SetAutoManagedAttribute System.Text.StringBuilder AllString = new System.Text.StringBuilder(); AllString.Append("edtBPCD,edtBPNM,edtPRCCD,edtPRCNM,edtBPRATE,cboBPLID,edtDOCNUM,cboSTATUS,edtDOCDT,edtTRANSID,edtSTORNO"); AllString.Append(",edtAMTSUMB,edtVATSUMB,edtDOCTOTB,grd1,edtACCTCD,edtACCTNM,cboPUBLICA,edtFDATE,edtTDATE,btnFIND"); System.Text.StringBuilder OKString = new System.Text.StringBuilder(); //OKString.Append("edtBPCD,edtBPNM,edtPRCCD,edtPRCNM,edtORDERRA,cboBPLID,edtDOCNUM,cboSTATUS,edtDOCDT,edtTRANSID,edtSTORNO,"); //OKString.Append("edtAMTSUMB,edtVATSUMB,edtDOCTOTB"); System.Text.StringBuilder AddString = new System.Text.StringBuilder(); AddString.Append("edtBPCD,edtBPNM,edtPRCCD,edtPRCNM,edtBPRATE,cboBPLID,edtDOCDT,grd1,edtACCTCD,edtACCTNM,cboPUBLICA,edtFDATE,edtTDATE,btnFIND"); string FindString = AllString.ToString(); string VisibleString = "sttPUBLICA,cboPUBLICA,sttDATE,sttFDATE,edtFDATE,sttTDATE,edtTDATE,btnFIND,recFIND"; FN.SetAutoManagedAttribute(ref oForm, AllString.ToString(), BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_False); FN.SetAutoManagedAttribute(ref oForm, AddString.ToString(), BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Add, BoModeVisualBehavior.mvb_True); FN.SetAutoManagedAttribute(ref oForm, OKString.ToString(), BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True); FN.SetAutoManagedAttribute(ref oForm, FindString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Find, BoModeVisualBehavior.mvb_True); FN.SetAutoManagedAttribute(ref oForm, VisibleString, BoAutoManagedAttr.ama_Visible, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_False); FN.SetAutoManagedAttribute(ref oForm, VisibleString, BoAutoManagedAttr.ama_Visible, BoAutoFormMode.afm_Add, BoModeVisualBehavior.mvb_True); AllString = null; OKString = null; AddString = null; #endregion oKIS_SD0070T_HRD = null; //oKIS_SD00701_HRD = null; #region Grid SAPbouiCOM.Grid oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd1").Specific; oGrid.SelectionMode = BoMatrixSelect.ms_NotSupported; Veiw_Grid1_DataTable(oForm); #endregion } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> /// <param name="oForm"></param> private void Act3_DefualtSetting(string pformuid = "") { try { #region Form oForm.SupportedModes = 1; oForm.Settings.EnableRowFormat = false; oForm.Settings.Enabled = false; oForm.AutoManaged = false; if (oForm.Mode != BoFormMode.fm_OK_MODE && oForm.Mode != BoFormMode.fm_VIEW_MODE) { oForm.Mode = BoFormMode.fm_OK_MODE; } #endregion if (pformuid != "") { oForm.DataSources.UserDataSources.Item("pformuid").ValueEx = pformuid; SAPbouiCOM.Form pForm = (SAPbouiCOM.Form)B1Connections.theAppl.Forms.Item(pformuid); pForm.DataSources.UserDataSources.Item("cformuid").ValueEx = oForm.UniqueID; } #region ComboBox //사업장 FN.SetComboBoxValidValues(oForm, "SELECT BPLID,BPLName FROM [OBPL] ORDER BY 1 ASC", "cboBPLID", FN.Enum_WholeTp.m_Nothing); SAPbouiCOM.ComboBox oCombo = oForm.Items.Item("cboBPLID").Specific; if (oCombo.ValidValues.Count > 0) { oForm.DataSources.UserDataSources.Item("cboBPLID").ValueEx = oCombo.ValidValues.Item(0).Value; } #endregion #region EditText //코스트센터 #region ProfitCenter Conditions SAPbouiCOM.Conditions oCons = new Conditions(); ; SAPbouiCOM.Condition oCon = oCons.Add(); oCon.Alias = "DimCode"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "1"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Locked"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Active"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCCD", "PrcCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCNM", "PrcName", BoFormItemTypes.it_EDIT, oCons); //출금계좌 #region HouseBankAccounts #endregion FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oHouseBankAccounts).ToString(), "edtACCOUNT", "Account", BoFormItemTypes.it_EDIT, null); FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oHouseBankAccounts).ToString(), "edtACCTCD", "GLAccount", BoFormItemTypes.it_EDIT, null); #endregion #region Grid SAPbouiCOM.Grid oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd1").Specific; oGrid.SelectionMode = BoMatrixSelect.ms_NotSupported; Veiw_Grid1_DataTable(oForm); #endregion //FN.SetAutoManagedAttribute(ref oForm, "edtMAINCD", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_False); //FN.SetAutoManagedAttribute(ref oForm, "edtMAINCD", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Add, BoModeVisualBehavior.mvb_True); } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } }
public override void ReadData(ESPReader reader, long dataEnd) { while (reader.BaseStream.Position < dataEnd) { string subTag = reader.PeekTag(); switch (subTag) { case "EDID": if (EditorID == null) { EditorID = new SimpleSubrecord <String>(); } EditorID.ReadBinary(reader); break; case "CTDA": if (Conditions == null) { Conditions = new List <Condition>(); } Condition tempCTDA = new Condition(); tempCTDA.ReadBinary(reader); Conditions.Add(tempCTDA); break; case "ANAM": if (RelatedCameraPaths == null) { RelatedCameraPaths = new RelatedCameraPaths(); } RelatedCameraPaths.ReadBinary(reader); break; case "DATA": if (CameraZoom == null) { CameraZoom = new SimpleSubrecord <CameraPathZoom>(); } CameraZoom.ReadBinary(reader); break; case "SNAM": if (CameraShots == null) { CameraShots = new List <RecordReference>(); } RecordReference tempSNAM = new RecordReference(); tempSNAM.ReadBinary(reader); CameraShots.Add(tempSNAM); break; default: throw new Exception(); } } }
public override bool doTool() { Condition newCondition = null; int type = ConditionsController.getTypeFromstring(conditionType); if (type == ConditionsController.FLAG_CONDITION) { newCondition = new FlagCondition(conditionId, ConditionsController.getStateFromstring(conditionState)); } else if (type == ConditionsController.VAR_CONDITION) { newCondition = new VarCondition(conditionId, ConditionsController.getStateFromstring(conditionState), int.Parse(value)); } else if (type == ConditionsController.GLOBAL_STATE_CONDITION) { newCondition = new GlobalStateCondition(conditionId, ConditionsController.getStateFromstring(conditionState)); } if (newCondition != null) { if (index1 < conditions.Size()) { if (index2 == ConditionsController.INDEX_NOT_USED) { // Add new block List <Condition> newBlock = new List <Condition>(); newBlock.Add(newCondition); conditions.Add(index1, newBlock); indexAdded = index1; blockAdded = newBlock; } else { var block = conditions.Get(index1); if (index2 < 0 || index2 > block.Count) { return(false); } if (index2 == conditions.Size()) { block.Add(newCondition); indexAdded = block.IndexOf(newCondition); conditionAdded = newCondition; } else { indexAdded = index2; conditionAdded = newCondition; block.Insert(index2, newCondition); } } } else { // Add new block List <Condition> newBlock = new List <Condition>(); newBlock.Add(newCondition); conditions.Add(newBlock); indexAdded = conditions.Size() - 1; blockAdded = newBlock; } Controller.Instance.updateVarFlagSummary(); Controller.Instance.updatePanel(); return(true); } return(false); }
public void ModAV(string av, object value, bool?propagate) { if (av.Contains(".")) { string firstPart = av.Substring(0, av.IndexOf('.')); string secondPart = av.Substring(av.IndexOf('.') + 1); if (firstPart == "BaseStats") { BaseStats.ModStat(secondPart, value); if (!propagate.HasValue) { UpdateStats(); } } else if (firstPart == "DerivedStats") { DerivedStats.ModStat(secondPart, value); } else if (firstPart == "Conditions") { //delete if present, add if not string fqConditionName = GetType().Namespace + "." + value.ToString(); Condition newCondition = (Condition)Activator.CreateInstance(Type.GetType(fqConditionName)); Condition oldCondition = null; foreach (Condition c in Conditions) { if (c.GetType() == newCondition.GetType()) { oldCondition = c; break; } } if (oldCondition != null) { Conditions.Remove(oldCondition); } else { Conditions.Add(newCondition); } if (!propagate.HasValue) { UpdateStats(); } } } else { //search and modify property var prop = GetType().GetProperty(av); if (TypeUtils.IsNumericType(prop.PropertyType)) { decimal newVal = Convert.ToDecimal(prop.GetValue(this, null)) + Convert.ToDecimal(value); prop.SetValue(this, Convert.ChangeType(newVal, prop.PropertyType), null); } else if (prop.PropertyType == typeof(string)) { string newVal = ((string)prop.GetValue(this, null)) + (string)(object)value; prop.SetValue(this, newVal, null); } else { prop.SetValue(this, Convert.ChangeType(value, prop.PropertyType), null); } } if (propagate.HasValue && propagate.Value) { UpdateStats(); } }
public PressUpState() { StateEnum = InteractionStateEnum.PressUp; Conditions.Add(new ElapsedTimeIsHigherThan()); }
/// <summary> /// Parse sql select query /// </summary> /// <param name="words"></param> private void parse(string[] words) { var fromIndex = getIndexWord(words, "from"); if (fromIndex + 1 >= words.Length) { throw new SelectCommandParse($"Not found table name into query."); } // set table name and database name if format [dbname].[tableName] var tableAndDatabaseNames = words[fromIndex + 1].Split('.'); if (tableAndDatabaseNames.Length == 2) { DatabaseName = tableAndDatabaseNames[0]; TableName = tableAndDatabaseNames[1]; } else { TableName = tableAndDatabaseNames[0]; } // set flag if all columns if (words[1] == "*" && fromIndex == 2) { AllColumns = true; } // if there are columns name by commas else if (fromIndex >= 2) { for (int i = 1; i < fromIndex; i++) { ColumnsName.Add(words[i].Replace(",", "").Trim()); } } else { throw new SelectCommandParse($"Not found columns into query."); } var orderIndex = getIndexWord(words, "order"); var whereIndex = getIndexWord(words, "where"); // parse conditions if (whereIndex != -1) { var indexTo = orderIndex == -1 ? words.Length : orderIndex; var conditionParts = new List <string>(); for (int i = whereIndex + 1; i < indexTo; i++) { if (words[i].ToLower() == "and" || words[i].ToLower() == "or") { ConditionsOperators.Add(words[i].ToLower()); Conditions.Add(new Condition(conditionParts)); conditionParts = new List <string>(); } else { conditionParts.Add(words[i]); } } Conditions.Add(new Condition(conditionParts)); } // do not have order by clause into query if (orderIndex == -1) { return; } // if ... no continue for order by clause if (words.Length - orderIndex < 2) { throw new SelectCommandParse($"Not found ORDER BY columns into query."); } // check BY after ORDER if (words[orderIndex + 1].ToLower() != "by") { throw new SelectCommandParse($"Not found 'BY' after ORDER clause into query."); } // parse order by clause for (int i = orderIndex + 2; i < words.Length; i++) { string item = words[i] .Replace(",", "") .Trim(); // checking double column if (OrderBy.ContainsKey(item)) { throw new SelectCommandParse($"Double column [{item}] for ORDER clause into query."); } bool asc = true; if (i + 1 != words.Length) { string type = words[i + 1] .Replace(",", "") .ToLower() .Trim(); if (type == "desc") { asc = false; } i++; } OrderBy.Add(item, asc); } }
public override void ReadDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; if (ele.TryPathTo("EditorID", false, out subEle)) { if (EditorID == null) { EditorID = new SimpleSubrecord <String>(); } EditorID.ReadXML(subEle, master); } if (ele.TryPathTo("Name", false, out subEle)) { if (Name == null) { Name = new SimpleSubrecord <String>(); } Name.ReadXML(subEle, master); } if (ele.TryPathTo("Conditions", false, out subEle)) { if (Conditions == null) { Conditions = new List <Condition>(); } foreach (XElement e in subEle.Elements()) { Condition tempCTDA = new Condition(); tempCTDA.ReadXML(e, master); Conditions.Add(tempCTDA); } } if (ele.TryPathTo("Data", false, out subEle)) { if (Data == null) { Data = new RecipeData(); } Data.ReadXML(subEle, master); } if (ele.TryPathTo("Ingredients", false, out subEle)) { if (Ingredients == null) { Ingredients = new List <RecipeIngredient>(); } foreach (XElement e in subEle.Elements()) { RecipeIngredient tempRCIL = new RecipeIngredient(); tempRCIL.ReadXML(e, master); Ingredients.Add(tempRCIL); } } if (ele.TryPathTo("Outputs", false, out subEle)) { if (Outputs == null) { Outputs = new List <RecipeOutput>(); } foreach (XElement e in subEle.Elements()) { RecipeOutput tempRCOD = new RecipeOutput(); tempRCOD.ReadXML(e, master); Outputs.Add(tempRCOD); } } }
public override void Initialize(IPlayerHandInformation info) { m_FullHouseCondition.Cards = info.Cards; Conditions.Add(m_FullHouseCondition); }
public void AddCondition(string fieldname, ConditionType conditionType, string value) { Conditions.Add(new Condition(fieldname, conditionType, value)); }
public void AddCondition(IExceptionMatch condition) { Conditions.Add(condition); }
// ========================================================= ADDERS public ITask AddCondition(ICondition condition) { Conditions.Add(condition); return(this); }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting() { // '// ADD YOUR ACTION CODE HERE ... StringBuilder sb = new StringBuilder(); try { #region Form oForm.SupportedModes = 1; oForm.Settings.EnableRowFormat = false; oForm.Settings.Enabled = false; oForm.AutoManaged = true; foreach (SAPbouiCOM.Item item in oForm.Items) { item.AffectsFormMode = false; } #endregion oForm.Items.Add("edtFORCUS", BoFormItemTypes.it_EDIT);//아이템 Enalbled = false 처리시 커서를 빈 텍스트 박스로 옴기기 위해 임시 아이템 추가 SAPbouiCOM.Item oItem = (SAPbouiCOM.Item)oForm.Items.Item("edtFORCUS"); oItem.Left = -100; oItem.Click(); oForm.DataSources.UserDataSources.Item("edtDOCDTF").Value = Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMM01"); oForm.DataSources.UserDataSources.Item("edtDOCDTT").Value = Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMMdd"); #region EditText //BP코드 #region BusinessPartner Conditions SAPbouiCOM.Conditions oCons = new Conditions(); ; SAPbouiCOM.Condition oCon = oCons.Add(); //oCon.Alias = "CardType"; //oCon.Operation = BoConditionOperation.co_EQUAL; //oCon.CondVal = "S";//공급업체 //oCon.Relationship = BoConditionRelationship.cr_AND; //oCon = oCons.Add(); oCon.Alias = "frozenFor"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtBPCDF", "CardCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtBPCDT", "CardCode", BoFormItemTypes.it_EDIT, oCons); //관리계정 #region ChartOfAccounts Conditions oCons = new Conditions(); ; oCon = oCons.Add(); //자산계정이이고 oCon.Alias = "Postable"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; oCon.Relationship = BoConditionRelationship.cr_AND; //기밀이 'N'이고 oCon = oCons.Add(); oCon.Alias = "Protected"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; //비활성이 'N' oCon = oCons.Add(); oCon.Alias = "FrozenFor"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; //관리계정이이고 oCon = oCons.Add(); oCon.Alias = "LocManTran"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oChartOfAccounts).ToString(), "edtSHORTCD", "AcctCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oChartOfAccounts).ToString(), "edtSHORTNM", "AcctName", BoFormItemTypes.it_EDIT, oCons); #endregion #region ComboBox //사업장 FN.SetComboBoxValidValues(oForm, "SELECT BPLID,BPLName FROM [OBPL] ORDER BY 1 ASC", "cboBPLID", FN.Enum_WholeTp.m_Nothing); SAPbouiCOM.ComboBox oCombo = oForm.Items.Item("cboBPLID").Specific; if (oCombo.ValidValues.Count > 0) { string FirstComboValue = oCombo.ValidValues.Item(0).Value; oForm.DataSources.UserDataSources.Item("cboBPLID").Value = FirstComboValue; } #endregion } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting() { // ADD YOUR ACTION CODE HERE ... try { #region Form oForm.SupportedModes = -1; oForm.Settings.MatrixUID = "grd1"; oForm.Settings.EnableRowFormat = false;//서식설정 oForm.Settings.Enabled = false;//기본서식 oForm.AutoManaged = true; if (oForm.Mode != BoFormMode.fm_ADD_MODE && oForm.Mode != BoFormMode.fm_VIEW_MODE) { oForm.Mode = BoFormMode.fm_ADD_MODE; } oForm.DataBrowser.BrowseBy = "edtDOCNUM"; #endregion SAPbouiCOM.DBDataSource oKIS_SD0080T_HRD = oForm.DataSources.DBDataSources.Item("@KIS_SD0080T_HRD"); //문서번호 oKIS_SD0080T_HRD.SetValue("DocEntry", 0, FN.GetNextDocEntry("KIS_SD0080_HRD")); //전기일 oKIS_SD0080T_HRD.SetValue("U_DOCDT", 0, Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMMdd")); #region EditText //지급방법 FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oWizardPaymentMethods).ToString(), "edtPAYMCD", "PayMethCod", BoFormItemTypes.it_EDIT, null); FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oWizardPaymentMethods).ToString(), "edtPAYMNM", "Descript", BoFormItemTypes.it_EDIT, null); //담당부서 #region ProfitCenter Conditions SAPbouiCOM.Conditions oCons = new Conditions(); ; SAPbouiCOM.Condition oCon = oCons.Add(); oCon.Alias = "DimCode"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "1"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Locked"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Active"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCCD", "PrcCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCNM", "PrcName", BoFormItemTypes.it_EDIT, oCons); oCon = null; oCons = null; //매출처 #region BusinessPartner Conditions oCons = new Conditions(); ; oCon = oCons.Add(); oCon.Alias = "CardType"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "C";//고객 oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "frozenFor"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtCARDCD", "CardCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtCARDNM", "CardName", BoFormItemTypes.it_EDIT, oCons); //어음거래처 = 매출처 FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtBOEBPCD", "CardCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtBOEBPNM", "CardName", BoFormItemTypes.it_EDIT, oCons); //대행사 #region BusinessPartner Conditions oCons = new Conditions(); ; oCon = oCons.Add(); oCon.Alias = "CardType"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "S";//공급업체 oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "frozenFor"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtBPCD", "CardCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtBPNM", "CardName", BoFormItemTypes.it_EDIT, oCons); //입금계좌계정 #region ChartOfAccounts Conditions oCons = new Conditions(); ; oCon = oCons.Add(); //자산계정이이고 oCon.Alias = "Postable"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; oCon.Relationship = BoConditionRelationship.cr_AND; //기밀이 'N'이고 oCon = oCons.Add(); oCon.Alias = "Protected"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; //비활성이 'N' oCon = oCons.Add(); oCon.Alias = "FrozenFor"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oChartOfAccounts).ToString(), "edtIACCTCD", "AcctCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oChartOfAccounts).ToString(), "edtIACCTNM", "AcctName", BoFormItemTypes.it_EDIT, oCons); //지급계좌계정 FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oChartOfAccounts).ToString(), "edtPACCTCD", "AcctCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oChartOfAccounts).ToString(), "edtPACCTNM", "AcctName", BoFormItemTypes.it_EDIT, oCons); //수금계좌계정 #region ChartOfAccounts Conditions oCons = new Conditions(); ; oCon = oCons.Add(); //자산계정이이고 oCon.Alias = "Postable"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; oCon.Relationship = BoConditionRelationship.cr_AND; //기밀이 'N'이고 oCon = oCons.Add(); oCon.Alias = "Protected"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; //비활성이 'N' oCon = oCons.Add(); oCon.Alias = "FrozenFor"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; //관리계정이이고 oCon = oCons.Add(); oCon.Alias = "LocManTran"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oChartOfAccounts).ToString(), "edtPRACTCD", "AcctCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oChartOfAccounts).ToString(), "edtPRACTNM", "AcctName", BoFormItemTypes.it_EDIT, oCons); #endregion #region ComboBox //문서상태 SAPbouiCOM.ComboBox oCombo = oForm.Items.Item("cboSTATUS").Specific; FN.SetComboBoxValidValues(oForm, "SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SD04' ", "cboSTATUS", FN.Enum_WholeTp.m_Nothing); if (oCombo.ValidValues.Count > 0) { oForm.DataSources.UserDataSources.Item("cboSTATUS").Value = oCombo.ValidValues.Item(0).Value; } ////사업장 //oCombo = oForm.Items.Item("cboBPLID").Specific; //FN.SetComboBoxValidValues(oForm, "SELECT BPLID,BPLName FROM [OBPL] ORDER BY 1 ASC", "cboBPLID", FN.Enum_WholeTp.m_Nothing); //if (oCombo.ValidValues.Count > 0) //{ // oKIS_SD0080T_HRD.SetValue("U_BPLID", 0, oCombo.ValidValues.Item(0).Value); //} #endregion #region OptionBtn //수금유형 옵션버튼 정의 for (int iLooper = 1; iLooper <= 5; iLooper++) { SAPbouiCOM.OptionBtn oOption = oForm.Items.Item("optBILLTP" + iLooper.ToString()).Specific; if (iLooper > 1) { oOption.GroupWith("optBILLTP1"); } } for (int iLooper = 1; iLooper <= 5; iLooper++) { SAPbouiCOM.OptionBtn oOption = oForm.Items.Item("optBILLTP" + iLooper.ToString()).Specific; switch (iLooper) { case 1: oOption.ValOn = ((int)BillType.Deposit).ToString();//입금 break; case 2: oOption.ValOn = ((int)BillType.Prepaid).ToString();//선수금 break; case 3: oOption.ValOn = ((int)BillType.SubstituteDeposit).ToString();//대행료 대체입금 break; case 4: oOption.ValOn = ((int)BillType.Pay).ToString();//지급 break; default: break; } } oKIS_SD0080T_HRD.SetValue("U_BILLTP", 0, ((int)BillType.Deposit).ToString()); //지급유형 옵션버튼 정의 for (int iLooper = 1; iLooper <= 4; iLooper++) { SAPbouiCOM.OptionBtn oOption = oForm.Items.Item("optPAYTP" + iLooper.ToString()).Specific; if (iLooper > 1) { oOption.GroupWith("optPAYTP1"); } } for (int iLooper = 1; iLooper <= 4; iLooper++) { SAPbouiCOM.OptionBtn oOption = oForm.Items.Item("optPAYTP" + iLooper.ToString()).Specific; switch (iLooper) { case 1: oOption.ValOn = ((int) PayMethod.Cash).ToString();//현금 break; case 2: oOption.ValOn = ((int) PayMethod.BankTransfer).ToString();//은행이체 break; case 3: oOption.ValOn = ((int) PayMethod.BillOfExchange).ToString();//어음 break; case 4: oOption.ValOn = ((int)PayMethod.Virement).ToString();//대체 break; default: break; } } oKIS_SD0080T_HRD.SetValue("U_PAYTP", 0, ((int)PayMethod.BankTransfer).ToString()); #endregion //문서상태 정의 SetcboSTATUS(); #region SetAutoManagedAttribute System.Text.StringBuilder AllString = new System.Text.StringBuilder(); AllString.Append("cboSTATUS,edtBKCHAMT,edtBOEBPCD,edtBOEBPNM,edtBOEDT,edtBOENO,edtBPCD,edtBPNM,edtCARDCD,edtCARDNM,edtDOCDT"); AllString.Append(",edtDOCNUM,edtDOCTOT,edtIACCTCD,edtIACCTNM,edtMEMO,edtOPENAMT,edtPACCTCD,edtPACCTNM,edtPAYMCD,edtPAYMNM,edtPRCCD"); AllString.Append(",edtPRCNM,edtREMARK,edtSTORNO,edtTRANSID,grd1,optBILLTP1,optBILLTP2,optBILLTP3,optBILLTP4,optBILLTP5"); AllString.Append(",optPAYTP1,optPAYTP2,optPAYTP3,optPAYTP4"); AllString.Append(",edtPRACTCD,edtPRACTNM"); string FindString = AllString.ToString(); FN.SetAutoManagedAttribute(ref oForm, AllString.ToString(), BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_False); SetAutoManagedAttrivute_Add(); FN.SetAutoManagedAttribute(ref oForm, FindString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Find, BoModeVisualBehavior.mvb_True); AllString = null; #endregion #region Grid SAPbouiCOM.Grid oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd1").Specific; oGrid.SelectionMode = BoMatrixSelect.ms_NotSupported; Veiw_Grid1_DataTable(oForm); #endregion oKIS_SD0080T_HRD = null; } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } }
public DataFilter Where(Condition condition) { Conditions.Add(condition); return(this); }
public Pagination GetPagination(SignListParms slParms, PaggerParms pParms) { //string strCatalog = RepositoryFactory.PotalConn["Catalog"]; string strSQL = ""; switch (slParms.TABLE_ID) { case "01": strSQL = @"SELECT distinct class.clid CLID, class.clname CLNAME, class.start_date STARTDATE, class.hours HOURS, stu.sid SID, stu.sname SNAME, class.unitid UNITID, class.unitname UNITNAME, [sign].signdocid SIGNDOCID FROM rtclass class JOIN students stu ON class.clid = stu.clid LEFT OUTER JOIN (select distinct table_id from FORM_FORMAT)as F on 1=1 LEFT OUTER JOIN (select CLID,SID,TABLE_ID,count(*) as A_COUNT from( select CLID, SID, TABLE_ID, QNO, SERIAL_NO, DESCRIPTION ANS, EDIT_DATE, EDIT_PERSON from CHARACTER_ANSWER union select CLID, SID, TABLE_ID, QNO, SERIAL_NO,CONVERT(varchar, ANS) ANS, EDIT_DATE, EDIT_PERSON from NUMERIC_ANSWER) A group by CLID,SID,TABLE_ID) as count_ans on count_ans.CLID=class.CLID and count_ans.SID=stu.SID and count_ans.TABLE_ID=f.TABLE_ID LEFT OUTER JOIN form_sign [sign] ON [sign].clid = stu.clid and [sign].TABLE_ID=F.table_id and stu.sid=[sign].SID WHERE class.CLID NOT LIKE '9999%' and ((F.TABLE_ID=@TABLE_ID AND [sign].issigned = 'False' ) or (F.TABLE_ID=@TABLE_ID AND [sign].issigned is null )) and ISNULL(count_ans.A_COUNT,0)=0 {0}" ; break; case "02": string strCate = RepositoryFactory.PotalConn["Catelog"]; strSQL = String.Format(@"SELECT distinct class.clid CLID, class.clname CLNAME, class.start_date STARTDATE, class.hours HOURS, stu.sid SID, stu.sname SNAME, class.unitid UNITID, class.unitname UNITNAME, [sign].signdocid SIGNDOCID FROM rtclass class JOIN students stu ON class.clid = stu.clid LEFT OUTER JOIN (select distinct table_id from FORM_FORMAT)as F on 1=1 LEFT OUTER JOIN (select CLID,SID,TABLE_ID,count(*) as A_COUNT from( select CLID, SID, TABLE_ID, QNO, SERIAL_NO, DESCRIPTION ANS, EDIT_DATE, EDIT_PERSON from CHARACTER_ANSWER union select CLID, SID, TABLE_ID, QNO, SERIAL_NO,CONVERT(varchar, ANS) ANS, EDIT_DATE, EDIT_PERSON from NUMERIC_ANSWER) A group by CLID,SID,TABLE_ID) as count_ans on count_ans.CLID=class.CLID and count_ans.SID=stu.SID and count_ans.TABLE_ID=f.TABLE_ID LEFT OUTER JOIN form_sign [sign] ON [sign].clid = stu.clid and [sign].TABLE_ID=F.table_id and stu.sid=[sign].SID left OUTER join {0}..SignForm_Main Sign_M ON Sign_M.SignDocID=[sign].SignDocID WHERE class.CLID NOT LIKE '9999%' and ((F.TABLE_ID=@TABLE_ID AND [sign].issigned = 'False' ) or (F.TABLE_ID=@TABLE_ID AND [sign].issigned is null )) and ISNULL(Sign_M.FinalStatus,0) not in (2,3,4,6) and ISNULL(count_ans.A_COUNT,0)=0", strCate); strSQL = strSQL + "{0}"; break; case "03": string strCatelog = RepositoryFactory.PotalConn["Catelog"]; strSQL = String.Format(@"SELECT distinct class.clid CLID, class.clname CLNAME, class.start_date STARTDATE, class.hours HOURS, stu.sid SID, stu.sname SNAME, class.unitid UNITID, class.unitname UNITNAME, [sign].signdocid SIGNDOCID FROM rtclass class JOIN students stu ON class.clid = stu.clid JOIN {0}..Employee Emp ON stu.sid = Emp.EmployeeID JOIN {0}..Department Dept ON Emp.DepartmentID_FK = Dept.DepartmentID LEFT OUTER JOIN (select distinct table_id from FORM_FORMAT)as F on 1=1 LEFT OUTER JOIN (select CLID,SID,TABLE_ID,count(*) as A_COUNT from( select CLID, SID, TABLE_ID, QNO, SERIAL_NO, DESCRIPTION ANS, EDIT_DATE, EDIT_PERSON from CHARACTER_ANSWER union select CLID, SID, TABLE_ID, QNO, SERIAL_NO,CONVERT(varchar, ANS) ANS, EDIT_DATE, EDIT_PERSON from NUMERIC_ANSWER) A group by CLID,SID,TABLE_ID) as count_ans on count_ans.CLID=class.CLID and count_ans.SID=stu.SID and count_ans.TABLE_ID=f.TABLE_ID LEFT OUTER JOIN form_sign [sign] ON [sign].clid = stu.clid and [sign].TABLE_ID=F.table_id and stu.sid=[sign].SID WHERE class.CLID NOT LIKE '9999%' and ((F.TABLE_ID=@TABLE_ID AND [sign].issigned = 'False' ) or (F.TABLE_ID=@TABLE_ID AND [sign].issigned is null )) and ISNULL(count_ans.A_COUNT,0)=0", strCatelog); strSQL = strSQL + "{0}"; break; default: throw new Exception("無此問卷代號!"); } #region 備份SQL // if (slParms.TABLE_ID=="02") // { // strSQL = @"SELECT distinct // class.clid CLID, // class.clname CLNAME, // class.start_date STARTDATE, // class.hours HOURS, // stu.sid SID, // stu.sname SNAME, // class.unitid UNITID, // class.unitname UNITNAME, // [sign].signdocid SIGNDOCID // FROM rtclass class // JOIN students stu // ON class.clid = stu.clid // LEFT OUTER JOIN (select distinct table_id from FORM_FORMAT)as F on 1=1 // LEFT OUTER JOIN form_sign [sign] // ON [sign].clid = stu.clid and [sign].TABLE_ID=F.table_id and stu.sid=[sign].SID // left OUTER join RinnaiPortal..SignForm_Main Sign_M ON Sign_M.SignDocID=[sign].SignDocID // WHERE class.CLID NOT LIKE '9999%' and ((F.TABLE_ID=@TABLE_ID AND [sign].issigned = 'False' ) or (F.TABLE_ID=@TABLE_ID AND [sign].issigned is null )) and ISNULL(Sign_M.FinalStatus,0) not in (2,3) // {0}"; // } // else if (slParms.TABLE_ID == "03") // { // string strCatelog = RepositoryFactory.PotalConn["Catelog"]; // strSQL = String.Format(@"SELECT distinct // class.clid CLID, // class.clname CLNAME, // class.start_date STARTDATE, // class.hours HOURS, // stu.sid SID, // stu.sname SNAME, // class.unitid UNITID, // class.unitname UNITNAME, // [sign].signdocid SIGNDOCID // FROM rtclass class // JOIN students stu // ON class.clid = stu.clid // JOIN {0}..Employee Emp // ON stu.sid = Emp.EmployeeID // JOIN {0}..Department Dept // ON Emp.DepartmentID_FK = Dept.DepartmentID // LEFT OUTER JOIN (select distinct table_id from FORM_FORMAT)as F on 1=1 // LEFT OUTER JOIN form_sign [sign] // ON [sign].clid = stu.clid and [sign].TABLE_ID=F.table_id and stu.sid=[sign].SID // WHERE class.CLID NOT LIKE '9999%' and ((F.TABLE_ID=@TABLE_ID AND [sign].issigned = 'False' ) or (F.TABLE_ID=@TABLE_ID AND [sign].issigned is null ))", strCatelog); // strSQL = strSQL + "{0}"; // } // else // { // strSQL = @"SELECT distinct // class.clid CLID, // class.clname CLNAME, // class.start_date STARTDATE, // class.hours HOURS, // stu.sid SID, // stu.sname SNAME, // class.unitid UNITID, // class.unitname UNITNAME, // [sign].signdocid SIGNDOCID // FROM rtclass class // JOIN students stu // ON class.clid = stu.clid // LEFT OUTER JOIN (select distinct table_id from FORM_FORMAT)as F on 1=1 // LEFT OUTER JOIN form_sign [sign] // ON [sign].clid = stu.clid and [sign].TABLE_ID=F.table_id and stu.sid=[sign].SID // WHERE class.CLID NOT LIKE '9999%' and ((F.TABLE_ID=@TABLE_ID AND [sign].issigned = 'False' ) or (F.TABLE_ID=@TABLE_ID AND [sign].issigned is null )) // {0}"; // } #endregion 備份SQL string strConditions = string.Empty; Conditions conditionsDic = new Conditions() { //{ "@SID", slParms.Member.EmployeeID }, { "@TABLE_ID", slParms.TABLE_ID } }; //組成查詢條件 SQL if (slParms.TABLE_ID == "03") { if (!String.IsNullOrWhiteSpace(slParms.QueryText)) { conditionsDic.Add("@queryText", String.Format("{0}", slParms.QueryText.Trim())); strConditions = String.Format("AND (class.CLID=@queryText OR stu.sid = @queryText)"); //conditionsDic.Add("@ChiefID", String.Format("{0}", slParms.Member.EmployeeID.Trim())); //strConditions += String.Format("AND Dept.ChiefID_FK = @ChiefID"); } //else //{ conditionsDic.Add("@ChiefID", String.Format("{0}", slParms.Member.EmployeeID.Trim())); strConditions += String.Format("AND Dept.ChiefID_FK = @ChiefID"); //} } else { if (!String.IsNullOrWhiteSpace(slParms.QueryText)) { conditionsDic.Add("@queryText", String.Format("{0}", slParms.QueryText.Trim())); strConditions = String.Format("AND (class.CLID=@queryText OR stu.sid = @queryText)"); } else { conditionsDic.Add("@SID", String.Format("{0}", slParms.Member.EmployeeID.Trim())); strConditions = String.Format("AND stu.sid = @SID"); } } //#0001 2017-07-19 by 俊晨 開課日期 < 2017/7/1的資料因不簽核故不顯示(經理指示)。 //#0019 受訓心得報告不顯示B10,C01,A09 的課程代碼 //#0023 主管成效評核追縱維護新增時不顯示B10 ,C01,A09 的課程代碼 by 淑娟 原slParms.TABLE_ID == "02"增加slParms.TABLE_ID == "03" strSQL += " and class.START_DATE >= '2017-07-01' "; if (slParms.TABLE_ID == "02" || slParms.TABLE_ID == "03") { strSQL += " and class.CTID not in ('B10','C01','A09') "; } var paginationParms = new PaginationParms() { QueryString = String.Format(strSQL, strConditions), QueryConditions = conditionsDic, PageIndex = pParms.PageIndex, PageSize = pParms.PageSize }; string orderExpression = String.Format("{0}{1}", pParms.Descending ? "-" : "", pParms.OrderField); var allowColumns = new List <string> { "CLID", "CLNAME", "STARTDATE", "HOURS", "SID", "SNAME", "UNITID", "UNITNAME", "SIGNDOCID", }; Pagination resultPagination = _dc.QueryForPagination(paginationParms, orderExpression, allowColumns); #region #0010 增加判斷評核表不該出現受訓心得未填寫之學員 //增加判斷未填寫受訓心得不該出現在評核列表上 if (slParms.TABLE_ID == "03") { Dictionary <string, string> delDataIdentify = new Dictionary <string, string>(); int beforePageSize = paginationParms.PageSize; paginationParms.PageIndex = 1; paginationParms.PageSize = 99999; Pagination getResult = _dc.QueryForPagination(paginationParms, orderExpression, allowColumns); if (resultPagination.Data != null) { var filterData = getResult.Data.Rows.Cast <DataRow>().ToList(); string queryHasFeedbackSQL = @" SELECT distinct class.clid CLID, class.clname CLNAME, class.start_date STARTDATE, class.hours HOURS, stu.sid SID, stu.sname SNAME, class.unitid UNITID, class.unitname UNITNAME, [sign].signdocid SIGNDOCID FROM rtclass class JOIN students stu ON class.clid = stu.clid LEFT OUTER JOIN (select distinct table_id from FORM_FORMAT)as F on 1=1 LEFT OUTER JOIN (select CLID,SID,TABLE_ID,count(*) as A_COUNT from( select CLID, SID, TABLE_ID, QNO, SERIAL_NO, DESCRIPTION ANS, EDIT_DATE, EDIT_PERSON from CHARACTER_ANSWER union select CLID, SID, TABLE_ID, QNO, SERIAL_NO,CONVERT(varchar, ANS) ANS, EDIT_DATE, EDIT_PERSON from NUMERIC_ANSWER) A group by CLID,SID,TABLE_ID) as count_ans on count_ans.CLID=class.CLID and count_ans.SID=stu.SID and count_ans.TABLE_ID=f.TABLE_ID LEFT OUTER JOIN form_sign [sign] ON [sign].clid = stu.clid and [sign].TABLE_ID=F.table_id and stu.sid=[sign].SID left OUTER join RinnaiPortal_Formal..SignForm_Main Sign_M ON Sign_M.SignDocID=[sign].SignDocID WHERE class.CLID NOT LIKE '9999%' and ((F.TABLE_ID=@TABLE_ID AND [sign].issigned = 'False' ) or (F.TABLE_ID=@TABLE_ID AND [sign].issigned is null )) and ISNULL(Sign_M.FinalStatus,0) not in (2,3,4,6) and ISNULL(count_ans.A_COUNT,0)=0AND stu.sid = @SID and class.START_DATE >= '2017-07-01' AND class.CLID = @CLID "; foreach (DataRow data in filterData) { string studentID = data["SID"].ToString(); string classID = data["CLID"].ToString(); Conditions conditionsDicForQueryHasAns = new Conditions(); conditionsDicForQueryHasAns.Add("@TABLE_ID", "02"); conditionsDicForQueryHasAns.Add("@SID", String.Format("{0}", studentID)); conditionsDicForQueryHasAns.Add("@CLID", String.Format("{0}", classID)); //var paginationParmsForQueryHasAns = new PaginationParms() //{ // QueryString = StudyOpinionFeedbackSQL, // QueryConditions = conditionsDicForQueryHasAns, // PageIndex = pParms.PageIndex, // PageSize = pParms.PageSize //}; DataRow result = _dc.QueryForDataRow(queryHasFeedbackSQL, conditionsDicForQueryHasAns); //!= null為受訓心得尚未填寫 不可呈現於列表 if (result != null) { delDataIdentify[classID] = studentID; } } //刪除未填寫受訓心得的條件 foreach (var di in delDataIdentify) { try { var query = getResult.Data.AsEnumerable().Where(r => r.Field <string>("CLID") == di.Key && r.Field <string>("SID") == di.Value); foreach (var row in query.ToList()) { getResult.Data.Rows.Remove(row); } } catch (Exception ex) { throw ex; } } if (getResult.Data.Rows.Count > 0) { int startRow = (pParms.PageIndex - 1) * beforePageSize; Pagination pagination = new Pagination(getResult.Data, getResult.Data.Rows.Count, pParms.PageIndex); pagination.Data = pagination.Data.Rows.Cast <DataRow>().Skip(startRow).Take(beforePageSize).CopyToDataTable(); resultPagination = pagination; } else { resultPagination.Data = null; } } } #endregion #0010 增加判斷評核表不該出現受訓心得未填寫之學員 //根據 SQL取得 Pagination return(resultPagination); }
public TalkNode(string path) { Log.Debug($"Parsing node {path}", Plugin.Instance.Config.VerboseOutput); NodeFile = path; try { var input = new StringReader(File.ReadAllText(path)); var deserializer = new DeserializerBuilder() .WithNamingConvention(CamelCaseNamingConvention.Instance) // Workaround to remove YamlAttributesTypeInspector .WithTypeInspector(inner => inner, s => s.InsteadOf <YamlAttributesTypeInspector>()) .WithTypeInspector( inner => new YamlAttributesTypeInspector(inner), s => s.Before <NamingConventionTypeInspector>() ) .Build(); TalkNodeSerializationInfo raw_node = deserializer.Deserialize <TalkNodeSerializationInfo>(input); Desc = raw_node.Description; Reply = raw_node.Reply; //Parse conditions //Format: //------------ //conditions: // - token: SomeToken // args: // some_arg: some_value // some_arg1: some_value1 foreach (NpcNodeWithArgsSerializationInfo info in raw_node.Conditions) { NodeCondition cond = NodeCondition.GetFromToken(info.Token); if (cond != null) { Log.Debug($"Recognized token: {cond.Name}", Plugin.Instance.Config.VerboseOutput); Conditions.Add(cond, info.Args); } else { Log.Error($"Failed to parse condition: {info.Token} (invalid token)"); } } //Parse actions //Format: //------------ //actions: // - token: SomeToken // args: // some_arg: some_value // some_arg1: some_value1 foreach (NpcNodeWithArgsSerializationInfo info in raw_node.Actions) { NodeAction cond = NodeAction.GetFromToken(info.Token); if (cond != null) { Log.Debug($"Recognized token: {cond.Name}", Plugin.Instance.Config.VerboseOutput); Actions.Add(cond, info.Args); } else { Log.Error($"Failed to parse action: {info.Token} (invalid token)"); } } //Parse next nodes //Format: //------------ //next_nodes: // - /relative/path/to/node Log.Debug("Parsing next nodes...", Plugin.Instance.Config.VerboseOutput); foreach (string item in raw_node.NextNodes) { NextNodes.Add(TalkNode.FromFile(Path.Combine(Config.NPCs_nodes_path, item))); } } catch (Exception e) { Log.Error($"Failed to parse node {path}! {e}"); this.Desc = "<ERROR>"; this.Reply = "<ERROR>"; } }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting() { // '// ADD YOUR ACTION CODE HERE ... StringBuilder sb = new StringBuilder(); try { #region Form oForm.SupportedModes = 1; oForm.Settings.EnableRowFormat = false; oForm.Settings.Enabled = false; oForm.AutoManaged = false; foreach (SAPbouiCOM.Item item in oForm.Items) { item.AffectsFormMode = false; } #endregion #region EditText //코스트센터 #region ProfitCenter Conditions SAPbouiCOM.Conditions oCons = new Conditions(); ; SAPbouiCOM.Condition oCon = oCons.Add(); oCon.Alias = "DimCode"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "1"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Locked"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Active"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCCD", "PrcCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCNM", "PrcName", BoFormItemTypes.it_EDIT, oCons); oForm.DataSources.UserDataSources.Item("edtPRCCD").Value = FN.GetRecordsetValue("SELECT PrcCode FROM dbo.OPRC WHERE PrcCode = (SELECT TOP 1 U_RMK1 FROM [dbo].[@KIS_AD00201] WHERE Code = 'TR03' AND U_SMLCD = 'UPRCCD')"); ; oForm.DataSources.UserDataSources.Item("edtPRCNM").Value = FN.GetRecordsetValue("SELECT PrcName FROM dbo.OPRC WHERE PrcCode = (SELECT TOP 1 U_RMK1 FROM [dbo].[@KIS_AD00201] WHERE Code = 'TR03' AND U_SMLCD = 'UPRCCD')"); ; //출금계좌 #region HouseBankAccounts #endregion FN.SetChooseFromListAdd(oForm, ((int)BoObjectTypes.oHouseBankAccounts).ToString(), "edtACCOUNT", "Account", BoFormItemTypes.it_EDIT, null); //출금계좌 기본값 설정 oForm.DataSources.UserDataSources.Item("edtACCOUNT").Value = FN.GetRecordsetValue("SELECT Account FROM dbo.DSC1 WHERE Account = (SELECT TOP 1 U_RMK1 FROM [dbo].[@KIS_AD00201] WHERE Code = 'TR03' AND U_SMLCD = 'UACCOUNT')"); #endregion #region ComboBox //사업장 FN.SetComboBoxValidValues(oForm, "SELECT BPLID,BPLName FROM [OBPL] ORDER BY 1 ASC", "cboBPLID", FN.Enum_WholeTp.m_Nothing); SAPbouiCOM.ComboBox oCombo = oForm.Items.Item("cboBPLID").Specific; if (oCombo.ValidValues.Count > 0) { string FirstComboValue = oCombo.ValidValues.Item(0).Value; oForm.DataSources.UserDataSources.Item("cboBPLID").Value = FirstComboValue; } //지급처리상태 FN.SetComboBoxValidValues(oForm, "SELECT U_CD,U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'TR05' AND U_USEYN = 'Y'", "cboSTATUS", FN.Enum_WholeTp.m_TotalTxt); //이체상태 FN.SetComboBoxValidValues(oForm, "SELECT U_CD,U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'TR04' AND U_USEYN = 'Y'", "cboPROC", FN.Enum_WholeTp.m_TotalTxt); //대량이체 파일 유형 FN.SetComboBoxValidValues(oForm, "SELECT U_RMK1,U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'TR06' AND U_USEYN = 'Y'", "cboFILETP", FN.Enum_WholeTp.m_TotalTxt); #endregion SAPbouiCOM.Item oItem = oForm.Items.Item("sttBPLID"); oItem.TextStyle = (int)BoTextStyle.ts_BOLD; oItem = oForm.Items.Item("sttACCOUNT"); oItem.TextStyle = (int)BoTextStyle.ts_BOLD; } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } }
public DataSet UpdatePart(DataSet reqDS) { DataSet resDS = new DataSet(); if (reqDS != null && reqDS.Tables.Contains(EMS_EQUIPMENT_PARTS_FIELDS.DATABASE_TABLE_NAME) && reqDS.ExtendedProperties.ContainsKey(PARAMETERS.INPUT_KEY) && reqDS.ExtendedProperties.ContainsKey(PARAMETERS.INPUT_EDITOR) && reqDS.ExtendedProperties.ContainsKey(PARAMETERS.INPUT_EDIT_TIME)) { DataTable partsDataTable = reqDS.Tables[EMS_EQUIPMENT_PARTS_FIELDS.DATABASE_TABLE_NAME]; string partKey = reqDS.ExtendedProperties[PARAMETERS.INPUT_KEY].ToString(); string editor = reqDS.ExtendedProperties[PARAMETERS.INPUT_EDITOR].ToString(); string editTime = reqDS.ExtendedProperties[PARAMETERS.INPUT_EDIT_TIME].ToString(); if (partsDataTable.Rows.Count > 0) { string partName = partsDataTable.Rows[0][EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_NAME].ToString(); try { EMS_EQUIPMENT_PARTS_FIELDS partsFields = new EMS_EQUIPMENT_PARTS_FIELDS(); #region Build Update SQL Conditions Conditions conditions = new Conditions(); Condition condition; if (string.IsNullOrEmpty(partKey)) { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_KEY, GlobalEnums.DatabaseCompareOperator.Null, string.Empty); } else { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_KEY, GlobalEnums.DatabaseCompareOperator.Equal, partKey); } conditions.Add(condition); if (string.IsNullOrEmpty(editor)) { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EDITOR, GlobalEnums.DatabaseCompareOperator.Null, string.Empty); } else { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EDITOR, GlobalEnums.DatabaseCompareOperator.Equal, editor); } conditions.Add(condition); if (string.IsNullOrEmpty(editTime)) { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EDIT_TIME, GlobalEnums.DatabaseCompareOperator.Null, string.Empty); } else { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EDIT_TIME, GlobalEnums.DatabaseCompareOperator.Equal, editTime); } conditions.Add(condition); List <Conditions> conditionsList = new List <Conditions>() { conditions }; #endregion List <string> sqlStringList = DatabaseTable.BuildUpdateSqlStatements(partsFields, partsDataTable, conditionsList); string sqlString = string.Empty; if (sqlStringList.Count > 0) { sqlString = sqlStringList[0]; } using (DbConnection connection = db.CreateConnection()) { connection.Open(); using (DbTransaction transaction = connection.BeginTransaction()) { try { #region Validate Part Name if (!string.IsNullOrEmpty(partName)) { conditions = new Conditions(); conditions.Add(GlobalEnums.DatabaseLogicOperator.And, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_NAME, GlobalEnums.DatabaseCompareOperator.Equal, partName); conditions.Add(GlobalEnums.DatabaseLogicOperator.And, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_KEY, GlobalEnums.DatabaseCompareOperator.NotEqual, partKey); string returnData = AllCommonFunctions.GetSpecifyTableColumnData(partsFields, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_NAME, conditions, transaction); if (!string.IsNullOrEmpty(returnData)) { throw new Exception("备件名称已存在!"); } } #endregion #region Update Part Data if (db.ExecuteNonQuery(transaction, CommandType.Text, sqlString) > 0) { editTime = AllCommonFunctions.GetSpecifyTableColumnData(partsFields, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EDIT_TIME, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_KEY, partKey, transaction); } else { throw new Exception("数据处理失败,请重新刷新数据后再提交!"); } #endregion transaction.Commit(); } catch { transaction.Rollback(); throw; } finally { connection.Close(); } } } resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_MESSAGE, string.Empty); resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_EDIT_TIME, editTime); } catch (Exception ex) { resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_MESSAGE, ex.Message); LogService.LogError("UpdatePart Error: " + ex.Message); } } else { resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_MESSAGE, "提交数据不存在,请重新提交!"); } } else { resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_MESSAGE, "提交数据不存在,请重新提交!"); } return(resDS); }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting() { // '// ADD YOUR ACTION CODE HERE ... #region Form Setting oForm.DataBrowser.BrowseBy = "DocEntry"; oForm.SupportedModes = -1; oForm.Settings.EnableRowFormat = false; oForm.Settings.Enabled = false; oForm.AutoManaged = true; oForm.PaneLevel = 1; #endregion oForm.Mode = BoFormMode.fm_ADD_MODE; oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_FI0010M_HRD"); oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_FI00101_HRD"); string strNowDate = B1Connections.diCompany.GetCompanyDate().ToShortDateString(); strNowDate = FN.SetDateFormatToDB(strNowDate, FN.eDateType.p_YYYYMMDD); oDB_M.SetValue("U_DOCDATE", 0, strNowDate.Replace(".", "")); oDB_M.SetValue("U_USERID", 0, B1Connections.theAppl.Company.UserName); oComboBox = oForm.Items.Item("cboYYYY").Specific; FN.SetComboBoxValidValues(oForm, " SELECT YEAR AS CODE, YEAR AS NAME FROM OACP ", "cboYYYY", FN.Enum_WholeTp.m_Nothing); oComboBox.Select(FN.Left(strNowDate,4) , BoSearchKey.psk_ByValue); oComboBox = oForm.Items.Item("cboTYPE").Specific; FN.SetComboBoxValidValues(oForm, " SELECT U_SMLCD,U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'FI01' AND U_USEYN = 'Y' ", "cboTYPE", FN.Enum_WholeTp.m_Nothing); oComboBox.Select(0, BoSearchKey.psk_Index); #region EditText // 코스트센터그룹 SAPbouiCOM.Conditions oCons = new Conditions(); FN.SetChooseFromListAdd(oForm, "KIS_CO0110", "edtCOSTFR", "Code", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, "KIS_CO0110", "edtCOSTTO", "Code", BoFormItemTypes.it_EDIT, oCons); // 공통비 코스트센터 그룹 FN.SetChooseFromListAdd(oForm, "KIS_CO0110", "edtCOMGPCD", "Code", BoFormItemTypes.it_EDIT, oCons); // 원가그룹 FN.SetChooseFromListAdd(oForm, "KIS_CO0100", "edtDISACCD", "Code", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, "KIS_CO0100", "edtCOPECD", "Code", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, "KIS_CO0100", "edtCOAMCD", "Code", BoFormItemTypes.it_EDIT, oCons); // 계정코드 #region GLAccounts Conditions oCons = new Conditions(); SAPbouiCOM.Condition oCon = oCons.Add(); oCon.Alias = "U_CATEGORY"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "S09"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_GLAccounts).ToString(), "edtCOMPECD", "AcctCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_GLAccounts).ToString(), "edtCOMAMCD", "AcctCode", BoFormItemTypes.it_EDIT, oCons); #endregion #region Matrix oMatrix = oForm.Items.Item("mtx").Specific; oMatrix.SelectionMode = BoMatrixSelect.ms_None; // 메트릭스 FN.SetChooseFromListAdd(oForm, "KIS_CO0110", "mtx", "Code", BoFormItemTypes.it_MATRIX, null, "U_PRCCD"); FN.SetSumField(ref oMatrix, "U_1MON,U_2MON,U_3MON,U_4MON,U_5MON,U_6MON,U_7MON,U_8MON,U_9MON,U_10MON,U_11MON,U_12MON"); //FN.SetMatrixAddRow(ref oForm, ref oMatrix, ref oDB_1, FN.RowSelectMode.SelectedLine, "U_PRCCD"); #endregion #region SetAutoManagedAttribute string AllString = "cboYYYY,cboTYPE,edtCOMGPCD,edtDISACCD,edtCOPECD,edtCOAMCD,edtCOMPECD,edtCOMAMCD,mtx,btnFIND"; string AddString = "cboYYYY,cboTYPE,edtCOMGPCD,edtDISACCD,edtCOPECD,edtCOAMCD,mtx,btnFIND"; string OKString = "edtCOMGPCD,edtDISACCD,edtCOPECD,edtCOAMCD,mtx,btnFIND"; string FindString = "cboYYYY,cboTYPE"; FN.SetAutoManagedAttribute(ref oForm, AllString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_False); FN.SetAutoManagedAttribute(ref oForm, AddString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Add, BoModeVisualBehavior.mvb_True); FN.SetAutoManagedAttribute(ref oForm, OKString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True); FN.SetAutoManagedAttribute(ref oForm, FindString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Find, BoModeVisualBehavior.mvb_True); #endregion }
public DataSet GetParts(DataSet reqDS) { DataSet resDS = new DataSet(); int pages = 0; int records = 0; if (reqDS != null && reqDS.ExtendedProperties.ContainsKey(PARAMETERS.INPUT_KEY) && reqDS.ExtendedProperties.ContainsKey(PARAMETERS.INPUT_PAGENO) && reqDS.ExtendedProperties.ContainsKey(PARAMETERS.INPUT_PAGESIZE)) { string partName = reqDS.ExtendedProperties[PARAMETERS.INPUT_KEY].ToString(); int pageNo = Convert.ToInt32(reqDS.ExtendedProperties[PARAMETERS.INPUT_PAGENO]); int pageSize = Convert.ToInt32(reqDS.ExtendedProperties[PARAMETERS.INPUT_PAGESIZE]); try { EMS_EQUIPMENT_PARTS_FIELDS partsFields = new EMS_EQUIPMENT_PARTS_FIELDS(); List <string> interestColumns = new List <string>(); interestColumns.Add(EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_KEY); interestColumns.Add(EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_NAME); interestColumns.Add(EMS_EQUIPMENT_PARTS_FIELDS.FIELD_DESCRIPTION); interestColumns.Add(EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_TYPE); interestColumns.Add(EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_MODE); interestColumns.Add(EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_UNIT); interestColumns.Add(EMS_EQUIPMENT_PARTS_FIELDS.FIELD_CREATOR); interestColumns.Add(EMS_EQUIPMENT_PARTS_FIELDS.FIELD_CREATE_TIMEZONE_KEY); interestColumns.Add(EMS_EQUIPMENT_PARTS_FIELDS.FIELD_CREATE_TIME); interestColumns.Add(EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EDITOR); interestColumns.Add(EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EDIT_TIMEZONE_KEY); interestColumns.Add(EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EDIT_TIME); Conditions conditions = new Conditions(); if (!string.IsNullOrEmpty(partName)) { conditions.Add(GlobalEnums.DatabaseLogicOperator.And, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_NAME, GlobalEnums.DatabaseCompareOperator.Like, string.Format("%{0}%", partName)); } string sqlString = DatabaseTable.BuildQuerySqlStatement(partsFields, interestColumns, conditions); if (pageNo > 0 && pageSize > 0) { AllCommonFunctions.CommonPagingData(sqlString, pageNo, pageSize, out pages, out records, db, resDS, EMS_EQUIPMENT_PARTS_FIELDS.DATABASE_TABLE_NAME); } else { db.LoadDataSet(CommandType.Text, sqlString, resDS, new string[] { EMS_EQUIPMENT_PARTS_FIELDS.DATABASE_TABLE_NAME }); } resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_MESSAGE, string.Empty); resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_PAGES, pages); resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_RECORDS, records); } catch (Exception ex) { resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_MESSAGE, ex.Message); LogService.LogError("GetParts Error: " + ex.Message); } } else { resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_MESSAGE, "提交数据不存在,请重新提交!"); } return(resDS); }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting(SAPbouiCOM.Form oForm) { // '// ADD YOUR ACTION CODE HERE ... oForm.Settings.EnableRowFormat = false; // UDO, 네비게이션 사용하지 않음 oForm.SupportedModes = 1; FN.SetOptionBtn(ref oForm, "optALL(A),optREAD(R),optCENT(C)", "optALL"); string strYYYYMM = FN.SetDateFormatToDB(DateTimeLibrary.FirstDayOfCurrentMonth(), FN.eDateType.n_YYYYMMDD).Substring(0, 6); // 청구년월 시작 oComboBox = oForm.Items.Item("cboREQYM_F").Specific; SO.SO_COMMON_HRD.SetComboValue_YearMonth(ref oComboBox, FN.Enum_WholeTp.m_Nothing, strYYYYMM); // 청구년월 종료 oComboBox = oForm.Items.Item("cboREQYM_T").Specific; SO.SO_COMMON_HRD.SetComboValue_YearMonth(ref oComboBox, FN.Enum_WholeTp.m_Nothing, strYYYYMM); // 계산서발행구분 FN.SetComboBoxValidValues(oForm, " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code ='SO15' AND U_SMLCD IN ('U0', 'U1', 'U3', 'U5') ", "cboBILLTP", FN.Enum_WholeTp.m_Space); #region 독자마스터 Condition SAPbouiCOM.Conditions oCons = new Conditions(); ; SAPbouiCOM.Condition oCon = oCons.Add(); oCon.Alias = "U_VATGRUP"; //계산서발행구분 oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "U0"; // 발행(전자) oCon.Relationship = BoConditionRelationship.cr_OR; oCon = oCons.Add(); oCon.Alias = "U_VATGRUP"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "U1"; // 발행(종이) oCon.Relationship = BoConditionRelationship.cr_OR; oCon = oCons.Add(); oCon.Alias = "U_VATGRUP"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "U3"; // 수기발행(선납) oCon.Relationship = BoConditionRelationship.cr_OR; oCon = oCons.Add(); oCon.Alias = "U_VATGRUP"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "U5"; // 발행(전자타사) #endregion FN.SetChooseFromListAdd(oForm, "KIS_SO0030_HRD", "edtREAD_F", "Code", BoFormItemTypes.it_EDIT, oCons, "edtREAD_F"); FN.SetChooseFromListAdd(oForm, "KIS_SO0030_HRD", "edtREAD_T", "Code", BoFormItemTypes.it_EDIT, oCons, "edtREAD_T"); #region 지국마스터 Condition oCons = new Conditions(); ; oCon = oCons.Add(); oCon.Alias = "U_BILLGBN"; //계산서발행구분 oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "U0"; // 발행(전자) oCon.Relationship = BoConditionRelationship.cr_OR; oCon = oCons.Add(); oCon.Alias = "U_BILLGBN"; // 발행(종이) oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "U1"; oCon.Relationship = BoConditionRelationship.cr_OR; oCon = oCons.Add(); oCon.Alias = "U_BILLGBN"; // 발행(종이) oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "U3"; oCon.Relationship = BoConditionRelationship.cr_OR; oCon = oCons.Add(); oCon.Alias = "U_BILLGBN"; // 발행(종이) oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "U5"; #endregion FN.SetChooseFromListAdd(oForm, "KIS_SO0040_HRD", "edtCENT_F", "Code", BoFormItemTypes.it_EDIT, oCons, "edtCENT_F"); FN.SetChooseFromListAdd(oForm, "KIS_SO0040_HRD", "edtCENT_T", "Code", BoFormItemTypes.it_EDIT, oCons, "edtCENT_T"); SetGridTitle(oForm); SAPbouiCOM.Item oItem = oForm.Items.Item("fld01"); oItem.Click(); }
public DataSet DeletePart(DataSet reqDS) { DataSet resDS = new DataSet(); if (reqDS != null && reqDS.ExtendedProperties.ContainsKey(PARAMETERS.INPUT_KEY) && reqDS.ExtendedProperties.ContainsKey(PARAMETERS.INPUT_EDITOR) && reqDS.ExtendedProperties.ContainsKey(PARAMETERS.INPUT_EDIT_TIME)) { string partKey = reqDS.ExtendedProperties[PARAMETERS.INPUT_KEY].ToString(); string editor = reqDS.ExtendedProperties[PARAMETERS.INPUT_EDITOR].ToString(); string editTime = reqDS.ExtendedProperties[PARAMETERS.INPUT_EDIT_TIME].ToString(); try { EMS_EQUIPMENT_PARTS_FIELDS partsFields = new EMS_EQUIPMENT_PARTS_FIELDS(); #region Build Delete SQL Conditions Conditions conditions = new Conditions(); Condition condition; if (string.IsNullOrEmpty(partKey)) { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_KEY, GlobalEnums.DatabaseCompareOperator.Null, string.Empty); } else { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EQUIPMENT_PART_KEY, GlobalEnums.DatabaseCompareOperator.Equal, partKey); } conditions.Add(condition); if (string.IsNullOrEmpty(editor)) { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EDITOR, GlobalEnums.DatabaseCompareOperator.Null, string.Empty); } else { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EDITOR, GlobalEnums.DatabaseCompareOperator.Equal, editor); } conditions.Add(condition); if (string.IsNullOrEmpty(editTime)) { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EDIT_TIME, GlobalEnums.DatabaseCompareOperator.Null, string.Empty); } else { condition = new Condition(GlobalEnums.DatabaseLogicOperator.And, EMS_EQUIPMENT_PARTS_FIELDS.FIELD_EDIT_TIME, GlobalEnums.DatabaseCompareOperator.Equal, editTime); } conditions.Add(condition); List <Conditions> conditionsList = new List <Conditions>() { conditions }; #endregion List <string> sqlStringList = DatabaseTable.BuildDeleteSqlStatements(partsFields, conditionsList); string sqlString = string.Empty; if (sqlStringList.Count > 0) { sqlString = sqlStringList[0]; } #region Validate Equipment Task Reference #endregion #region Delete Part Data if (db.ExecuteNonQuery(CommandType.Text, sqlString) > 0) { resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_MESSAGE, string.Empty); } else { throw new Exception("数据处理失败,请重新刷新数据后再提交!"); } #endregion } catch (Exception ex) { resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_MESSAGE, ex.Message); LogService.LogError("DeletePart Error: " + ex.Message); } } else { resDS.ExtendedProperties.Add(PARAMETERS.OUTPUT_MESSAGE, "提交数据不存在,请重新提交!"); } return(resDS); }
private void SetConditions_ACCTCD(ItemEvent pVal) { SAPbouiCOM.ChooseFromList oCFL; SAPbouiCOM.IChooseFromListEvent oCFLEvento = (SAPbouiCOM.IChooseFromListEvent)pVal; SAPbouiCOM.ChooseFromListCreationParams oCFLCreationParams; SAPbouiCOM.Conditions oCons = new SAPbouiCOM.Conditions(); SAPbouiCOM.Condition oCon; try { oCFLCreationParams = (SAPbouiCOM.ChooseFromListCreationParams)B1Connections.theAppl.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams); oCFL = oForm.ChooseFromLists.Item(oCFLEvento.ChooseFromListUID); oCons = new Conditions(); ; oCon = oCons.Add(); //자산계정이이고 oCon.Alias = "Postable"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; oCon.Relationship = BoConditionRelationship.cr_AND; //기밀이 'N'이고 oCon = oCons.Add(); oCon.Alias = "Protected"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; //비활성이 'N' oCon = oCons.Add(); oCon.Alias = "FrozenFor"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; //관리계정이이고 oCon = oCons.Add(); oCon.Alias = "LocManTran"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; oCFL.SetConditions(oCons); } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } finally { oCFL = null; oCFLEvento = null; oCFLCreationParams = null; oCons = null; oCon = null; } }
public override void Initialize(ArpsAward arpsAward) { Conditions.Add(new NominatorSameAsInitiator(arpsAward.NominatorSso, arpsAward.InitiatorSso)); }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting() { // '// ADD YOUR ACTION CODE HERE ... try { #region Form oForm.SupportedModes = -1; oForm.Settings.EnableRowFormat = false;//서식설정 oForm.Settings.Enabled = true;//기본서식 oForm.AutoManaged = true; oForm.Settings.MatrixUID = "mtx1"; if (oForm.Mode != BoFormMode.fm_ADD_MODE && oForm.Mode != BoFormMode.fm_VIEW_MODE) { oForm.Mode = BoFormMode.fm_ADD_MODE; } oForm.DataBrowser.BrowseBy = "edtDOCNUM"; #endregion SAPbouiCOM.DBDataSource oKIS_SD0030T = oForm.DataSources.DBDataSources.Item("@KIS_SD0030T_HRD"); SAPbouiCOM.DBDataSource oKIS_SD00301 = oForm.DataSources.DBDataSources.Item("@KIS_SD00301_HRD"); //문서번호 oKIS_SD0030T.SetValue("DocEntry",0,FN.GetNextDocEntry("KIS_SD0030_HRD")); //전기일 oKIS_SD0030T.SetValue("U_DOCDT", 0, Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMMdd")); #region EditText //매출부서 #region ProfitCenter Conditions SAPbouiCOM.Conditions oCons = new Conditions(); ; SAPbouiCOM.Condition oCon = oCons.Add(); oCon.Alias = "DimCode"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "1"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Locked"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Active"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCCD", "PrcCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtPRCNM", "PrcName", BoFormItemTypes.it_EDIT, oCons); oCon = null; oCons = null; //영업사원 #region SalesPersons Conditions oCons = new Conditions(); ; oCon = oCons.Add(); oCon.Alias = "Active"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "Locked"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_SalesEmployee).ToString(), "edtSLPCD", "SlpCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_SalesEmployee).ToString(), "edtSLPNM", "SlpName", BoFormItemTypes.it_EDIT, oCons); oCon = null; oCons = null; //매출처 #region BusinessPartner Conditions oCons = new Conditions(); ; oCon = oCons.Add(); oCon.Alias = "CardType"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "C"; oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "frozenFor"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtCARDCD", "CardCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtCARDNM", "CardName", BoFormItemTypes.it_EDIT, oCons); //실수주자 #region KIS_SD0010_HRD Conditions oCons = new Conditions(); ; oCon = oCons.Add(); oCon.Alias = "U_USEYN"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; #endregion FN.SetChooseFromListAdd(oForm, "KIS_SD0010_HRD", "edtORDERCD", "Code", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, "KIS_SD0010_HRD", "edtORDERNM", "Name", BoFormItemTypes.it_EDIT, oCons); //대행사 #region BusinessPartner Conditions oCons = new Conditions(); ; oCon = oCons.Add(); oCon.Alias = "CardType"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "S";//공급업체 oCon.Relationship = BoConditionRelationship.cr_AND; oCon = oCons.Add(); oCon.Alias = "frozenFor"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "N"; #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtBPCD", "CardCode", BoFormItemTypes.it_EDIT, oCons); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtBPNM", "CardName", BoFormItemTypes.it_EDIT, oCons); #endregion #region ComboBox //문서상태 SAPbouiCOM.ComboBox oCombo = oForm.Items.Item("cboSTATUS").Specific; FN.SetComboBoxValidValues(oForm, "SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SD04' ", "cboSTATUS", FN.Enum_WholeTp.m_Nothing); if (oCombo.ValidValues.Count > 0) { oForm.DataSources.UserDataSources.Item("cboSTATUS").Value = oCombo.ValidValues.Item(0).Value; } //간행물 FN.SetComboBoxValidValues(oForm, "SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SD01' ", "cboPUBLICA", FN.Enum_WholeTp.m_Space); oCombo = oForm.Items.Item("cboPUBLICA").Specific; if (oCombo.ValidValues.Count>0) { oKIS_SD0030T.SetValue("U_PUBLICA", 0, oCombo.ValidValues.Item(0).Value); } //사업장 oCombo = oForm.Items.Item("cboBPLID").Specific; FN.SetComboBoxValidValues(oForm, "SELECT BPLID,BPLName FROM [OBPL] ORDER BY 1 ASC", "cboBPLID", FN.Enum_WholeTp.m_Nothing); if (oCombo.ValidValues.Count > 0) { oKIS_SD0030T.SetValue("U_BPLID", 0, oCombo.ValidValues.Item(0).Value); } SetcboSTATUS(); #endregion #region Matrix oMatrix = oForm.Items.Item("mtx1").Specific; oMatrix.SelectionMode = BoMatrixSelect.ms_Single; #region ComboBox in Matrix //흑백/컬러 FN.SetComboBoxValidValues(oMatrix, "U_COLOR", "SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SD03' "); //청구방법 FN.SetComboBoxValidValues(oMatrix, "U_CLAIMTP", "SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SD02' "); //매출세금그룹 FN.SetComboBoxValidValues(oMatrix, "U_VATCD", "SELECT Code,Name FROM [OVTG] WHERE Category = 'O' AND Locked = 'N'"); //매입세금그룹 FN.SetComboBoxValidValues(oMatrix, "U_VATCDBP", "SELECT Code,Name FROM [OVTG] WHERE Category = 'I' AND Locked = 'N'"); #endregion #region KIS_SD0020_HRD Conditions oCons = new Conditions(); ; oCon = oCons.Add(); oCon.Alias = "U_USEYN"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "Y"; #endregion FN.SetChooseFromListAdd(oForm, "KIS_SD0020_HRD", "mtx1", "Code", BoFormItemTypes.it_MATRIX, oCons, "U_ITMGRPCD"); ////행추가 //FN.SetMatrixAddRow(ref oForm, ref oMatrix, ref oKIS_SD00301, FN.RowSelectMode.None, "U_ITMGRPCD"); //SetMatrixRowNumbering(oMatrix, "U_LINENUM"); //행 합계 필드설정 //FN.SetSumField(ref oMatrix, "U_AMT,U_VAT,U_LINETOT,U_OPENAMT,U_ORDERAMT,U_AMTBP,U_VATBP,U_VATCDBP,U_LINETOTB,U_OPENAMTB"); #endregion #region SetAutoManagedAttribute System.Text.StringBuilder AllString = new System.Text.StringBuilder(); AllString.AppendLine("cboPUBLICA,edtPRCCD,edtPRCNM,cboBPLID,edtSLPCD,edtSLPNM,edtCARDCD,edtCARDNM,edtORDERCD,edtORDERNM,edtORDERRA,edtBPCD,edtBPNM"); AllString.AppendLine(",edtBPRATE,edtDOCNUM,edtDOCDT,edtDUEDT,cboSTATUS,edtREMARK,edtAMTSUMB,edtVATSUMB,edtDOCTOTB,edtAMTSUM,edtVATSUM,edtDOCTOT,btnTARGET"); AllString.AppendLine(",edtPERSON,edtTEL,edtEMAIL"); //System.Text.StringBuilder OKString = new System.Text.StringBuilder(); //OKString.Append("cboPUBLICA,edtPRCCD,edtPRCNM,cboBPLID,edtSLPCD,edtSLPNM,edtORDERCD,edtORDERNM,edtORDERRA,edtBPCD,edtBPNM,"); //OKString.Append("edtBPRATE,edtDUEDT,edtREMARK"); System.Text.StringBuilder AddString = new System.Text.StringBuilder(); AddString.AppendLine("cboPUBLICA,edtPRCCD,edtPRCNM,cboBPLID,edtSLPCD,edtSLPNM,edtCARDCD,edtCARDNM,edtORDERCD,edtORDERNM,edtORDERRA,edtBPCD,edtBPNM"); AddString.AppendLine(",edtBPRATE,edtDOCDT,edtDUEDT,edtREMARK"); AddString.AppendLine(",edtPERSON,edtTEL,edtEMAIL"); System.Text.StringBuilder FindString = new System.Text.StringBuilder(); FindString.AppendLine("cboPUBLICA,edtPRCCD,edtPRCNM,cboBPLID,edtSLPCD,edtSLPNM,edtCARDCD,edtCARDNM,edtORDERCD,edtORDERNM,edtORDERRA,edtBPCD,edtBPNM"); FindString.AppendLine(",edtBPRATE,edtDOCNUM,edtDOCDT,edtDUEDT,edtREMARK,edtAMTSUMB,edtVATSUMB,edtDOCTOTB,edtAMTSUM,edtVATSUM,edtDOCTOT"); FindString.AppendLine(",edtPERSON,edtTEL,edtEMAIL"); FN.SetAutoManagedAttribute(ref oForm, AllString.ToString(), BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_False); FN.SetAutoManagedAttribute(ref oForm, AddString.ToString(), BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Add, BoModeVisualBehavior.mvb_True); //FN.SetAutoManagedAttribute(ref oForm, OKString.ToString(), BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True); SetAutoManagedAttrivute_OK(false); FN.SetAutoManagedAttribute(ref oForm, FindString.ToString(), BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Find, BoModeVisualBehavior.mvb_True); AllString = null; //OKString = null; AddString = null; #endregion oKIS_SD0030T = null; oKIS_SD00301 = null; } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } }
protected override void CreateConditions() { this.Conditions.Clear(); Conditions.Add(new Condition() { Day = Constant.WEEKEND_MORNING, Place = PlaceType.Outside, CompanyType = CompanyType.WithGF }); Conditions.Add(new Condition() { Day = Constant.WEEKEND_MORNING, Place = PlaceType.Place, CompanyType = CompanyType.WithGF }); Conditions.Add(new Condition() { Day = Constant.WEEKEND_EVENING, Place = PlaceType.Outside, CompanyType = CompanyType.WithGF }); Conditions.Add(new Condition() { Day = Constant.WEEKEND_EVENING, Place = PlaceType.Place, CompanyType = CompanyType.WithGF }); Conditions.Add(new Condition() { Day = Constant.NIGHT, Place = PlaceType.Outside, CompanyType = CompanyType.WithGF }); Conditions.Add(new Condition() { Day = Constant.NIGHT, Place = PlaceType.Place, CompanyType = CompanyType.WithGF }); Conditions.Add(new Condition() { Day = Constant.WORKDAY_MORNING, Place = PlaceType.Outside, CompanyType = CompanyType.WithGF }); Conditions.Add(new Condition() { Day = Constant.WORKDAY_MORNING, Place = PlaceType.Place, CompanyType = CompanyType.WithGF }); Conditions.Add(new Condition() { Day = Constant.PARA_1, Place = PlaceType.Outside, CompanyType = CompanyType.WithGF }); Conditions.Add(new Condition() { Day = Constant.PARA_1, Place = PlaceType.Place, CompanyType = CompanyType.WithGF }); Conditions.Add(new Condition() { Day = Constant.PARA_2, Place = PlaceType.Outside, CompanyType = CompanyType.WithGF }); Conditions.Add(new Condition() { Day = Constant.PARA_2, Place = PlaceType.Place, CompanyType = CompanyType.WithGF }); Conditions.Add(new Condition() { Day = Constant.PARA_3, Place = PlaceType.Outside, CompanyType = CompanyType.WithGF }); Conditions.Add(new Condition() { Day = Constant.PARA_3, Place = PlaceType.Place, CompanyType = CompanyType.WithGF }); Conditions.Add(new Condition() { Day = Constant.WORKDAY_EVENING, Place = PlaceType.Outside, CompanyType = CompanyType.WithGF }); Conditions.Add(new Condition() { Day = Constant.WORKDAY_EVENING, Place = PlaceType.Place, CompanyType = CompanyType.WithGF }); }
/// <summary> /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다. /// </summary> private void Act3_DefualtSetting(SAPbouiCOM.Form oForm) { // '// ADD YOUR ACTION CODE HERE ... oForm.Settings.EnableRowFormat = false; // UDO, 네비게이션 사용하지 않음 oForm.SupportedModes = (int)BoAutoFormMode.afm_Ok; #region 콜센터담당자 SAPbouiCOM.Conditions oCons = new Conditions(); ; SAPbouiCOM.Condition oCon = oCons.Add(); oCon.Alias = "U_USERGBN"; oCon.Operation = BoConditionOperation.co_EQUAL; oCon.CondVal = "20"; #endregion // 콜센터담당자 FN.SetChooseFromListAdd(oForm, "KIS_SO0010_HRD", "edtCALLPER", "Code", BoFormItemTypes.it_EDIT, oCons); // 지국 FN.SetChooseFromListAdd(oForm, "KIS_SO0040_HRD", "edtCENTCD1", "Code", BoFormItemTypes.it_EDIT, null); FN.SetChooseFromListAdd(oForm, "KIS_SO0040_HRD", "edtCENTCD2", "Code", BoFormItemTypes.it_EDIT, null); oCon = null; oCons = null; SetGridTitle(oForm); }
/// <summary> /// 폼(Form)의 아이템들(Items)에 연결이 필요한 데이타소스(DataSource) 형식을 정의합니다. /// </summary> private void Act2_DataSourcesBinding() { // '// ADD YOUR ACTION CODE HERE ... #region ComboBox // 표코드 oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboTYPE").Specific; if (FN.GetRecordsetValue("SELECT Code FROM [@KIS_AD0020M_HRD]") != "") { FN.SetComboBoxValidValues(oForm, " SELECT Code,Name FROM [@KIS_AD0020M_HRD] ", "cboTYPE", FN.Enum_WholeTp.m_Nothing); oComboBox.Select(0, BoSearchKey.psk_Index); } else { B1Connections.theAppl.StatusBar.SetText("결제라인표셋팅 등록후 사용해주세요.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } // 사용여부 oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboUSEYN").Specific; oComboBox.ValidValues.Add("Y", "Y"); oComboBox.ValidValues.Add("N", "N"); #endregion #region EditText // 사용자코드 #region GLAccounts Conditions SAPbouiCOM.Conditions oCons = new Conditions(); SAPbouiCOM.Condition oCon = oCons.Add(); #endregion FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_User).ToString(), "edtUSERID", "USER_CODE", BoFormItemTypes.it_EDIT); FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_User).ToString(), "Name", "U_NAME", BoFormItemTypes.it_EDIT); #endregion }