public List<Application> GetApplicationDetails(string appId)
        {
            List<Application> appList = new List<Application>();
            SqlConnection connection = new SqlConnection(connectionString);

            string query = string.Format("Select  FaciID,Category,CatName,TimeSlot,StartDate,EndDate,UserName From Application_Det Where BookingStatus='Pending' and Status='Approved' and AppID='{0}'",appId);

            SqlCommand command = new SqlCommand(query, connection);

            SqlDataReader reader;
            connection.Open();
            reader = command.ExecuteReader();
            while (reader.Read())
            {
                Application app = new Application();
                app.FaciId = reader.GetValue(0).ToString();
                app.Category = reader.GetValue(1).ToString();
                app.CatName = reader.GetValue(2).ToString();
                app.TimeSlot= reader.GetValue(3).ToString();
                app.StartDate = reader.GetValue(4).ToString();
                app.EndDate = reader.GetValue(5).ToString();
                app.UserName = reader.GetValue(6).ToString();

                appList.Add(app);

            }
            connection.Close();
            return appList;
        }
        public List<Application> ShowReject()
        {
            SqlConnection connection = new SqlConnection(connectionString);
            string query = "Select appid,ASubject,OrgName,AppDetails,TimeSlot,StartDate,EndDate,Status,CatName From Booking_Det where status='Rejected'";
            SqlCommand command = new SqlCommand(query, connection);
            List<Application> appList = new List<Application>();
            SqlDataReader reader;
            connection.Open();
            reader = command.ExecuteReader();
            while (reader.Read())
            {
                Application app = new Application();
                app.AppId = reader.GetValue(0).ToString();
                app.Asubject = reader.GetValue(1).ToString();
                app.OrgName = reader.GetValue(2).ToString();
                app.Appdetails = reader.GetValue(3).ToString();
                app.TimeSlot = reader.GetValue(4).ToString();
                app.StartDate = reader.GetValue(5).ToString();
                app.EndDate = reader.GetValue(6).ToString();
                app.CatName = reader.GetValue(8).ToString();
                app.Status = reader.GetValue(7).ToString();

                appList.Add(app);
            }

            reader.Close();
            connection.Close();

            return (appList);
        }
        public List<Application> GetAllPendingApplication()
        {
            List<Application> appList = new List<Application>();
            SqlConnection connection = new SqlConnection(connectionString);

            string query = "Select distinct appid,ASubject,OrgName,Reason,UserName,ProcessDate From Application_Det Where BookingStatus='Pending' and Status='Approved'";
            SqlCommand command = new SqlCommand(query, connection);

            SqlDataReader reader;
            connection.Open();
            reader = command.ExecuteReader();
            while (reader.Read())
            {
                Application app = new Application();
                app.AppId = reader.GetValue(0).ToString();
                app.Asubject = reader.GetValue(1).ToString();
                app.OrgName = reader.GetValue(2).ToString();
                app.Remark = reader.GetValue(3).ToString();
                app.UserName = reader.GetValue(4).ToString();
                app.prrocessingTime =(DateTime) reader.GetValue(5);

                appList.Add(app);

            }
            connection.Close();
            return appList;
        }
        public List<Application> GetAllApplication()
        {
            List<Application> appList = new List<Application>();
            SqlConnection connection = new SqlConnection(connectionString);

            string query = "Select appid,ASubject,OrgName,AppDetails,TimeSlot,StartDate,EndDate,CatName,Status,FaciId From Application_Det Where Status='New'";
            SqlCommand command = new SqlCommand(query, connection);

            SqlDataReader reader;
            connection.Open();
            reader = command.ExecuteReader();
            while (reader.Read())
            {
                Application app = new Application();
                app.AppId = reader.GetValue(0).ToString();
                app.Asubject = reader.GetValue(1).ToString();
                app.OrgName = reader.GetValue(2).ToString();
                app.Appdetails = reader.GetValue(3).ToString();
                app.TimeSlot = reader.GetValue(4).ToString();
                app.StartDate = reader.GetValue(5).ToString();
                app.EndDate = reader.GetValue(6).ToString();
                app.CatName = reader.GetValue(7).ToString();
                app.Status = reader.GetValue(8).ToString();
                app.FaciId = reader.GetValue(9).ToString();

                appList.Add(app);

            }
            connection.Close();
            return appList;
        }