Exemplo n.º 1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         frmCustomerEdit frmEdit = new frmCustomerEdit(0);
         LBShowForm.ShowDialog(frmEdit);
         LoadDataSource();
     }
     catch (Exception ex)
     {
         LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
     }
 }
Exemplo n.º 2
0
        private void GrdMain_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
                {
                    DataRowView drvSelect   = this.grdMain.Rows[e.RowIndex].DataBoundItem as DataRowView;
                    long        lCustomerID = drvSelect["CustomerID"] == DBNull.Value ?
                                              0 : Convert.ToInt64(drvSelect["CustomerID"]);
                    if (lCustomerID > 0)
                    {
                        frmCustomerEdit frm = new frmCustomerEdit(lCustomerID);
                        LBShowForm.ShowDialog(frm);

                        LoadDataSource();
                    }
                }
            }
            catch (Exception ex)
            {
                LB.WinFunction.LBCommonHelper.DealWithErrorMessage(ex);
            }
        }