Example #1
0
        protected override FrmDetailBase GetDetailForm()
        {
            FrmCustomerPaymentDetail frm = new FrmCustomerPaymentDetail();

            if (customerTree1.SelectedNode != null)
            {
                frm.Customer = customerTree1.SelectedNode.Tag as CompanyInfo;
            }
            frm.PaymentType = CustomerPaymentType.Customer;
            return(frm);
        }
 private void mnu_Payment_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count == 1)
     {
         CompanyInfo c = dataGridView1.SelectedRows[0].Tag as CompanyInfo;
         FrmCustomerPaymentDetail frm = new FrmCustomerPaymentDetail();
         frm.Customer   = c;
         frm.IsAdding   = true;
         frm.ItemAdded += delegate(object obj, ItemAddedEventArgs args)
         {
             CompanyInfo c1 = (new CompanyBLL(AppSettings.Current.ConnStr)).GetByID(c.ID).QueryObject;
             if (c1 != null)
             {
                 ShowItemInGridViewRow(dataGridView1.SelectedRows[0], c1);
             }
         };
         frm.ShowDialog();
     }
 }