Ejemplo n.º 1
0
        public static Form LaunchAsChildForm(object entity)
        {
            var frm = new FrmEntityViewer(entity);

            AWHelper.ShowChildForm(frm);
            return(frm);
        }
 private void frmOrganization_Load(object sender, EventArgs e)
 {
     cbEmployee.DataSource    = LookUpQueries.GetEmployees();
     cbEmployee.DisplayMember = "EmployeeDisplayName";
     cbEmployee.ValueMember   = EmployeeFieldIndex.EmployeeID.ToString();
     AWHelper.SetWindowSizeAndLocation(this, Settings.Default.OrderSearchSizeLocation);
 }
Ejemplo n.º 3
0
        private void frmOrderSearch_Load(object sender, EventArgs e)
        {
            var previousState = Settings.Default.State;

            listBoxCountry.DataSource    = LookUpQueries.GetCountryRegionCollection();
            listBoxCountry.DisplayMember = CountryRegionFieldIndex.Name.ToString();
            listBoxCountry.ValueMember   = CountryRegionFieldIndex.CountryRegionCode.ToString();

            cbState.DataSource    = LookUpQueries.GetStateProvinceCollection();
            cbState.DisplayMember = StateProvinceFieldIndex.Name.ToString();
            cbState.ValueMember   = StateProvinceFieldIndex.StateProvinceID.ToString();

            dtpDateFrom.Checked = Settings.Default.FilterOnFromDate;
            dtpDateTo.Checked   = Settings.Default.FilterOnToDate;

            cbState.Text = previousState;

            buttonClearCountries_Click(sender, e);
            if (Settings.Default.Countries != null && listBoxCountry.Items.Count > 0)
            {
                foreach (var selectedRow in Settings.Default.Countries)
                {
                    listBoxCountry.SelectedIndices.Add(Convert.ToInt32(selectedRow));
                }
            }

            AWHelper.SetWindowSizeAndLocation(this, Settings.Default.OrderSearchSizeLocation);
        }
Ejemplo n.º 4
0
 private void FrmTrace_Load(object sender, EventArgs e)
 {
     DQETraceLevel  = Settings.Default.TraceLevel;
     LinqTraceLevel = Settings.Default.LinqTraceLevel;
     AWHelper.SetWindowSizeAndLocation(this, Settings.Default.TraceWindowSizeLocation);
     checkBoxSQLTrace_CheckedChanged(checkBoxSQLTrace, e);
 }
Ejemplo n.º 5
0
        private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            Settings.Default.MainWindowSizeLocation = AWHelper.GetWindowNormalSizeAndLocation(this);

            Settings.Default.ReopenWindows = reOpenWindowsToolStripMenuItem.Checked;
            if (Settings.Default.OpenWindows == null)
            {
                Settings.Default.OpenWindows = new StringCollection();
            }
            else
            {
                Settings.Default.OpenWindows.Clear();
            }
            if (Settings.Default.ReopenWindows && MdiChildren.Length > 0)
            {
                foreach (var myForm in MdiChildren)
                {
                    if (Convert.ToBoolean(myForm.Tag))
                    {
                        Settings.Default.OpenWindows.Add(myForm.GetType().FullName);
                        if (myForm is FrmQueryRunner)
                        {
                            Settings.Default.QueryFilesToReopen = ((FrmQueryRunner)myForm).GetOpenFiles();
                        }
                    }
                }
            }
        }
Ejemplo n.º 6
0
        public static Form LaunchAsChildForm(object entity, IDataEditorPersister dataEditorPersister)
        {
            var frm = new FrmEntityViewer(entity, dataEditorPersister);

            AWHelper.ShowChildForm(frm);
            return(frm);
        }
        public static Form LaunchAsChildForm(object entity, Func <object, int> saveFunction, Func <object, int> deleteFunction, params Type[] saveableTypes)
        {
            var frm = new FrmLLBLEntityViewer(entity, new DataEditorPersister(saveFunction, deleteFunction, saveableTypes));

            AWHelper.ShowFormModalIfParentLess(frm);
            return(frm);
        }
Ejemplo n.º 8
0
 public static void ShowEntitiesAndFields(Type baseType, ILinqMetaData linqMetaData, Form parent)
 {
     if (_formSingleton == null)
     {
         _formSingleton = new FrmEntitiesAndFields(baseType, linqMetaData);
     }
     AWHelper.ShowFormModalIfParentLess(_formSingleton, parent);
 }
Ejemplo n.º 9
0
 private void frmOrderEdit_FormClosing(object sender, FormClosingEventArgs e)
 {
     // salesOrderHeaderEntityBindingSource.CancelEdit();
     if (_order != null)
     {
         _order.ResetErrors();
     }
     Settings.Default.OrderEditSizeLocation = AWHelper.GetWindowNormalSizeAndLocation(this);
 }
        public static Form LaunchForm(IEnumerable hierarchicalData, string iDPropertyName, string parentIDPropertyName, string nameColumn, IDataEditorPersister dataEditorPersister)
        {
            var frm = new FrmHierarchyEditor(hierarchicalData, iDPropertyName, parentIDPropertyName, nameColumn, dataEditorPersister)
            {
                Text = hierarchicalData.ToString()
            };

            AWHelper.ShowForm(frm);
            return(frm);
        }
Ejemplo n.º 11
0
        private void frmOrderEdit_Load(object sender, EventArgs e)
        {
            PopulateListBoxes();

            if (_order != null && _order.IsNew == false)
            {
                PopulateOrderData();
                PopulateOrderDetailData();
            }
            AWHelper.SetWindowSizeAndLocation(this, Settings.Default.OrderEditSizeLocation);
        }
Ejemplo n.º 12
0
        private void frmOrderSearch_Load(object sender, EventArgs e)
        {
            var previousState   = Settings.Default.State;
            var previousCountry = Settings.Default.Country;

            cbCountry.DataSource    = LookUpQueries.GetCountryRegionCollection();
            cbCountry.DisplayMember = CountryRegionFieldIndex.Name.ToString();
            cbCountry.ValueMember   = CountryRegionFieldIndex.CountryRegionCode.ToString();

            cbState.DataSource    = LookUpQueries.GetStateProvinceCollection();
            cbState.DisplayMember = StateProvinceFieldIndex.Name.ToString();
            cbState.ValueMember   = StateProvinceFieldIndex.StateProvinceID.ToString();

            dtpDateFrom.Checked = Settings.Default.FilterOnFromDate;
            dtpDateTo.Checked   = Settings.Default.FilterOnToDate;

            cbState.Text   = previousState;
            cbCountry.Text = previousCountry;

            AWHelper.SetWindowSizeAndLocation(this, Settings.Default.OrderSearchSizeLocation);
        }
Ejemplo n.º 13
0
        private void EntitiesAndFields_Load(object sender, EventArgs e)
        {
            AWHelper.SetWindowSizeAndLocation(this, Settings.Default.EntitiesAndFieldsSizeLocation);
            treeViewEntities.Nodes.Clear();
            foreach (var entityType in GetEntitiesTypes().OrderBy(t => t.Name))
            {
                var entityNode = treeViewEntities.Nodes.Add(entityType.Name, entityType.Name.Replace("Entity", ""));
                entityNode.Tag = entityType;
                foreach (var browsableProperty in ListBindingHelper.GetListItemProperties(entityType).Cast <PropertyDescriptor>().
                         Where(p => !typeof(IList).IsAssignableFrom(p.PropertyType)).OrderBy(p => p.Name))
                {
                    var fieldNode = entityNode.Nodes.Add(browsableProperty.Name);
                    if (typeof(IEntityCore).IsAssignableFrom(browsableProperty.PropertyType))
                    {
                        fieldNode.ImageIndex = 3;
                        fieldNode.Tag        = browsableProperty;
                    }
                    else
                    {
                        fieldNode.ImageIndex = 1;
                    }
                }

                foreach (var entityTypeProperty in GetPropertiesOfTypeEntity(entityType))
                {
                    var fieldNode = entityNode.Nodes.Add(entityTypeProperty.Name);

                    fieldNode.ImageIndex = 3;
                    fieldNode.Tag        = entityTypeProperty;
                }

                foreach (var browsableProperty in ListBindingHelper.GetListItemProperties(entityType).Cast <PropertyDescriptor>().
                         Where(p => typeof(IList).IsAssignableFrom(p.PropertyType)).OrderBy(p => p.Name))
                {
                    var fieldNode = entityNode.Nodes.Add(browsableProperty.Name);
                    fieldNode.Tag        = browsableProperty;
                    fieldNode.ImageIndex = 2;
                }
            }
        }
Ejemplo n.º 14
0
        private void frmOrderSearch_FormClosing(object sender, FormClosingEventArgs e)
        {
            Settings.Default.OrderSearchSizeLocation = AWHelper.GetWindowNormalSizeAndLocation(this);
            Settings.Default.FilterOnFromDate        = dtpDateFrom.Checked;
            Settings.Default.FilterOnToDate          = dtpDateTo.Checked;

            if (listBoxCountry.Items.Count > 0)
            {
                if (Settings.Default.Countries == null)
                {
                    Settings.Default.Countries = new StringCollection();
                }
                else
                {
                    Settings.Default.Countries.Clear();
                }
                foreach (var selectedRow in listBoxCountry.SelectedIndices)
                {
                    Settings.Default.Countries.Add(selectedRow.ToString());
                }
            }
        }
Ejemplo n.º 15
0
 public void FrmOrganizationStructureTest()
 {
     AWHelper.ShowDialog(typeof(FrmOrganizationStructure));
 }
Ejemplo n.º 16
0
 public FrmMain()
 {
     InitializeComponent();
     AWHelper.SetWindowSizeAndLocation(this, Settings.Default.MainWindowSizeLocation);
 }
Ejemplo n.º 17
0
 private void frmCustomers_Load(object sender, EventArgs e)
 {
     AWHelper.SetWindowSizeAndLocation(this, Settings.Default.CustomersSizeLocation);
     dgvResults.AutoGenerateColumns = true;
 }
 private void frmOrganization_FormClosing(object sender, FormClosingEventArgs e)
 {
     Settings.Default.OrderSearchSizeLocation = AWHelper.GetWindowNormalSizeAndLocation(this);
 }
 public FrmHierarchyEditor()
 {
     InitializeComponent();
     AWHelper.SetWindowSizeAndLocation(this, Settings.Default.HierarchyEditorSizeLocation);
 }
 public FrmQueryRunner()
 {
     InitializeComponent();
       AWHelper.SetWindowSizeAndLocation(this, Settings.Default.QueryRunnerSizeAndLocation);
 }
 private void FrmQueryRunner_FormClosing(object sender, FormClosingEventArgs e)
 {
     Settings.Default.QueryRunnerSizeAndLocation = AWHelper.GetWindowNormalSizeAndLocation(this);
 }
Ejemplo n.º 22
0
 private void frmOrderSearch_FormClosing(object sender, FormClosingEventArgs e)
 {
     Settings.Default.OrderSearchSizeLocation = AWHelper.GetWindowNormalSizeAndLocation(this);
     Settings.Default.FilterOnFromDate        = dtpDateFrom.Checked;
     Settings.Default.FilterOnToDate          = dtpDateTo.Checked;
 }
 private void FrmHierarchyEditor_FormClosing(object sender, FormClosingEventArgs e)
 {
     Settings.Default.HierarchyEditorSizeLocation = AWHelper.GetWindowNormalSizeAndLocation(this);
     Settings.Default.Save();
 }
Ejemplo n.º 24
0
 private void frmVacationBonus_Load(object sender, EventArgs e)
 {
     AWHelper.SetWindowSizeAndLocation(this, Settings.Default.VacationSizeLocation);
 }
 private void FrmOrganizationStructureLoad(object sender, EventArgs e)
 {
     EmployeeCollection = LookUpQueries.GetEmployees();
     EmployeeCollection.RemovedEntitiesTracker = new EmployeeCollection();
     AWHelper.SetWindowSizeAndLocation(this, Settings.Default.OrganizationStructureSizeLocation);
 }
Ejemplo n.º 26
0
 private void FrmEntitiesAndFields_FormClosed(object sender, FormClosedEventArgs e)
 {
     Settings.Default.EntitiesAndFieldsSizeLocation = AWHelper.GetWindowNormalSizeAndLocation(this);
     Settings.Default.Save();
 }
 private void FrmOrganizationStructure_FormClosing(object sender, FormClosingEventArgs e)
 {
     Settings.Default.OrganizationStructureSizeLocation = AWHelper.GetWindowNormalSizeAndLocation(this);
 }
Ejemplo n.º 28
0
 public FrmDataEditor()
 {
     InitializeComponent();
     AWHelper.SetWindowSizeAndLocation(this, Settings.Default.EntityViewerSizeLocation);
 }
Ejemplo n.º 29
0
 private void frmVacationBonus_FormClosing(object sender, FormClosingEventArgs e)
 {
     Settings.Default.VacationSizeLocation = AWHelper.GetWindowNormalSizeAndLocation(this);
 }
Ejemplo n.º 30
0
 private void FrmDataEditor_FormClosing(object sender, FormClosingEventArgs e)
 {
     Settings.Default.EntityViewerSizeLocation = AWHelper.GetWindowNormalSizeAndLocation(this);
     Settings.Default.Save();
 }