Ejemplo n.º 1
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        //lay do luong phieu dang ky trong ngay
        PhieuDangKyControl pdkctr      = new PhieuDangKyControl();
        DateTime           ngay        = UCNgay.NgayThang;
        DateTime           ngayhientai = DateTime.Now;


        //if (DateTime.Compare(ngay ,ngayhientai)==-1)
        //{
        //    lbThongBaoDK.Text = "Ngay Dang ky Phai la ngay tuong lai";
        //    btDK.Enabled = false;
        //    return;        //}


        int sl = pdkctr.DemSLBenhNhanDKTrongNgay(ngay);

        lbSoNguoi.Text = sl.ToString();
        // hoi xem so luong nguoi dang ky co nho hon so luong nguoi toi da ko
        if (sl < int.Parse(lbSLNguoi.Text))
        {
            // moi cho dang ky
            //lbThongBaoDK.Text = " Dang Ky Thanh Cong";
        }
        else
        {
            lbThongBaoDK.Text = " Het Cho Dang ky, Chon Ngay khac Di";
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DataService._ConnectionString = ConfigurationManager.ConnectionStrings["QLConnectionString"].ConnectionString;

        if ((int)Session["Login"] == 0)
        {
            Response.Redirect("~/DangNhap.aspx");
        }
        if ((string)Session["LoaiNguoiDung"] == "Bac si")
        {
            Response.Redirect("~/KhongCoChucNang.aspx");
        }
        ThamSoControl tsctr  = new ThamSoControl();
        ThamSoInfo    tsinfo = new ThamSoInfo();

        tsinfo         = tsctr.spLayThongTinBangThamSoCoMa(1);// so nguoi dang ky toi da
        lbSLNguoi.Text = tsinfo.GiaTri.ToString();
        PhieuDangKyControl pdkctr = new PhieuDangKyControl();
        //if (!IsPostBack)

        DateTime ngaytam = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
        {
            int sl = pdkctr.DemSLBenhNhanDKTrongNgay(ngaytam);
            lbSoNguoi.Text = sl.ToString();
        }
    }
Ejemplo n.º 3
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        // lay ma benh nhan tu ma dang nhap ma tai khoan
        int             MaNguoiLon;
        int             MaTK     = (int)Session["MaTK"];
        NguoiLonControl nglonctr = new NguoiLonControl();

        MaNguoiLon = nglonctr.MaBenhNhanKhiBietMaTK(MaTK);
        // luu vao phieu dang ky
        PhieuDangKyControl pdkctr = new PhieuDangKyControl();
        PhieuDangKyInfo    pdkinf = new PhieuDangKyInfo();

        pdkinf.MaBenhNhan = MaNguoiLon;
        pdkinf.Ngay       = UCNgay.NgayThang;
        pdkinf.TrieuChung = txtTCnguoilon.Text;
        // them phieu dang ky
        try
        {
            pdkctr.sp_ThemPhieuDangKy(pdkinf);
            // lay ma phieu dang ky len
            // int SoTT = pdkctr.LayMaPhieuDangKyTuMaBenhNhan(MaNguoiLon, pdkinf.Ngay);
            int SoTT = pdkctr.DemSLBenhNhanDKTrongNgay(UCNgay.NgayThang);
            lbSoDiKham.Text = "Số đi khám bệnh là :" + SoTT.ToString();
            int SoLuongNguoi = int.Parse(lbSoNguoi.Text);
        }
        catch
        {
        }
    }
Ejemplo n.º 4
0
    protected void btDangKy_Click(object sender, EventArgs e)
    {
        // kiem tra so luong nguoi da dang ky trong ngay
        PhieuDangKyControl pdkctr = new PhieuDangKyControl();
        int           SluongDK    = pdkctr.DemSLBenhNhanDKTrongNgay(UCNgayThangNam2.NgayThang);
        ThamSoControl tsctr       = new ThamSoControl();
        ThamSoInfo    tsinfo      = new ThamSoInfo();

        tsinfo = tsctr.spLayThongTinBangThamSoCoMa(1);
        int SLDKToiDa = tsinfo.GiaTri;

        if (SluongDK > SLDKToiDa)
        {
            // khong cho dang ky
            Label1.Text = "So Luong DK Vuot Muc cho Phep,Chon Ngay Khac Di";
            return;
        }
        Label1.Text = "";
        int             MaNguoiLon;
        int             MaTK     = (int)Session["MaTK"];
        NguoiLonControl nglonctr = new NguoiLonControl();

        MaNguoiLon = nglonctr.MaBenhNhanKhiBietMaTK(MaTK);

        //dang ky cho tre em

        // lay ma nguoi lon dang online= ma nguoi lon
        //  int MaBenhNhan = 3;
        BenhNhanControl ctrBN  = new BenhNhanControl();
        BenhNhanInfo    infoBN = new BenhNhanInfo();

        infoBN.Ten      = txtHotenTre.Text;
        infoBN.NgaySinh = UCNgayThangNam1.NgayThang;
        infoBN.DiaChi   = txtDiachi.Text;
        if (ckNam.Checked == true)
        {
            infoBN.Phai = "Nam";
        }
        else
        {
            infoBN.Phai = "Nu";
        }
        ctrBN.ThemThongTinBenhNhan(infoBN);


        //nhap cac thong tin
        //luu xuong bang benh nhan

        //lay ma tre em vua moi luu= ma benh nhan

        //lay ma nguoi lon= ma nguoi lon dang Online
        TreEmControl ctrTE  = new TreEmControl();
        TreEmInfo    infoTE = new TreEmInfo();

        //int MaNguoiLon = 3;
        infoBN            = ctrBN.ThongTinBenhNhanVuaThem();
        infoTE.MaBenhNhan = infoBN.Ma;
        infoTE.MaNguoiLon = MaNguoiLon;
        ctrTE.ThemTreEm(infoTE);
        // lb.Text = "Them Thanh Cong Benh Nhan Tre Em";
        // luu xuong bang tre em

        //luu xuong bang Dang ky
        PhieuDangKyControl ctrpdk  = new PhieuDangKyControl();
        PhieuDangKyInfo    infopdk = new PhieuDangKyInfo();

        infopdk.MaBenhNhan = MaNguoiLon;
        infopdk.Ngay       = UCNgayThangNam2.NgayThang;
        infopdk.TrieuChung = txtTCtreem.Text;
        ctrpdk.sp_ThemPhieuDangKy(infopdk);
        int soluong = ctrpdk.DemSLBenhNhanDKTrongNgay(infopdk.Ngay);

        lbsoluong.Text = soluong.ToString();
        Label2.Text    = "Them Thanh Cong Dang ky ";
    }