Пример #1
0
 /// <summary>
 /// On double clicking on the datagridview, It displays the details of the rack to edit or delete
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvRoute_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.RowIndex != -1)
         {
             if (dgvRoute.Rows[e.RowIndex].Cells["dgvtxtRouteName"].Value.ToString() != "NA")
             {
                 RouteSP   spRoute   = new RouteSP();
                 RouteInfo infoRoute = new RouteInfo();
                 infoRoute             = spRoute.RouteView(Convert.ToDecimal(dgvRoute.CurrentRow.Cells["dgvtxtRouteId"].Value.ToString()));
                 decRouteId            = Convert.ToDecimal(dgvRoute.CurrentRow.Cells["dgvtxtRouteId"].Value.ToString());
                 txtRouteName.Text     = infoRoute.RouteName;
                 cmbArea.SelectedValue = infoRoute.AreaId.ToString();
                 txtNarration.Text     = infoRoute.Narration;
                 btnSave.Text          = "Update";
                 btnDelete.Enabled     = true;
                 txtRouteName.Focus();
             }
             else
             {
                 Messages.InformationMessage("Default Route cannot update or delete");
                 Clear();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("RT19" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #2
0
        /// <summary>
        /// On double clicking on the datagridview, It displays the details of the rack to edit or delete
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvRoute_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex != -1)
                {
                    if (dgvRoute.Rows[e.RowIndex].Cells["dgvtxtRouteName"].Value.ToString() != "NA")
                    {
                        RouteSP spRoute = new RouteSP();
                        RouteInfo infoRoute = new RouteInfo();
                        infoRoute = spRoute.RouteView(Convert.ToDecimal(dgvRoute.CurrentRow.Cells["dgvtxtRouteId"].Value.ToString()));
                        decRouteId = Convert.ToDecimal(dgvRoute.CurrentRow.Cells["dgvtxtRouteId"].Value.ToString());
                        txtRouteName.Text = infoRoute.RouteName;
                        cmbArea.SelectedValue = infoRoute.AreaId.ToString();
                        txtNarration.Text = infoRoute.Narration;
                        btnSave.Text = "Update";
                        btnDelete.Enabled = true;
                        txtRouteName.Focus();

                    }
                    else
                    {
                        Messages.InformationMessage("Default Route cannot update or delete");
                        Clear();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("RT19" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }