Пример #1
0
 private void btnExport_Click(object sender, EventArgs e)
 {
     try
     {
         var expColInfo = SysvarUtils.GetVarValue(SYSVAR.GRNAME_SYS, SYSVAR.VARNAME_EXPORT_BY_COLUMN);
         if (expColInfo == CONSTANTS.Yes)
         {
             var ucColumnEx = (ucColumnExport)FIS.AppClient.Utils.MainProcess.CreateModuleInstance("CLEXP");
             ucColumnEx.gcMain = gcMain;
             ucColumnEx.MID    = ModuleInfo.ModuleID;
             ucColumnEx.LastSearchResultKey = BufferResult.LastSearchResultKey;
             ucColumnEx.LastSearchTime      = BufferResult.LastSearchTime;
             var groupColumnFieldSupportedModule = this as IGroupColumnFieldSupportedModule;
             if (groupColumnFieldSupportedModule.GroupLayoutStoredData != null)
             {
                 var sr         = new StringReader(groupColumnFieldSupportedModule.GroupLayoutStoredData);
                 var serializer = new XmlSerializer(typeof(List <string[]>));
                 var listLayout = (List <string[]>)serializer.Deserialize(sr);
                 ucColumnEx.listLayout = listLayout;
                 ucColumnEx.Bands      = Bands;
             }
             ucColumnEx.ShowDialogModule(this);
         }
         else
         {
             var expInfo    = SysvarUtils.GetVarValue(SYSVAR.GRNAME_SYS, SYSVAR.VARNAME_EXPORT);
             var exportInfo = ModuleUtils.GetModuleInfo(ModuleInfo.ModuleID, CODES.DEFMOD.SUBMOD.SEARCH_EXPORT);
             var ucExport   = (ucSearchExport)MainProcess.CreateModuleInstance(exportInfo.ModuleID, exportInfo.SubModule, "CALL_MODULE");
             if (expInfo == CONSTANTS.Yes)
             {
                 ucExport.LastSearchResultKey = BufferResult.LastSearchResultKey;
                 ucExport.LastSearchTime      = BufferResult.LastSearchTime;
                 ucExport.PrintGrid           = gcMain;
                 ucExport.ShowDialogModule(this);
             }
             else
             {
                 var saveDialog = new SaveFileDialog
                 {
                     Filter = IMPORTMASTER.EXPORT_FILE_EXTENSIONS
                 };
                 if (saveDialog.ShowDialog() == DialogResult.OK)
                 {
                     ucExport.FileName            = saveDialog.FileName;
                     ucExport.LastSearchResultKey = BufferResult.LastSearchResultKey;
                     ucExport.LastSearchTime      = BufferResult.LastSearchTime;
                     ucExport.PrintGrid           = gcMain;
                     ucExport.Execute();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         ShowError(ex);
     }
 }
Пример #2
0
 private void btnDesign_Click(object sender, EventArgs e)
 {
     try
     {
         var ucModule = MainProcess.CreateModuleInstance(STATICMODULE.SQL_MODEL_DESIGNER);
         ucModule["P01"] = cboStoresName.EditValue;
         ucModule.ShowDialogModule(this);
     }
     catch (Exception ex)
     {
         ShowError(ex);
     }
 }
Пример #3
0
        public override void ShowModule(System.Windows.Forms.IWin32Window owner)
        {
            using (var ctrlSA = new SAController())
            {
                List <string> values;
                string        targetModule;

                GetOracleParameterValues(out values, SwitchInfo.SwitchStore);
                if (values.Count == 1 && values[0] == null)
                {
                    CloseModule();
                }
                else
                {
                    ctrlSA.ExecuteSwitchModule(out targetModule, ModuleInfo.ModuleID, ModuleInfo.SubModule, values);
                    //tudq them
                    if (SwitchInfo.SwitchStore.ToUpper() == "SP_SWITCH_MAINTAIN_LOG" || SwitchInfo.SwitchStore.ToUpper() == "SP_SWITCH_VIEW_TLLOGMEMBER")
                    {
                        Program.txnum = values[1];
                    }
                    //
                    if (SwitchInfo.SwitchStore.ToUpper() == "SP_SWITCH_APPROVE")
                    {
                        Program.txnum = values[1]; //HUYVQ: Fix 2 -> 1: bỏ BUROWID
                    }
                    if (SwitchInfo.SwitchStore.ToUpper() == "SP_SWITCH_IMP")
                    {
                        Program.rptid = values[1];
                        if (values.Count > 2)
                        {
                            Program.rptlogID = values[2];
                        }
                    }
                    var module = MainProcess.CreateModuleInstance(targetModule);

                    foreach (var param in ParameterFields)
                    {
                        module.SetFieldValue(param.FieldName, ParameterByFieldID[param.FieldID]);
                    }

                    module.ModuleClosed += delegate
                    {
                        RequireRefresh = module.RequireRefresh;
                        CloseModule();
                    };

                    module.ShowModule(owner);
                }
            }
        }
        protected virtual ButtonEdit CreateOpenFileControl(ModuleFieldInfo fieldInfo)
        {
            var txtButtonEdit = new ButtonEdit
            {
                Name = string.Format(CONSTANTS.TEXTINPUT_NAME_FORMAT, fieldInfo.FieldName),
                Tag  = fieldInfo,
                EnterMoveNextControl = true
            };

            //trungtt - 6.12.2013 - follow SSC's sugestion
            //Disable textbox.
            //txtButtonEdit.Text = "(Chọn đường dẫn)";
            txtButtonEdit.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
            //end trungtt
            var button = txtButtonEdit.Properties.Buttons[0];

            button.Tag = fieldInfo.ListSource;

            txtButtonEdit.ButtonClick += delegate(object sender, ButtonPressedEventArgs e)
            {
                if (e.Button == button)
                {
                    try
                    {
                        Program.strExecMod = ModuleInfo.ExecuteMode.ToString();
                        //var targetModule = (ucSearchMaster)MainProcess.CreateModuleInstance(STATICMODULE.UPFILE_MODID);
                        var targetModule =
                            (ucUploadFile)MainProcess.CreateModuleInstance(STATICMODULE.UPFILE_MODULE);

                        //if (targetModule is ucSearchMaster)
                        if (targetModule is ucUploadFile)
                        {
                            targetModule.ShowDialogModule(this);
                        }
                        if (Program.blCheckFile)
                        {
                            //txtButtonEdit.Text = "(File attached)";
                            txtButtonEdit.Text = Program.FileName;
                        }
                    }
                    catch (Exception ex)
                    {
                        ShowError(ex);
                    }
                }
                // }
            };

            return(txtButtonEdit);
        }
Пример #5
0
 private void btnMail_Click(object sender, EventArgs e)
 {
     try
     {
         var sendMailInfo = ModuleUtils.GetModuleInfo(ModuleInfo.ModuleID, CODES.DEFMOD.SUBMOD.SEND_MAIL);
         var ucSendMail   = (ucSendMail)MainProcess.CreateModuleInstance(sendMailInfo.ModuleID, sendMailInfo.SubModule);
         //ucExport.LastSearchResultKey = BufferResult.LastSearchResultKey;
         //ucExport.LastSearchTime = BufferResult.LastSearchTime;
         //ucExport.PrintGrid = gcMain;
         ucSendMail.ShowDialogModule(this);
     }
     catch (Exception ex)
     {
         ShowError(ex);
     }
 }
Пример #6
0
        private void reMain_ItemClicked(object sender, ItemClickedEventArgs e)
        {
            var fieldInfo = e.Position.Child as ModuleFieldInfo;

            if (fieldInfo != null)
            {
                var ucModule = MainProcess.CreateModuleInstance("02904", "MED");
                ucModule["P01"] = fieldInfo.ModuleID;
                ucModule["C01"] = fieldInfo.FieldID;
                ucModule.ShowDialogModule(this);
            }
            else
            {
                var paramInfo = e.Position.Child as OracleParameter;
                if (paramInfo != null)
                {
                    switch (paramInfo.ParameterName)
                    {
                    case "New Cursor":
                        break;
                    }
                }
            }
        }
        public BaseEdit CreateLookUpEditControl(ModuleFieldInfo fieldInfo)
        {
            //
            var expression = ExpressionUtils.ParseScript(fieldInfo.ListSource);

            if (expression.Operands.Count != 1 && expression.Operands.Count != 2)
            {
                ErrorUtils.CreateError(ERR_SYSTEM.ERR_SYSTEM_LOOKUP_EXPRESSION_REQUIRE_ONE_OR_TWO_ARGUMENTS);
            }

            foreach (var operand in expression.Operands)
            {
                if (operand.Type != OperandType.VALUE)
                {
                    ErrorUtils.CreateError(ERR_SYSTEM.ERR_SYSTEM_LOOKUP_EXPRESSION_CAN_NOT_CONTAIN_NAME);
                }
            }
            //
            var moduleLookUp = (SearchModuleInfo)((ICloneable)ModuleUtils.GetModuleInfo(expression.StoreProcName, CODES.DEFMOD.SUBMOD.MODULE_MAIN)).Clone();

            if (expression.Operands.Count == 1)
            {
                moduleLookUp.SetAsLookUpWindow(expression.Operands[0].NameOrValue);
            }
            else
            {
                moduleLookUp.SetAsLookUpWindow(expression.Operands[0].NameOrValue, expression.Operands[1].NameOrValue);
            }
            //
            var btnEdit = new ButtonEdit();

            btnEdit.Properties.Buttons[0].Tag      = moduleLookUp;
            btnEdit.Properties.Buttons[0].Shortcut = new DevExpress.Utils.KeyShortcut(Keys.F5);
            btnEdit.Properties.Buttons.Add(new EditorButton(ButtonPredefines.Delete));

            btnEdit.ButtonClick +=
                delegate(object sender, ButtonPressedEventArgs e)
            {
                if (e.Button.Kind == ButtonPredefines.Delete)
                {
                    btnEdit.EditValue = string.Empty;
                }
                else if (e.Button.Tag is ModuleInfo)
                {
                    var module = (ucSearchMaster)MainProcess.CreateModuleInstance((ModuleInfo)e.Button.Tag);
                    module.ShowDialogModule(this);

                    if (!string.IsNullOrEmpty(module.LookUpValues))
                    {
                        if (btnEdit.EditValue is string && (string)btnEdit.EditValue != string.Empty)
                        {
                            btnEdit.EditValue = string.Format("{0},{1}", btnEdit.EditValue, module.LookUpValues);
                        }
                        else
                        {
                            btnEdit.EditValue = module.LookUpValues;
                        }
                    }
                }
            };
            return(btnEdit);
        }
        //private void view_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
        //{
        //    MessageBox.Show("shit");
        //}
        //ORG: BaseEdit --> Control
        public virtual Control CreateControl(ModuleFieldInfo fieldInfo)
        {
            var baseEdit = _CreateControl(fieldInfo);

#if DEBUG
            if (baseEdit is ButtonEdit && fieldInfo.FieldGroup == CODES.DEFMODFLD.FLDGROUP.COMMON)
            {
                var buttonEdit = baseEdit as ButtonEdit;
                var button     = new EditorButton(ButtonPredefines.Up)
                {
                    Tag = "DEBUG_EDIT"
                };
                buttonEdit.Properties.Buttons.Add(button);

                var context = new ContextMenuStrip();
                context.Items.Add("Edit Field", ThemeUtils.Image16.Images["EDIT"]).Click +=
                    delegate
                {
                    var ucModule = MainProcess.CreateModuleInstance("02904", "MED");
                    ucModule["P01"] = fieldInfo.ModuleID;
                    ucModule["C01"] = fieldInfo.FieldID;
                    ucModule.ShowDialogModule(this);
                };

                if (!string.IsNullOrEmpty(fieldInfo.ListSource))
                {
                    var match = Regex.Match(fieldInfo.ListSource, "^:([^.]+).([^.]+)$");
                    context.Items.Add("Translate Code", ThemeUtils.Image16.Images["CODE"]).Click +=
                        delegate
                    {
                        var ucModule = (ucEditLanguage)MainProcess.CreateModuleInstance(STATICMODULE.EDITLANG, "MMN");
                        ucModule.mainView.ActiveFilterString = string.Format("LANGNAME LIKE 'DEFCODE${0}${1}.%'", match.Groups[1].Value, match.Groups[2].Value);
                        ucModule.Execute();
                        ucModule.ShowDialogModule(this);
                    };
                }

                context.Items.Add("List Common Field", ThemeUtils.Image16.Images["COMMON"]).Click +=
                    delegate
                {
                    var ucModule = MainProcess.CreateModuleInstance("03905", "MMN");
                    ucModule["C01"] = fieldInfo.ModuleID;
                    ucModule.ShowDialogModule(this);
                    ucModule.Execute();
                };

                buttonEdit.ButtonClick +=
                    delegate(object sender, ButtonPressedEventArgs e)
                {
                    if (e.Button == button)
                    {
                        context.Show(new Point(MousePosition.X, MousePosition.Y));
                    }
                };
            }
#endif
            if (baseEdit is BaseEdit)
            {
                if (fieldInfo.ControlType == CODES.DEFMODFLD.CTRLTYPE.LABEL)
                {
                    SetReadOnly((BaseEdit)baseEdit, true);
                }
                else
                {
                    if (ModuleInfo.SubModule == CODES.DEFMOD.SUBMOD.MAINTAIN_ADD &&
                        fieldInfo.ReadOnlyOnAdd == CODES.DEFMODFLD.READONLYMODE.READONLY)
                    {
                        SetReadOnly((BaseEdit)baseEdit, true);
                    }

                    if (ModuleInfo.SubModule == CODES.DEFMOD.SUBMOD.MAINTAIN_EDIT &&
                        fieldInfo.ReadOnlyOnEdit == CODES.DEFMODFLD.READONLYMODE.READONLY)
                    {
                        SetReadOnly((BaseEdit)baseEdit, true);
                    }

                    if ((ModuleInfo.SubModule == CODES.DEFMOD.SUBMOD.MAINTAIN_VIEW ||
                         ModuleInfo.SubModule == CODES.DEFMOD.SUBMOD.MODULE_MAIN) &&
                        fieldInfo.ReadOnlyOnView == CODES.DEFMODFLD.READONLYMODE.READONLY)
                    {
                        SetReadOnly((BaseEdit)baseEdit, true);
                    }
                }

                if (fieldInfo.TabStop == CODES.DEFMODFLD.TABSTOP.NO)
                {
                    (baseEdit as BaseEdit).Properties.AllowFocused = false;
                    baseEdit.TabStop = false;
                }

                if (fieldInfo.PopupMode == CODES.DEFMODFLD.POPUPMODE.ONFOCUS)
                {
                    var popupRepo = (baseEdit as BaseEdit).Properties as RepositoryItemPopupBaseAutoSearchEdit;
                    if (popupRepo != null)
                    {
                        popupRepo.ImmediatePopup = true;
                    }
                }

                ApplyFormatInfo(fieldInfo, (BaseEdit)baseEdit);
            }

            return(baseEdit);
        }
Пример #9
0
        public UISearchCondition(ModuleInfo moduleInfo, UISearchGroup group)
        {
            Group        = group;
            m_ModuleInfo = moduleInfo;
            Group.Conditions.Add(this);
            ParentModule = group.ParentModule;

            // NewGroup
            m_ConditionGroupLayout = group.LayoutGroup.AddGroup();
            m_ConditionGroupLayout.GroupBordersVisible = false;

            // CheckEdit Use
            m_EditUse = new CheckEdit {
                TabStop = false, Text = ""
            };
            // -> Layout
            m_EditUseLayoutItem                     = m_ConditionGroupLayout.AddItem("", m_EditUse);
            m_EditUseLayoutItem.TextVisible         = false;
            m_EditUseLayoutItem.SizeConstraintsType = SizeConstraintsType.Custom;
            m_EditUseLayoutItem.MaxSize             =
                m_EditUseLayoutItem.MinSize         = new Size(24, 22);
            m_EditUse.CheckedChanged               += CheckEditUse_CheckedChanged;

            // Condition ComboBox
            m_Condition = new ImageComboBoxEdit {
                TabStop = false
            };
#if DEBUG
            var button = new EditorButton(ButtonPredefines.Up);
            button.Tag = "DEBUG_EDIT";
            m_Condition.Properties.Buttons.Add(button);
            m_Condition.ButtonClick += delegate(object sender, ButtonPressedEventArgs e)
            {
                var fieldInfo = m_Condition.EditValue as ModuleFieldInfo;
                if (e.Button == button)
                {
                    var ucModule = MainProcess.CreateModuleInstance("02905", "MED");
                    ucModule["P01"] = fieldInfo.ModuleID;
                    ucModule["C01"] = fieldInfo.FieldID;
                    ucModule.ShowDialogModule(ParentModule);
                }
            };
#endif
            m_Condition.EditValueChanged += cboCondition_EditValueChanged;
            // -> Layout
            m_ConditionLayoutItem                     = m_ConditionGroupLayout.AddItem("", m_Condition, m_EditUseLayoutItem, InsertType.Right);
            m_ConditionLayoutItem.TextVisible         = false;
            m_ConditionLayoutItem.SizeConstraintsType = SizeConstraintsType.Custom;
            m_ConditionLayoutItem.MinSize             =
                m_ConditionLayoutItem.MaxSize         = new Size(320, 22);

            // Operator ComboBox
            // -> Layout
            m_OperatorLayoutItem = m_ConditionGroupLayout.AddItem(m_ConditionLayoutItem, InsertType.Right);

            // Editor Value
            // -> Layout
            m_EditValueLayoutItem = m_ConditionGroupLayout.AddItem(m_OperatorLayoutItem, InsertType.Right);

            // Button Remove
            m_RemoveButton = new SimpleButton
            {
                TabStop = false
            };
            ParentModule.Language.FormatButton(m_RemoveButton, "btnRemoveCondition");

            m_RemoveButton.Click += m_btnRemove_Click;
            // -> Layout
            m_RemoveButtonLayoutItem                     = m_ConditionGroupLayout.AddItem("", m_RemoveButton, m_EditValueLayoutItem, InsertType.Right);
            m_RemoveButtonLayoutItem.TextVisible         = false;
            m_RemoveButtonLayoutItem.SizeConstraintsType = SizeConstraintsType.Custom;
            m_RemoveButtonLayoutItem.MinSize             =
                m_RemoveButtonLayoutItem.MaxSize         = new Size(100, 22);

            group.LayoutGroup.Add(m_ConditionGroupLayout);

            InitializeConditionComboBox();
            ConditionModule.UpdateConditionQuery();
            m_EditUse.Checked = true;
        }