Esempio n. 1
0
        private void listaBancheClickCellButton(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
        {
            if (getAbiCabService().IsValidableIBAN())
            {
                //this.ValidateDataRowCell(e.Cell.Row, e.Cell.Column, e.Cell.Value);

                // Scelta ABI - CAB
                if (e.Cell.Column.Key == "Abi")
                {
                    var form = new SceltaAbiCab();

                    var cabExample = new CabDTO
                    {
                        Abi = e.Cell.Row.Cells["Abi"].Value.ToString(),
                        Cab = e.Cell.Row.Cells["Cab"].Value.ToString()
                    };
                    form.LoadDati(cabExample);

                    form.SelectItem += formAbiCabSelectItem;
                    form.ShowDialog();
                    form.Dispose();
                }
            }

            if (e.Cell.Column.Key == "DeleteColumn")
            {
                // Le righe nuove sono sempre eliminabili
                var dto = e.Cell.Row.ListObject as DatiBancariDTO;
                if (dto != null)
                { 
                    var datiBancari = dto;

                    if (datiBancari.Stato != "D")
                    {
                        if (datiBancari.ID == 0)
                        {
                            datiBancari.IsDeleteAllow = true;
                            e.Cell.Row.Delete();
                        }
                        else
                        {
                            string message = getCondominioService().IsAllowDeleteBanca(datiBancari);
                            if (!string.IsNullOrEmpty(message))
                            {
                                CommonMessages.DisplayWarning("Non è ammessa la cancellazione del conto bancario:" + Environment.NewLine + message);
                                datiBancari.IsDeleteAllow = false;
                            }
                            else
                            {
                                base.SetDirty(true);
                                datiBancari.Stato = "D";
                                e.Cell.Row.Appearance.FontData.Strikeout = Infragistics.Win.DefaultableBoolean.True;
                            }
                        }
                    }
                    else
                    {
                        datiBancari.Stato = string.Empty;
                        e.Cell.Row.Appearance.FontData.Strikeout = Infragistics.Win.DefaultableBoolean.False;
                    }
                }
            }
        }
Esempio n. 2
0
        private void btnCercaAbiCabClick(object sender, EventArgs e)
        {
            var cabExample = new CabDTO();
            if (abi.Value != null)
                cabExample.Abi = abi.Value.ToString();
            if (cab.Value != null)
                cabExample.Cab = cab.Value.ToString();

            var form = new SceltaAbiCab();
            form.LoadDati(cabExample);
            form.SelectItem += formSelectItem;
            form.ShowDialog();
            form.Dispose();
        }
Esempio n. 3
0
        private void listaBancheAfterRowInsert(object sender, Infragistics.Win.UltraWinGrid.RowEventArgs e)
        {
            if (getAbiCabService().IsValidableIBAN())
            {
                var cabExample = new CabDTO
                {
                    Abi = (string) e.Row.Cells["Abi"].Value,
                    Cab = (string) e.Row.Cells["Cab"].Value,
                    FrequentlyAccessed = true
                };

                var formAbiCab = new SceltaAbiCab();
                formAbiCab.LoadDati(cabExample);
                formAbiCab.SelectItem += formAbiCabSelectItem;
                if (formAbiCab.ShowDialog() == DialogResult.Cancel)
                    e.Row.Delete(false);
                formAbiCab.Dispose();
            }

            if (_condominio.DatiBancari.Count == 1)
                e.Row.Cells["Principale"].Value = true;
        }