Ejemplo n.º 1
0
 private void btndatphong_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (Program.co == 1)
     {
         Form frm = this.CheckExists(typeof(FormDatphong));
         if (frm != null)
         {
             frm.Activate();
         }
         else
         {
             FormDatphong f = new FormDatphong();
             f.MdiParent = this;
             f.Show();
         }
     }
     else
     {
         MessageBox.Show("Bạn chưa đăng nhập.Vui lòng đăng nhập", "", MessageBoxButtons.OK);
         return;
     }
 }
Ejemplo n.º 2
0
        private void gvkhachhang_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int i;

            i           = gvkhachhang.CurrentRow.Index;
            txtcmt.Text = gvkhachhang.Rows[i].Cells[0].Value.ToString();

            txthoten.Text = gvkhachhang.Rows[i].Cells[1].Value.ToString();
            dtns.Text     = gvkhachhang.Rows[i].Cells[2].Value.ToString();
            if (Boolean.Parse(gvkhachhang.Rows[i].Cells[3].Value.ToString()) == true)
            {
                cmbgt.Text = "Nam";
            }
            else
            {
                cmbgt.Text = "Nữ";
            }
            txtdc.Text = gvkhachhang.Rows[i].Cells[4].Value.ToString();
            txtdt.Text = gvkhachhang.Rows[i].Cells[5].Value.ToString();
            if (Program.flagkh == 1)
            {
                Program.cmtkh  = gvkhachhang.Rows[i].Cells[0].Value.ToString();
                Program.flagkh = 0;

                Form frm = Program.FormChinh.CheckExists(typeof(FormDatphong));
                if (frm != null)
                {
                    frm.Activate();
                }
                else
                {
                    FormDatphong f = new FormDatphong();
                    f.txtkh.Text = gvkhachhang.Rows[i].Cells[0].Value.ToString();
                    f.MdiParent  = this;
                    f.Show();
                }
                this.Close();
            }
        }