示例#1
0
        private void gridView1_DoubleClick(object sender, EventArgs e)//agent
        {
            if (gridView1.SelectedRowsCount == 0)
            {
                return;
            }
            Point       pt   = gridView1.GridControl.PointToClient(Control.MousePosition);
            GridHitInfo info = gridView1.CalcHitInfo(pt);

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

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

            id = rw[0].ToString();
            if ((id != Current_Agent.id) && !(rw["agencyID"].ToString() == Current_Agent.agency && Current_Agent.isadmin == true))
            {
                return;
            }
            if (!Double.TryParse(id, out count))
            {
                return;
            }
            AddEditAgentFr agntForm = new AddEditAgentFr(1); //1-edit, delete

            agntForm.Aid      = id;
            agntForm.Afio     = rw["fio"].ToString();
            agntForm.Aphone   = rw["phone"].ToString();
            agntForm.Amail    = rw["mail"].ToString();
            agntForm.A_agency = rw["agencyID"].ToString();
            agntForm.Alogin   = rw["login"].ToString();

            string isadm = rw["isadmin"].ToString();

            if (isadm == "1" || isadm.ToLower() == "true")
            {
                agntForm.A_isadmin = true;
            }
            else
            {
                agntForm.A_isadmin = false;
            }

            count = 0;
            if (Double.TryParse(rw[5].ToString(), out count))
            {
                agntForm.realt_count = (long)count;
            }
            if (Double.TryParse(rw[6].ToString(), out count))
            {
                agntForm.terra_count = (long)count;
            }

            agntForm.ShowDialog();
        }
示例#2
0
        //agent
        private void gridView1_DoubleClick(object sender, EventArgs e)
        {
            if (gridView1.SelectedRowsCount == 0) return;
            Point pt = gridView1.GridControl.PointToClient(Control.MousePosition);
            GridHitInfo info = gridView1.CalcHitInfo(pt);
            if (!info.InRow && !info.InRowCell) return;

            //int[] rwind = gridView1.GetSelectedRows();
            double count = 0;
            string id;
            DataRowView rw = (DataRowView)gridView1.GetFocusedRow();
            id = rw[0].ToString();
            if ((id != Current_Agent.id) && !(rw["agencyID"].ToString() == Current_Agent.agency && Current_Agent.isadmin == true)) return;
            if (!Double.TryParse(id, out count)) return;
            AddEditAgentFr agntForm = new AddEditAgentFr(1); //1-edit, delete
            agntForm.Aid = id;
            agntForm.Afio = rw["fio"].ToString();
            agntForm.Aphone = rw["phone"].ToString();
            agntForm.Amail = rw["mail"].ToString();
            agntForm.A_agency = rw["agencyID"].ToString();
            agntForm.Alogin = rw["login"].ToString();

            string isadm = rw["isadmin"].ToString();
            if (isadm == "1" || isadm.ToLower()=="true") agntForm.A_isadmin = true;
            else agntForm.A_isadmin = false;

            count = 0;
            if (Double.TryParse(rw[5].ToString(), out count)) agntForm.realt_count = (long)count;
            if (Double.TryParse(rw[6].ToString(), out count)) agntForm.terra_count = (long)count;

            agntForm.ShowDialog();
        }
示例#3
0
        private void BtAddAgent_Click(object sender, EventArgs e) //добавить агента
        {
            AddEditAgentFr agntForm = new AddEditAgentFr(0);      //0-add

            agntForm.ShowDialog();
        }
示例#4
0
 //добавить агента
 private void BtAddAgent_Click(object sender, EventArgs e)
 {
     AddEditAgentFr agntForm = new AddEditAgentFr(0); //0-add
     agntForm.ShowDialog();
 }