Ejemplo n.º 1
0
        private void gridViewPos_DoubleClick(object sender, EventArgs e)
        {
            GridView view = (GridView)sender;
            Point pt = view.GridControl.PointToClient(Control.MousePosition);
            //    DoRowDoubleClick(view, pt);
            GridHitInfo info = view.CalcHitInfo(pt);
            if ((info.InRow || info.InRowCell) && (!gridViewPos.IsGroupRow(info.RowHandle)))
            {
                string colCaption = info.Column == null ? "N/A" : info.Column.GetCaption();
               //     MessageBox.Show(string.Format("DoubleClick on row: {0}, column: {1}.", info.RowHandle, colCaption));
                int posId = (int)gridViewPos.GetRowCellValue(info.RowHandle, "ID");
                var dealerID = db.Pos.Where(x => x.ID == posId).Select(x => x.Dealers.ID).FirstOrDefault();
                var frmEditPos = new FrmEditPos(posId, false, dealerID);

                frmEditPos.Show(this);

            }
        }
Ejemplo n.º 2
0
 private void simpleButton5_Click(object sender, EventArgs e)
 {
     var row = treeDealersList.GetDataRecordByNode(treeDealersList.FocusedNode);
     if (row == null)
     {
         return;
     }
     else
     {
         dynamic treeDealer = new { ID = 0, Dealer_ID = 0, dealerZovName = "" };
         treeDealer = row;
         var dId = treeDealer.ID;
         var dName = treeDealer.dealerZovName;
         var frmEdit = new FrmEditPos(0,true, dId);
         frmEdit.Show(this);
     }
 }