예제 #1
0
        private void sbtnSuaDG_Click(object sender, EventArgs e)
        {
            if (str == "1")
            {
                PhieuMuon pm = new PhieuMuon();
                pm.ma         = grvDocGia.GetFocusedRowCellValue("Mã phiếu").ToString();
                pm.docgiama   = grvDocGia.GetFocusedRowCellValue("Mã độc giả").ToString();
                pm.ngaymuon   = DateTime.Parse(grvDocGia.GetFocusedRowCellValue("Ngày mượn").ToString());
                pm.hantra     = DateTime.Parse(grvDocGia.GetFocusedRowCellValue("Hạn trả").ToString());
                pm.phathong   = 0;
                pm.phatmat    = 0;
                pm.phatquahan = 0;
                pm.ngaytra    = DateTime.Now;
                string str1 = pm.ma + "_" + pm.docgiama + "_" + pm.ngaymuon + "_"
                              + pm.ngaytra + "_" + pm.hantra + "_" + pm.phathong + "_" + pm.phatmat + "_" + pm.phatquahan;
                frmUpdate frm = new frmUpdate(str1);
                frm.ShowDialog();
                grcDSDocGia.DataSource = da.Query("DanhSachPhieuMuon");
            }
            else
            {
                DocGia docgia = new DocGia();
                docgia.ma       = grvDocGia.GetFocusedRowCellValue("ma").ToString();
                docgia.ten      = grvDocGia.GetFocusedRowCellValue("ten").ToString();
                docgia.ngaysinh = DateTime.Parse(grvDocGia.GetFocusedRowCellValue("ngaysinh").ToString());
                if (bool.Parse(grvDocGia.GetFocusedRowCellValue("gioitinh").ToString()) == true)
                {
                    docgia.gioitinh = true;
                }
                //sach.tinhtrang = true;
                else
                {
                    docgia.gioitinh = false;
                }
                docgia.diachi     = grvDocGia.GetFocusedRowCellValue("diachi").ToString();
                docgia.ngaylamthe = DateTime.Parse(grvDocGia.GetFocusedRowCellValue("ngaylamthe").ToString());
                docgia.ngayhethan = DateTime.Parse(grvDocGia.GetFocusedRowCellValue("ngayhethan").ToString());
                if (bool.Parse(grvDocGia.GetFocusedRowCellValue("hoatdong").ToString()) == true)
                {
                    docgia.hoatdong = true;
                }
                //sach.tinhtrang = true;
                else
                {
                    docgia.hoatdong = false;
                }

                EditReader editreader = new EditReader(docgia);
                editreader.ShowDialog();
                listDocGia             = controller.getListDocGia();
                grcDSDocGia.DataSource = listDocGia;
            }
        }
예제 #2
0
        private void ProcessConfig()
        {
            frmUpdate frm = new frmUpdate();

            frm.Show();
        }