コード例 #1
0
        static void Main(string[] args)
        {
            //RoomType room = new RoomType
            //{
            //    BaseRate = 300,
            //    Type = ROOM_TYPE.QueenRoom,
            //    Inventory = 50,
            //    Ameneties = "am",
            //    Description = "desc",
            //    ImageUrl = "img"
            //};
            //RoomRepository roomRepo = new RoomRepository(new HotelModelContext());
            //roomRepo.InsertRoom(room);
            //roomRepo.Save();

            ReservationHandler reservationHandler = new ReservationHandler();
            RoomHandler        roomHandler        = new RoomHandler();
            Guid confirmation = reservationHandler.MakeReservation(
                "root",
                ROOM_TYPE.QueenRoom,
                DateTime.Today,
                DateTime.Today.AddDays(5),
                new List <Guest> {
                new Guest
                {
                    FirstName = "oot",
                    LastName  = "R",
                }
            },
                roomHandler.GetRoomPriceList(ROOM_TYPE.QueenRoom, DateTime.Today, DateTime.Today.AddDays(5))
                );

            Console.WriteLine(confirmation);
            Console.ReadKey();
        }
コード例 #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }
            app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseRouting();
            app.UseAuthentication();
            app.UseAuthorization();


            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
                endpoints.MapRazorPages();
            });

            //Connectionstring binder

            CarDatabaseHandler.SetConnectionString(ConnectionString);
            ReservationHandler.SetConnectionString(ConnectionString);
        }
コード例 #3
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            A_Handler = new ReservationHandler();
            A1        = new Reservation();


            //A1.Res_id = Convert.ToInt32(txtRes_id.Text);
            A1.Reg_id         = 1;
            A1.Res_date       = DateTime.Now;
            A1.Book_title     = txtBook_title.Text;
            A1.Book_author    = txtBook_author.Text;
            A1.Book_publisher = txtBook_publisher.Text;
            A1.Mem_id         = Convert.ToInt32(Label2.Text);
            A1.Status         = 1;



            if (btnSubmit.Text == "Submit")
            {
                bool B = A_Handler.AddNewReservation(A1);
                if (B == true)
                {
                    Label1.Text = "Your Reservation Successfully";
                    MSG         = "Your Reservation Successfully";
                }
                else
                {
                    Label1.Text = "Your Reservation Not Successfully";
                    MSG         = "Your Reservation Not Successfully";
                }
            }


            //Response.Redirect("~/ADMIN/Reservation_list.aspx?msg="+MSG);
        }
コード例 #4
0
 private void bindLog()
 {
     ReservationHandler h = new ReservationHandler();
     DataTable dt =h.ReadLog(DateTime.Parse(Request["date"]));
     Repeater1.DataSource = dt;
     Repeater1.DataBind();
 }
コード例 #5
0
        private void bindLog()
        {
            ReservationHandler h  = new ReservationHandler();
            DataTable          dt = h.ReadLog(DateTime.Parse(Request["date"]));

            Repeater1.DataSource = dt;
            Repeater1.DataBind();
        }
コード例 #6
0
        public MainWindow()
        {
            InitializeComponent();
            Title = "Klarup HalBooking hovedvindue";
            ReservationHandler ReservationHandler = new ReservationHandler();

            DGReservations.ItemsSource = ReservationHandler.GetAllReservations();
            Program p = new Program();
        }
コード例 #7
0
        public void GetAllReservationsTest()
        {
            //Arrange and Act
            ReservationHandler reservationHandler = new ReservationHandler();
            var a = reservationHandler.GetAllReservations();

            //Assert
            Assert.AreEqual(3, a.Count);
        }
コード例 #8
0
 public static string[] GetEmployeeByStoreNum(string strStoreNum)
 {
     string[] numList = null;
     if (string.IsNullOrEmpty(strStoreNum)) return numList;
     DataTable table = new ReservationHandler().LoadEmployeeDataByStoreNum(strStoreNum);
     if (table == null) return numList;
     numList = new string[table.Rows.Count];
     for (int i = 0; i < table.Rows.Count; i++)
         numList[i] = table.Rows[i]["employeeNum"].ToString().Trim() + table.Rows[i]["employeeName"].ToString().Trim();
     return numList;
 }
コード例 #9
0
 public void CanProcessRequest()
 {
     using (var mgr = ContextManager.StartRequest(1600, "reservation.ashx", "http://lnf-dev.eecs.umich.edu/sselscheduler/ajax/reservation.ashx", "Command=test&ReservationID=0"))
     {
         var handler = new ReservationHandler();
         handler.ProcessRequest(HttpContext.Current);
         var content = mgr.GetResponse();
         var result  = ServiceProvider.Current.Serialization.Json.DeserializeAnonymous(content, new { Error = false, Message = "" });
         Assert.AreEqual(result.Error, false);
         Assert.AreEqual(result.Message, "ok");
     }
 }
コード例 #10
0
        private void BtnAcceptReservation_Click(object sender, RoutedEventArgs e)
        {
            ReservationHandler         ReservationHandler         = new ReservationHandler();
            AcceptedReservationHandler AcceptedReservationHandler = new AcceptedReservationHandler();

            Reservation         res  = (Reservation)DGReservations.SelectedItem;
            AcceptedReservation ares = new AcceptedReservation()
            {
                AdminId = currentAdmin.Id, ReservationsId = res.Id
            };

            AcceptedReservationHandler.Add(ares);
            res.Accepted = true;
            ReservationHandler.Update(res);
            DGReservations.Items.Refresh();
        }
コード例 #11
0
        protected void btnShow_Click(object sender, EventArgs e)
        {
            fld       = cboSearch.SelectedValue.ToString();
            txt       = txtSearch.Text;
            A_Handler = new ReservationHandler(); sql = "select * from " + Tbl_Name + " where COLLEGE_ID =" + cid + " and " + fld + " like '" + txt + "%' ";
            //Grid1.DataSource = A_Handler.GetReservationList(sql);
            //Grid1.DataBind();

            SqlDataSource1.SelectCommand = sql;
            SqlDataSource1.DataBind();
            if (Grid1.Rows.Count > 0)
            {
                lblRec.Text = "Total Records : " + Grid1.Rows.Count.ToString();
            }
            else
            {
                lblRec.Text = "Record Not Found...";
            }
        }
コード例 #12
0
        static public string[] GetEmployeeByStoreNum(string strStoreNum)
        {
            string[] numList = null;
            if (string.IsNullOrEmpty(strStoreNum))
            {
                return(numList);
            }
            DataTable table = new ReservationHandler().LoadEmployeeDataByStoreNum(strStoreNum);

            if (table == null)
            {
                return(numList);
            }
            numList = new string[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                numList[i] = table.Rows[i]["employeeNum"].ToString().Trim() + table.Rows[i]["employeeName"].ToString().Trim();
            }
            return(numList);
        }
コード例 #13
0
        public void show_data(int ID)
        {
            A_Handler = new ReservationHandler();
            A1        = new Reservation();
            A1        = A_Handler.GetReservationDetails(ID);


            txtRes_id.Text = A1.Res_id.ToString();

            ddlReg_id.Text = A1.Reg_id.ToString();

            txtRes_date.Text = A1.Res_date.ToString();

            txtBook_title.Text = A1.Book_title.ToString();

            txtBook_author.Text = A1.Book_author.ToString();

            txtBook_publisher.Text = A1.Book_publisher.ToString();

            ddlMem_id.Text = A1.Mem_id.ToString();

            DropDownList1.SelectedValue = A1.Status.ToString();

            btnSubmit.Text = "Update";
            btnReset.Text  = "Cancel";

            if (Request.QueryString["action"] == "del")
            {
                Label1.Text                = "Are U Sure, U want to  Delete a Record ?";
                txtRes_id.ReadOnly         = true;
                ddlReg_id.Enabled          = false;
                txtRes_date.ReadOnly       = false;
                txtBook_title.ReadOnly     = false;
                txtBook_author.ReadOnly    = false;
                txtBook_publisher.ReadOnly = false;
                ddlMem_id.Enabled          = false;
                DropDownList1.Enabled      = false;
                btnSubmit.Text             = "Delete";
            }
        }
コード例 #14
0
 public ReservationController()
 {
     _reservationHandler = new ReservationHandler();
     _roomHandler        = new RoomHandler();
     _userHandler        = new AspNetUserHandler();
 }
コード例 #15
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            A_Handler = new ReservationHandler();
            A1        = new Reservation();


            //A1.Res_id = Convert.ToInt32(txtRes_id.Text);
            A1.Reg_id         = Convert.ToInt32(ddlReg_id.SelectedValue);
            A1.Res_date       = Convert.ToDateTime(txtRes_date.Text);
            A1.Book_title     = txtBook_title.Text;
            A1.Book_author    = txtBook_author.Text;
            A1.Book_publisher = txtBook_publisher.Text;
            A1.Mem_id         = Convert.ToInt32(ddlMem_id.SelectedValue);
            A1.Status         = Convert.ToInt32(DropDownList1.SelectedValue);



            if (btnSubmit.Text == "Submit")
            {
                bool B = A_Handler.AddNewReservation(A1);
                if (B == true)
                {
                    Label1.Text = "Record Inserted";
                    MSG         = "Record Inserted";
                }
                else
                {
                    Label1.Text = "Record Not Inserted";
                    MSG         = "Record Not Inserted";
                }
            }
            else if (btnSubmit.Text == "Update")
            {
                A1.Res_id = Convert.ToInt32(txtRes_id.Text);
                bool B = A_Handler.UpdateReservation(A1);
                if (B == true)
                {
                    Label1.Text = "Record Updated";
                    MSG         = "Record Not Updated";
                }
                else
                {
                    Label1.Text = "Record Not Updated";
                    MSG         = "Record Not Updated";
                }
            }
            else if (btnSubmit.Text == "Delete")
            {
                A1.Res_id = Convert.ToInt32(txtRes_id.Text);
                bool B = A_Handler.DeleteReservation(A1);
                if (B == true)
                {
                    Label1.Text = "Record Deleted";
                    MSG         = "Record Deleted";
                }
                else
                {
                    Label1.Text = "Record Not Deleted";
                    MSG         = "Record Not Deleted";
                }
            }

            //Response.Redirect("~/ADMIN/Reservation_list.aspx?msg="+MSG);
        }
コード例 #16
0
 public StaffController()
 {
     _reservationHandler = new ReservationHandler();
     _roomHandler        = new RoomHandler();
 }