コード例 #1
0
        //common method to get booked college list by id or all....
        private List <AdmissionJankari.BO.BookSeat> GetBookedCollege(int?bookSeatId)
        {
            var objCounsulling  = new Consulling();
            var objBookSeatList = bookSeatId.HasValue
                                      ? objCounsulling.GetBookedCollegeByBookSeatId((int)bookSeatId).ToList()
                                      : objCounsulling.GetBookedCollege().ToList();

            return(objBookSeatList.ToList());
        }
コード例 #2
0
        //....method to get participated college.....
        private IEnumerable <BookSeat> GetCollegeListByQuery()
        {
            _objConsulling = new Consulling();
            var objCollegeBranchProperty = new List <BookSeat>();

            try
            {
                objCollegeBranchProperty =
                    _objConsulling.GetBookedCollege().Where(result => result.CourseMaster.CourseId == _objCommon.CourseId &&
                                                            ((!string.IsNullOrEmpty(result.BookSeatStartDate) ? DateTime.Parse(result.BookSeatStartDate) : DateTime.Now) >= DateTime.Now || (!string.IsNullOrEmpty(result.BookSeatEndDate) ? DateTime.Parse(result.BookSeatEndDate) : DateTime.Now) >= DateTime.Now) && result.BookSeatStatus == true).ToList();
                if (ddlState.SelectedIndex > 0)
                {
                    objCollegeBranchProperty = _objConsulling.GetBookedCollege().Where(result => result.CityMaster.StateId == Convert.ToInt32(ddlState.SelectedValue) &&
                                                                                       ((!string.IsNullOrEmpty(result.BookSeatStartDate) ? DateTime.Parse(result.BookSeatStartDate) : DateTime.Now) >= DateTime.Now || (!string.IsNullOrEmpty(result.BookSeatEndDate) ? DateTime.Parse(result.BookSeatEndDate) : DateTime.Now) >= DateTime.Now) && result.BookSeatStatus == true).ToList();
                }
                if (ddlCity.SelectedIndex > 0)
                {
                    objCollegeBranchProperty = _objConsulling.GetBookedCollege().Where(result => result.CityMaster.CityId == Convert.ToInt32(ddlCity.SelectedValue) &&
                                                                                       ((!string.IsNullOrEmpty(result.BookSeatStartDate) ? DateTime.Parse(result.BookSeatStartDate) : DateTime.Now) >= DateTime.Now || (!string.IsNullOrEmpty(result.BookSeatEndDate) ? DateTime.Parse(result.BookSeatEndDate) : DateTime.Now) >= DateTime.Now) && result.BookSeatStatus == true).ToList();
                }
                if (objCollegeBranchProperty.Count <= 0)
                {
                    objCollegeBranchProperty =
                        _objConsulling.GetBookedCollege().Where(result => result.CourseMaster.CourseId == _objCommon.CourseId &&
                                                                ((!string.IsNullOrEmpty(result.BookSeatStartDate) ? DateTime.Parse(result.BookSeatStartDate) : DateTime.Now) >= DateTime.Now || (!string.IsNullOrEmpty(result.BookSeatEndDate) ? DateTime.Parse(result.BookSeatEndDate) : DateTime.Now) >= DateTime.Now) && result.BookSeatStatus == true).ToList();
                }
            }
            catch (Exception ex)
            {
                var err = ex.Message;
                if (ex.InnerException != null)
                {
                    err = err + " :: Inner Exception :- " + ex.ToString();
                }
                const string addInfo = "Error while executing BindParticipatingCollege in UcParticipatedCollegeList.ascx  :: -> ";
                var          objPub  = new ClsExceptionPublisher();
                objPub.Publish(err, addInfo);
            }
            return(objCollegeBranchProperty);
        }
コード例 #3
0
        private void PagerPageIndexChanged(object sender, EventArgs e)
        {
            var objCounsulling = new Consulling();

            lblResult.Visible = false;
            try
            {
                var objBookSeatList = objCounsulling.GetBookedCollege().ToList();
                if (objBookSeatList.Count > 0)
                {
                    if (ddlCourseSearch.SelectedIndex > 0)
                    {
                        objBookSeatList =
                            objBookSeatList.Where(
                                x =>
                                x.CourseMaster.CourseId == Convert.ToInt32(ddlCourseSearch.SelectedValue))
                            .ToList();
                    }

                    if (objBookSeatList.Count > 0)
                    {
                        rptBookSeat.Visible = true;
                        ucCollegeList.BindDataWithPaging(rptBookSeat, Common.ConvertToDataTable(objBookSeatList));
                    }
                    else
                    {
                        lblResult.Visible   = true;
                        lblResult.CssClass  = "info";
                        lblResult.Text      = "Sorry,No college found";
                        rptBookSeat.Visible = false;
                    }
                }
                else
                {
                    lblResult.Visible   = true;
                    lblResult.CssClass  = "info";
                    lblResult.Text      = "Sorry,No college found";
                    rptBookSeat.Visible = false;
                }
            }
            catch (Exception ex)
            {
                var err = ex.Message;
                if (ex.InnerException != null)
                {
                    err = err + " :: Inner Exception :- " + ex.InnerException.Message;
                }
                const string addInfo = "Error in Executing  Pager_PageIndexChanged in CollegeList.aspx :: -> ";
                var          objPub  = new ClsExceptionPublisher();
                objPub.Publish(err, addInfo);
            }
        }
コード例 #4
0
        protected void ddlCourseSearch_SelectedIndexChanged(object sender, EventArgs e)
        {
            lblResult.Visible = false;
            var objCounsulling  = new Consulling();
            var objBookSeatList = objCounsulling.GetBookedCollege().ToList();

            if (ddlCourseSearch.SelectedIndex > 0)
            {
                objBookSeatList =
                    objBookSeatList.Where(
                        x =>
                        x.CourseMaster.CourseId == Convert.ToInt32(ddlCourseSearch.SelectedValue))
                    .ToList();
                if (objBookSeatList.Count > 0)
                {
                    ucCollegeList.Visible = true;
                    rptBookSeat.Visible   = true;
                    ucCollegeList.BindDataWithPaging(rptBookSeat, Common.ConvertToDataTable(objBookSeatList));
                }
                else
                {
                    lblResult.Visible     = true;
                    ucCollegeList.Visible = false;
                    lblResult.CssClass    = "info";
                    lblResult.Text        = "Sorry,No college found";
                    rptBookSeat.Visible   = false;
                }
            }
            else
            {
                if (objBookSeatList.Count > 0)
                {
                    rptBookSeat.Visible    = true;
                    rptBookSeat.DataSource = objBookSeatList;
                    rptBookSeat.DataBind();
                }
                else
                {
                    lblResult.Visible   = true;
                    lblResult.CssClass  = "info";
                    lblResult.Text      = "Sorry,No college found";
                    rptBookSeat.Visible = false;
                }
            }
        }
コード例 #5
0
        protected void BtnSearchClick(object sender, EventArgs e)
        {
            lblResult.Visible = false;
            var objCounsulling  = new Consulling();
            var objBookSeatList = objCounsulling.GetBookedCollege().ToList();

            if (!string.IsNullOrEmpty(txtCollegeSearch.Text))
            {
                objBookSeatList =
                    objBookSeatList.Where(
                        x =>
                        x.CollegeBasicInfo.CollegeBranchName.Trim().ToLower() == txtCollegeSearch.Text.Trim().ToLower())
                    .ToList();
                if (objBookSeatList.Count > 0)
                {
                    ucCollegeList.Visible = true;
                    rptBookSeat.Visible   = true;
                    ucCollegeList.BindDataWithPaging(rptBookSeat, Common.ConvertToDataTable(objBookSeatList));
                }
                else
                {
                    lblResult.Visible     = true;
                    ucCollegeList.Visible = false;
                    lblResult.CssClass    = "info";
                    lblResult.Text        = "Sorry,No college found";
                    rptBookSeat.Visible   = false;
                }
            }
            else
            {
                if (objBookSeatList.Count > 0)
                {
                    rptBookSeat.Visible    = true;
                    rptBookSeat.DataSource = objBookSeatList;
                    rptBookSeat.DataBind();
                }
                else
                {
                    lblResult.Visible   = true;
                    lblResult.CssClass  = "info";
                    lblResult.Text      = "Sorry,No college found";
                    rptBookSeat.Visible = false;
                }
            }
        }