Ejemplo n.º 1
0
 private void dataGridViewList_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.Button.Equals(MouseButtons.Right))
     {
         if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
         {
             try
             {
                 DataRowView     drv   = (DataRowView)dataGridViewList.Rows[e.RowIndex].DataBoundItem;
                 DataRow         dr    = drv.Row;
                 StoreModifyForm form  = new StoreModifyForm();
                 StoreModel      model = new StoreModel();
                 model.Id    = Guid.Parse(dr["ID"].ToString());
                 model.Name  = dr["Name"].ToString();
                 model.Phone = dr["Phone"].ToString();
                 form.Store  = model;
                 DialogResult result = form.ShowDialog(this);
                 if (result == DialogResult.Yes)
                 {
                     LodaData();
                 }
             }
             catch (Exception ex)
             {
                 _log.Error("View Sn information error::", ex);
             }
         }
     }
 }
Ejemplo n.º 2
0
 private void dataGridViewList_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.Button.Equals(MouseButtons.Right))
     {
         if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
         {
             try
             {
                 DataRowView drv = (DataRowView) dataGridViewList.Rows[e.RowIndex].DataBoundItem;
                 DataRow dr = drv.Row;
                 StoreModifyForm form = new StoreModifyForm();
                 StoreModel model = new StoreModel();
                 model.Id = Guid.Parse(dr["ID"].ToString());
                 model.Name = dr["Name"].ToString();
                 model.Phone = dr["Phone"].ToString();
                 form.Store = model;
                 DialogResult result = form.ShowDialog(this);
                 if (result == DialogResult.Yes)
                 {
                     LodaData();
                 }
             }
             catch (Exception ex)
             {
                 _log.Error("View Sn information error::", ex);
             }
         }
     }
 }