Exemplo n.º 1
0
        private void btn_Edit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                var i = Grv_TaiKhoan.GetFocusedRowCellValue("idTK");
                if (i == null)
                {
                    XtraMessageBox.Show("Vui lòng chọn tài khoản cần sửa");
                }
                else
                {
                    var sua = _cobacEntity.quanlyTK.Where(a => a.idTK == (int)i).SingleOrDefault();
                    txt_SoTK.EditValue    = sua.SoTK;
                    txt_HoVaTen.EditValue = sua.TenTkDayDU;
                    txt_Ten.EditValue     = sua.TenTk;
                    if (sua.GiaUSDTK == null)
                    {
                        Spin_GiaUSD.Value = 0;
                    }
                    else
                    {
                        Spin_GiaUSD.Value = (Decimal)sua.GiaUSDTK;
                    }

                    txt_cadovoi.EditValue          = sua.NguoiCaDoCung;
                    txt_TenNguoiCaDoCung.EditValue = sua.TenNguoiCaDoCung;
                    bool_sua = true;
                    id_sua   = (int)i;
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 2
0
        private void btn_thongkechitiet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            thongkechitiet thongkechitiet = new thongkechitiet();

            try
            {
                var i = Grv_TaiKhoan.GetFocusedRowCellValue("idTK");
                if (i == null)
                {
                    XtraMessageBox.Show("Vui lòng chọn tài khoản cần xem");
                }
                else
                {
                    var sua = _cobacEntity.quanlyTK.Where(a => a.idTK == (int)i).SingleOrDefault();
                    thongkechitiet.idtk = (int)i;
                    if (sua.GiaUSDTK == null)
                    {
                        Spin_GiaUSD.Value = 0;
                    }
                    else
                    {
                        thongkechitiet.tygia = (Decimal)sua.GiaUSDTK;
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }


            thongkechitiet.ShowDialog();
        }
Exemplo n.º 3
0
 private void btn_thongtincado_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         var i = Grv_TaiKhoan.GetFocusedRowCellValue("idTK");
         if (i == null)
         {
             XtraMessageBox.Show("Vui lòng chọn tài khoản cần nhập và xem thông tin");
         }
         else
         {
             var masotaikhoan = _cobacEntity.quanlyTK.Where(a => a.idTK == (int)i).SingleOrDefault();
             ;
             Thongtincado thongtincado = new Thongtincado();
             thongtincado.ID_Taikhoan   = (int)i;
             thongtincado._masotaikhoan = masotaikhoan.SoTK;
             thongtincado.ShowDialog();
         }
     }
     catch (Exception)
     {
         XtraMessageBox.Show("Chưa nhập đủ thông tin");
     }
 }