void BindDivision()
        {
            using (DBKotaEstateDataContext obj = new DBKotaEstateDataContext())
            {
                var userList = (from n in obj.Users
                                orderby n.FirstName
                                select new { ID = n.UserId, UserName = n.FirstName + " " + n.LastName + "(" + n.UserType + n.UserId + ")" });

                //var cityDivision = KotaCoachings.DataAccess.DBAccess.GetDivisions();
                //listCityDivision = cityDivision;

                if (!ISAdding)
                {
                    drpRegion.DataSource     = userList;
                    drpRegion.DataTextField  = "UserName";
                    drpRegion.DataValueField = "Id";
                    drpRegion.DataBind();
                    drpRegion.Items.Add(new ListItem {
                        Value = "0", Text = "--Select User--", Selected = true
                    });
                }
            }


            KotaCoachings.DataAccess.DBAccess.BindAllPropertyType(drpPropertyType);
            KotaCoachings.DataAccess.DBAccess.BindAllLocationOfProperties(drpLocation);
        }
        public static UserDetailsDTO[] FillGridServices(string serviceId, string serviceTypeId, int pageIndex, int fistTime)
        {
            DBKotaEstateDataContext db = new DBKotaEstateDataContext();
            List <UserDetailsDTO>   list;

            if (fistTime == 1)
            {
                list = KotaCoachings.DataAccess.RealEstateServices.GetProviders(Convert.ToInt32(serviceId), Convert.ToInt32(serviceTypeId), 10, pageIndex, ref totalCount);
            }
            else
            {
                list = KotaCoachings.DataAccess.RealEstateServices.GetProviders(Convert.ToInt32(serviceId), Convert.ToInt32(serviceTypeId), 10, pageIndex);
            }

            //List<UserDetailsDTO> listDto = new List<UserDetailsDTO>();

            //foreach (Coaching dto in list)
            //{
            //    CoachingDTO obj = new CoachingDTO();
            //    obj.Id = dto.Id;
            //    obj.Name = dto.Name;
            //    obj.Phone = (dto.Phone == null) ? "" : dto.Phone;
            //    obj.Phone2 = (dto.Phone2 == null) ? "" : dto.Phone2;
            //    obj.Phone3 = (dto.Phone3 == null) ? "" : dto.Phone3;
            //    obj.Phone4 = (dto.Phone4 == null) ? "" : dto.Phone4;

            //    obj.Star = dto.Star??0;
            //    obj.Fax = (dto.Fax == null) ? "" : dto.Fax;
            //    obj.email = (dto.email == null) ? "" : dto.email;
            //    obj.Details = (dto.Details==null)?"":dto.Details;
            //    obj.Address = (dto.Address == null) ? "" : dto.Address;
            //    obj.Total = totalCount;
            //    obj.CoachingLogo = (dto.CoachingLogo == null) ? "" : dto.CoachingLogo;


            //    var courses = (from w in db.CoachingCourses
            //                   join u in db.Cources on w.CourseId equals u.Id
            //                   where (w.CoachingId == dto.Id)
            //                   select new { CourseName = u.Course });

            //    foreach (var item in courses)
            //    {
            //        obj.CourseList = string.IsNullOrEmpty(obj.CourseList) ? obj.CourseList + item.CourseName : obj.CourseList + "," + item.CourseName;
            //    }

            //    obj.CourseList = !string.IsNullOrEmpty(obj.CourseList)?"Provide Coaching for " + obj.CourseList: "";

            //    listDto.Add(obj);
            //}

            return(list.ToArray());
        }
Beispiel #3
0
        void BindDivision()
        {
            using (DBKotaEstateDataContext obj = new DBKotaEstateDataContext())
            {
                var userList = (from n in obj.Users
                                orderby n.FirstName
                                select new { ID = n.UserId, UserName = n.FirstName + " " + n.LastName + "(" + n.UserType + n.UserId + ")" });

                //var cityDivision = KotaCoachings.DataAccess.DBAccess.GetDivisions();
                //listCityDivision = cityDivision;

                if (!ISAdding)
                {
                }
            }


            //taCoachings.DataAccess.DBAccess.BindAllPropertyType(drpPropertyType);
        }
        protected void BindUsers(string userType)
        {
            using (DBKotaEstateDataContext obj = new DBKotaEstateDataContext())
            {
                var list = (from n in obj.Users

                            join L in obj.tblLocations
                            on n.LocationId equals L.Id into wlL
                            from F in wlL.DefaultIfEmpty()

                            where (userType == "" ? true : n.UserType == userType) &&
                            n.UserType != "N"
                            select new { ID = (n.UserType + n.UserId), UserName = n.FirstName + " " + n.LastName, Location = F.Location, UserType = n.UserType == "A" ? "Agent" : n.UserType == "B" ? "Builder" : n.UserType == "O" ? "Owner" : "Customer", ContactNo = n.mobile, Email = n.email, NoOfProjects = (from w in obj.Projects where w.BuilderId == n.UserId select w).Count(), NoOfProperties = (from w in obj.Properties where w.Owner == n.UserId where w.PostType == "SELL" select w).Count(), NoOfPostedRequirement = (from w in obj.Properties where w.Owner == n.UserId where w.PostType == "NEED" select w).Count() });

                lblTotal.Text      = list.Count().ToString();
                gvPrice.DataSource = list;
                gvPrice.DataBind();
            }
        }
        protected void BindProjects()
        {
            using (DBKotaEstateDataContext obj = new DBKotaEstateDataContext())
            {
                if ((from n in obj.Projects
                     join L in obj.tblLocations
                     on n.LocationId equals L.Id
                     where (drpRegion.SelectedValue == "0" ? true : n.BuilderId == Convert.ToInt32(drpRegion.SelectedValue)) &&
                     ((drpLocation.SelectedValue == "0" ? true : L.Id == Convert.ToInt32(drpLocation.SelectedValue)))
                     select n).Count() > 0)
                {
                    gvPrice.Visible = true;



                    var list = (from n in obj.Projects

                                join u in obj.Users
                                on n.BuilderId equals u.UserId

                                join L in obj.tblLocations
                                on n.LocationId equals L.Id
                                where (drpRegion.SelectedValue == "0" ? true : n.BuilderId == Convert.ToInt32(drpRegion.SelectedValue))

                                && ((drpPropertyType.SelectedValue == "0" ? true : n.Type == obj.tblMapProjectPropertyUnits.Where(e => e.PropertyTypeId == Convert.ToInt32(drpPropertyType.SelectedValue)).First().ProjectTypeId))


                                && ((drpLocation.SelectedValue == "0" ? true : L.Id == Convert.ToInt32(drpLocation.SelectedValue)))
                                select new { ID = ("PRJ" + n.Id), ProjectName = n.ProjectName, Location = L.Location, ProjectType = (n.Type == 1 ? "Multi Storied" : n.Type == 2 ? "Residential House" : n.Type == 3 ? "Residential Plot" : "Commercial Space"), Status = (n.Status == "1" ? "To be Started" : n.Status == "2" ? "Under Construction" : "Completed"), CreatedDate = n.CreatedOn, User = (u.FirstName + " " + u.LastName), Email = n.email, contact1 = n.mobile, contact2 = n.LandLine, contact3 = n.LandLine1, contact4 = n.LandLine2 });

                    lblTotal.Text = list.Count().ToString();

                    gvPrice.DataSource = list;
                    //n.CreatedOn.Value.ToString("dd/MMM/yy")
                    gvPrice.DataBind();
                }
                else
                {
                    gvPrice.Visible = false;
                }
            }
        }
Beispiel #6
0
        protected void BindReport()
        {
            using (DBKotaEstateDataContext obj = new DBKotaEstateDataContext())
            {
                int type = (rdAll.Checked) ? 0 : rdBuy.Checked ? 1 : 2;

                var proType = (from w in KotaCoachings.DataAccess.DBAccess.GetPropertyTypes()
                               where ((type == 0) ? true : w.GroupType == type)
                               select new
                {
                    Id = w.Id,
                    PropertyType = w.Name,
                    categoriey = (w.GroupType == 1 ? "Residential" : "Commercial"),
                    NoOfProjects = (from p in obj.Projects where p.Type == obj.tblMapProjectPropertyUnits.Where(e => e.PropertyTypeId == w.Id).First().ProjectTypeId select p).Count(),
                    NoOfProperties = (from pr in obj.Properties where pr.PropertyType == w.Id.ToString() where pr.PostType == "SELL" select w).Count(),
                    NoOfPostedRequirement = (from pr in obj.Properties where pr.PropertyType == w.Id.ToString() where pr.PostType == "NEED" select w).Count()
                });
                lblTotal.Text      = proType.Count().ToString();
                gvPrice.DataSource = proType;
                gvPrice.DataBind();
            }
        }
        protected void BindProjects()
        {
            using (DBKotaEstateDataContext obj = new DBKotaEstateDataContext())
            {
                string buyType = "";
                if (rdBuy.Checked)
                {
                    buyType = "S";
                }
                else if (rdRent.Checked)
                {
                    buyType = "R";
                }

                if ((from n in obj.Properties

                     join t in obj.PropertyTypes
                     on n.PropertyType equals t.Id.ToString()


                     join u in obj.Users
                     on n.Owner equals u.UserId

                     join L in obj.tblLocations
                     on n.LocationId equals L.Id into wlL
                     from F in wlL.DefaultIfEmpty()

                     where (drpRegion.SelectedValue == "0" ? true : n.Owner == Convert.ToInt32(drpRegion.SelectedValue)) &&
                     (drpLocation.SelectedValue == "0" ? true : F.Id == Convert.ToInt32(drpLocation.SelectedValue)) &&
                     (buyType == "" ? true : n.BuyType == buyType) &&
                     (drpPropertyType.SelectedValue == "0" ? true : t.Id.ToString() == drpPropertyType.SelectedValue)
                     select u).Count() > 0)
                {
                    gvPrice.Visible = true;

                    var list = (from n in obj.Properties

                                join t in obj.PropertyTypes
                                on n.PropertyType equals t.Id.ToString()


                                join u in obj.Users
                                on n.Owner equals u.UserId

                                join L in obj.tblLocations
                                on n.LocationId equals L.Id into wlL
                                from F in wlL.DefaultIfEmpty()

                                where (drpRegion.SelectedValue == "0" ? true : n.Owner == Convert.ToInt32(drpRegion.SelectedValue)) &&
                                (drpLocation.SelectedValue == "0" ? true : F.Id == Convert.ToInt32(drpLocation.SelectedValue)) &&
                                (buyType == "" ? true : n.BuyType == buyType) &&
                                (drpPropertyType.SelectedValue == "0" ? true : t.Id.ToString() == drpPropertyType.SelectedValue)
                                select new
                    {
                        ID = ("P" + n.BuyType + n.Id),
                        PropertyType = ((n.BedRoom > 0) ? (n.BedRoom + " BHK " + t.Name) : t.Name),
                        Area = (n.Area.ToString() + ((n.MeasureUnit == 1) ? "Square-Feet" :
                                                     n.MeasureUnit == 2 ? "Square-Meter" :
                                                     n.MeasureUnit == 3 ? "Square-Yard" :
                                                     n.MeasureUnit == 4 ? "Hectares" :
                                                     n.MeasureUnit == 5 ? "Acres" :
                                                     n.MeasureUnit == 6 ? "Bigha" : "")),
                        Price = n.Price + " INR",
                        RentOrSale = ((n.BuyType == "R") ? " on Rent" : " for Sale"),
                        Location = F.Location,
                        Address = n.Address,
                        CreatedDate = n.CreatedOn,
                        User = (u.FirstName + " " + u.LastName),
                        Email = u.email,
                        contact1 = u.mobile,
                        contact2 = u.LandLine,
                        contact3 = u.LandLine1,
                        contact4 = u.LandLine2
                    });

                    lblTotal.Text      = list.Count().ToString();
                    gvPrice.DataSource = list;
                    //n.CreatedOn.Value.ToString("dd/MMM/yy")



                    gvPrice.DataBind();
                }
                else
                {
                    gvPrice.Visible = false;
                }
            }
        }