Ejemplo n.º 1
0
        private void gridView2_DoubleClick(object sender, EventArgs e)
        {
            if (gridView2.SelectedRowsCount == 0)
            {
                return;
            }
            Point       pt   = gridView2.GridControl.PointToClient(Control.MousePosition);
            GridHitInfo info = gridView2.CalcHitInfo(pt);

            if (!info.InRow && !info.InRowCell)
            {
                return;
            }

            //int[] rwind = gridView2.GetSelectedRows();
            double      count = 0;
            string      id;
            DataRowView rw = (DataRowView)gridView2.GetFocusedRow();

            id = rw[0].ToString();
            if (!(id == Current_Agent.agency && Current_Agent.isadmin == true))
            {
                return;
            }
            if (!Double.TryParse(id, out count))
            {
                return;
            }
            AddEditAgencyFr agForm = new AddEditAgencyFr(1);// редактировать

            agForm.Aid     = id;
            agForm.Aname   = rw[1].ToString();
            agForm.Aphone  = rw[3].ToString();
            agForm.Address = rw[2].ToString();
            agForm.ShowDialog();
        }
Ejemplo n.º 2
0
        private void gridView2_DoubleClick(object sender, EventArgs e)
        {
            if (gridView2.SelectedRowsCount == 0) return;
            Point pt = gridView2.GridControl.PointToClient(Control.MousePosition);
            GridHitInfo info = gridView2.CalcHitInfo(pt);
            if (!info.InRow && !info.InRowCell) return;

            //int[] rwind = gridView2.GetSelectedRows();
            double count = 0;
            string id;
            DataRowView rw = (DataRowView)gridView2.GetFocusedRow();
            id = rw[0].ToString();
            if (!(id== Current_Agent.agency && Current_Agent.isadmin == true)) return;
            if (!Double.TryParse(id, out count)) return;
            AddEditAgencyFr agForm = new AddEditAgencyFr(1);// редактировать
            agForm.Aid = id;
            agForm.Aname = rw[1].ToString();
            agForm.Aphone = rw[3].ToString();
            agForm.Address = rw[2].ToString();
            agForm.ShowDialog();
        }
Ejemplo n.º 3
0
        private void simpleButton1_Click(object sender, EventArgs e) //добавить агентство
        {
            AddEditAgencyFr agForm = new AddEditAgencyFr(0);         //0-add

            agForm.ShowDialog();
        }
Ejemplo n.º 4
0
 //добавить агентство
 private void simpleButton1_Click(object sender, EventArgs e)
 {
     AddEditAgencyFr agForm = new AddEditAgencyFr(0);//0-add
     agForm.ShowDialog();
 }