Beispiel #1
0
        private void DoubleClickPolicy(Point point)
        {
            if (_dgvMain.GetID() == 0)
            {
                return;
            }

            PolicyList policyList = PolicyList.getInstance();
            Policy     policy     = policyList.getItem(_dgvMain.GetID());

            string columnName = _dgvCar.Columns[point.X].HeaderText;

            if ((_dgvCar.Columns[point.X].HeaderText == "Номер полиса") && (!string.IsNullOrEmpty(policy.File)))
            {
                WorkWithFiles.openFile(policy.File);
            }
            else if (DGVSpecialColumn.CanFiltredPolicy(columnName)) // (labelList.Where(item => item.Text == columnName).Count() == 1)
            {
                _myFilter.SetFilterValue(string.Concat(columnName, ":"), point);
            }
            else
            {
                Policy_AddEdit policyAE = new Policy_AddEdit(policy);
                if (policyAE.ShowDialog() == DialogResult.OK)
                {
                    loadCars();
                }
            }
        }
Beispiel #2
0
        private void btnAddInsurance_Click(object sender, EventArgs e)
        {
            Policy_AddEdit pAE = new Policy_AddEdit(_car.CreatePolicy());

            if (pAE.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                loadPolicy();
            }
        }
        private ToolStripMenuItem CreateNewPolicy()
        {
            ToolStripMenuItem item = CreateItem("Новый полис");

            item.Click += delegate
            {
                Car car = _dgvMain.GetCar();
                if (car == null)
                {
                    return;
                }

                Policy_AddEdit policyAE = new Policy_AddEdit(car.CreatePolicy());
                policyAE.ShowDialog();
            };
            return(item);
        }
Beispiel #4
0
        private void _dgvPolicy_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int idPolicy = Convert.ToInt32(_dgvPolicy.Rows[e.RowIndex].Cells[0].Value);

            Policy policy = policyList.getItem(idPolicy);

            if ((e.ColumnIndex == 4) && (policy.File != string.Empty))
            {
                WorkWithFiles.openFile(policy.File);
            }
            else
            {
                Policy_AddEdit pAE = new Policy_AddEdit(policy);
                pAE.ShowDialog();

                loadPolicy();
            }
        }
Beispiel #5
0
        private void dgvPolicy_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int idPolicy = Convert.ToInt32(dgvPolicy.Rows[dgvPolicy.SelectedCells[0].RowIndex].Cells[0].Value);

            PolicyList policyList = PolicyList.getInstance();
            Policy     policy     = policyList.getItem(idPolicy);

            if ((e.ColumnIndex == 1) && (policy.File != string.Empty))
            {
                WorkWithFiles.openFile(policy.File);
            }
            else
            {
                Policy_AddEdit policyAE = new Policy_AddEdit(policy);
                if (policyAE.ShowDialog() == DialogResult.OK)
                {
                    FillTable();
                }
            }
        }
Beispiel #6
0
        private void dgvPolicy_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int idPolicy = Convert.ToInt32(dgvPolicy.Rows[dgvPolicy.SelectedCells[0].RowIndex].Cells[0].Value);

            PolicyList policyList = PolicyList.getInstance();
            Policy policy = policyList.getItem(idPolicy);

            if ((e.ColumnIndex == 1) && (policy.File != string.Empty))
                WorkWithFiles.openFile(policy.File);
            else
            {
                Policy_AddEdit policyAE = new Policy_AddEdit(policy);
                if (policyAE.ShowDialog() == DialogResult.OK)
                    FillTable();
            }
        }
        private ToolStripMenuItem CreateNewPolicy()
        {
            ToolStripMenuItem item = CreateItem("Новый полис");
            item.Click += delegate
            {
                Car car = _dgvMain.GetCar();
                if (car == null)
                    return;

                Policy_AddEdit policyAE = new Policy_AddEdit(car.CreatePolicy());
                policyAE.ShowDialog();
            };
            return item;
        }
Beispiel #8
0
 private void btnAddInsurance_Click(object sender, EventArgs e)
 {
     Policy_AddEdit pAE = new Policy_AddEdit(_car.CreatePolicy());
     if (pAE.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         loadPolicy();
 }
Beispiel #9
0
        private void _dgvPolicy_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int idPolicy = Convert.ToInt32(_dgvPolicy.Rows[e.RowIndex].Cells[0].Value);

            Policy policy = policyList.getItem(idPolicy);

            if ((e.ColumnIndex == 4) && (policy.File != string.Empty))
            {
                WorkWithFiles.openFile(policy.File);
            }
            else
            {
                Policy_AddEdit pAE = new Policy_AddEdit(policy);
                pAE.ShowDialog();

                loadPolicy();
            }
        }
Beispiel #10
0
        private void DoubleClickPolicy(Point point)
        {
            if (_dgvMain.GetID() == 0)
                return;

            PolicyList policyList = PolicyList.getInstance();
            Policy policy = policyList.getItem(_dgvMain.GetID());

            string columnName = _dgvCar.Columns[point.X].HeaderText;

            if ((_dgvCar.Columns[point.X].HeaderText == "Номер полиса") && (!string.IsNullOrEmpty(policy.File)))
                WorkWithFiles.openFile(policy.File);
            else if (DGVSpecialColumn.CanFiltredPolicy(columnName)) // (labelList.Where(item => item.Text == columnName).Count() == 1)
                _myFilter.SetFilterValue(string.Concat(columnName, ":"), point);
            else
            {
                Policy_AddEdit policyAE = new Policy_AddEdit(policy);
                if (policyAE.ShowDialog() == DialogResult.OK)
                {
                    loadCars();
                }
            }
        }