Exemple #1
0
        private void customerToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            frmCustomer frm = new frmCustomer();

            frm.lblUser.Text = lblUser.Text;
            frm.Reset();
            frm.Show();
        }
Exemple #2
0
        private void metroTile5_Click(object sender, EventArgs e)
        {
            frmCustomer frm = new frmCustomer();

            frm.lblUser.Text = lblUser.Text;
            frm.Reset();
            frm.Show();
        }
 private void dgw_MouseClick(object sender, MouseEventArgs e)
 {
     try
     {
         if (lblOperation.Text == "Customer Master")
         {
             DataGridViewRow dr = dgw.SelectedRows[0];
             this.Hide();
             frmCustomer frm = new frmCustomer();
             frm.Show();
             frm.txtID.Text           = dr.Cells[0].Value.ToString();
             frm.txtCustomerID.Text   = dr.Cells[1].Value.ToString();
             frm.txtCustomerName.Text = dr.Cells[2].Value.ToString();
             frm.txtAddress.Text      = dr.Cells[3].Value.ToString();
             frm.txtCity.Text         = dr.Cells[4].Value.ToString();
             frm.txtContactNo.Text    = dr.Cells[5].Value.ToString();
             frm.txtEmailID.Text      = dr.Cells[6].Value.ToString();
             byte[]       data = (byte[])dr.Cells[7].Value;
             MemoryStream ms   = new MemoryStream(data);
             frm.Picture.Image     = Image.FromStream(ms);
             frm.btnUpdate.Enabled = true;
             frm.btnDelete.Enabled = true;
             frm.btnSave.Enabled   = false;
             frm.lblUser.Text      = lblUser.Text;
             lblOperation.Text     = "";
         }
         if (lblOperation.Text == "Membership")
         {
             DataGridViewRow dr = dgw.SelectedRows[0];
             this.Hide();
             frmCustomerMembership frm = new frmCustomerMembership();
             frm.Show();
             frm.txtM_ID.Text       = dr.Cells[0].Value.ToString();
             frm.txtMemberName.Text = dr.Cells[2].Value.ToString();
             frm.txtAddress.Text    = dr.Cells[3].Value.ToString();
             frm.txtCity.Text       = dr.Cells[4].Value.ToString();
             frm.txtContactNo.Text  = dr.Cells[5].Value.ToString();
             frm.txtEmailID.Text    = dr.Cells[6].Value.ToString();
             byte[]       data = (byte[])dr.Cells[7].Value;
             MemoryStream ms   = new MemoryStream(data);
             frm.Picture.Image = Image.FromStream(ms);
             frm.lblUser.Text  = lblUser.Text;
             lblOperation.Text = "";
             frm.auto();
         }
         if (lblOperation.Text == "Sales")
         {
             DataGridViewRow dr = dgw.SelectedRows[0];
             this.Hide();
             frmSales frm = new frmSales();
             frm.Show();
             frm.txtC_Id.Text         = dr.Cells[0].Value.ToString();
             frm.txtCustomerID.Text   = dr.Cells[1].Value.ToString();
             frm.txtCustomerName.Text = dr.Cells[2].Value.ToString();
             frm.lblUser.Text         = lblUser.Text;
             lblOperation.Text        = "";
             frm.auto();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }