public JsonResult PublicSearch(SearchParam param)
        {
            string[] pubList = dc.Set <T_ResourcePublic>().Where(a => a.Status != 6).Select(a => a.ResourceID).ToArray();
            var      list    = dc.Set <V_Resource>().Where(a => !pubList.Contains(a.ID));

            if (!string.IsNullOrEmpty(param.Park))
            {
                list = list.Where(a => a.Loc1 == param.Park);
            }
            else
            {
                list = list.Where(a => ParkList.Contains(a.Loc1));
            }
            if (!string.IsNullOrEmpty(param.ID))
            {
                list = list.Where(a => a.ID.Contains(param.ID));
            }
            if (!string.IsNullOrEmpty(param.Name))
            {
                list = list.Where(a => a.Name.Contains(param.Name));
            }
            if (!string.IsNullOrEmpty(param.Group))
            {
                list = list.Where(a => a.GroupID == param.Group);
            }
            if (param.Kind != null)
            {
                list = list.Where(a => a.ResourceKindID == param.Kind);
            }
            int count = list.Count();

            list = list.OrderBy(a => a.ResourceKindID).Skip((param.PageIndex - 1) * param.PageSize).Take(param.PageSize);
            return(Json(new { count = count, data = list.ToList() }, JsonRequestBehavior.AllowGet));
        }
        public JsonResult Search(SearchParam param)
        {
            var list = dc.Set <V_Stage>().Where(a => ParkList.Contains(a.ParkID));

            if (!string.IsNullOrEmpty(param.Park))
            {
                list = list.Where(a => a.ParkID == param.Park);
            }
            if (!string.IsNullOrEmpty(param.ID))
            {
                list = list.Where(a => a.ID.Contains(param.ID));
            }
            if (!string.IsNullOrEmpty(param.Name))
            {
                list = list.Where(a => a.Name.Contains(param.Name));
            }
            if (param.Enable != null)
            {
                list = list.Where(a => a.Enable == param.Enable);
            }
            int count = list.Count();

            list = list.OrderBy(a => a.ID).Skip((param.PageIndex - 1) * param.PageSize).Take(param.PageSize);
            return(Json(new { count = count, data = list.ToList() }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Search(SearchParam param)
        {
            var list = dc.Set <V_Resource>().Where(a => a.ResourceKindID == 4 && ParkList.Contains(a.Loc1));

            if (!string.IsNullOrEmpty(param.Park))
            {
                list = list.Where(a => a.Loc1 == param.Park);
            }
            if (!string.IsNullOrEmpty(param.ID))
            {
                list = list.Where(a => a.ID.Contains(param.ID));
            }
            if (!string.IsNullOrEmpty(param.Name))
            {
                list = list.Where(a => a.Name.Contains(param.Name));
            }
            if (!string.IsNullOrEmpty(param.Cust))
            {
                list = list.Where(a => a.CustLongName.Contains(param.Cust));
            }
            if (!string.IsNullOrEmpty(param.Group))
            {
                list = list.Where(a => a.GroupName.Contains(param.Group));
            }
            int count = list.Count();

            list = list.OrderBy(a => a.ID).Skip((param.PageIndex - 1) * param.PageSize).Take(param.PageSize);
            return(Json(new { count = count, data = list.ToList() }, JsonRequestBehavior.AllowGet));
        }
        public JsonResult Search(SearchParam param)
        {
            var list = dc.Set <V_Resource>().Where(a => a.ResourceKindID == 3 && ParkList.Contains(a.Loc1));

            if (!string.IsNullOrEmpty(param.Park))
            {
                list = list.Where(a => a.Loc1 == param.Park);
            }
            if (!string.IsNullOrEmpty(param.ID))
            {
                list = list.Where(a => a.ID.Contains(param.ID));
            }
            if (!string.IsNullOrEmpty(param.Name))
            {
                list = list.Where(a => a.Name.Contains(param.Name));
            }
            int count = list.Count();

            list = list.OrderBy(a => a.ID).Skip((param.PageIndex - 1) * param.PageSize).Take(param.PageSize);
            var obj = list.Select(a => new
            {
                a.ID,
                a.Name,
                a.Loc1Name,
                a.ResourceTypeName,
                a.GroupName,
                a.Enable,
                a.RangeNum
            }).ToList();

            return(Json(new { count = count, data = obj }, JsonRequestBehavior.AllowGet));
        }
        public void WhenIClickOnAParkPicture()
        {
            ParkList listPage = ScenarioContext.Current.Get <ParkList>("CurrentPage");

            ParkDetail detailPage = listPage.ClickImage_GetDetail();

            ScenarioContext.Current.Set(detailPage, "CurrentPage");
        }
        public void GivenIAmOnTheParkListPage()
        {
            ParkList page = new ParkList(driver);

            page.Navigate();

            ScenarioContext.Current.Set(page, "CurrentPage");
        }
        public ContentResult Search(SearchParam param)
        {
            //园区字段
            string park = string.Empty;

            if (!string.IsNullOrEmpty(param.Park))
            {
                park = param.Park;
            }
            else
            {
                park = ParkList.FirstOrDefault();
            }

            var list       = dc.Set <V_Resource>().Where(a => a.ResourceKindID == 2 && a.Loc1 == park);
            var cbTypeList = list
                             .GroupBy(a => new { a.ResourceTypeID, a.ResourceTypeName })
                             .OrderBy(a => a.Key.ResourceTypeName)
                             .Select(a => new { a.Key.ResourceTypeID, a.Key.ResourceTypeName })
                             .ToList();
            List <object> resObjcet = new List <object>();

            foreach (var item in cbTypeList)
            {
                var rmList = list
                             .Where(a => a.ResourceTypeID == item.ResourceTypeID)
                             .GroupBy(a => new { a.Loc5, a.Loc5Name })
                             .Select(a => new { a.Key.Loc5, a.Key.Loc5Name })
                             .ToList();
                List <object> rmObjList = new List <object>();
                foreach (var it in rmList)
                {
                    var cb = list.Where(a => a.Loc5 == it.Loc5)
                             .Select(a => new
                    {
                        a.ID,
                        a.Name,
                        a.RentStatus,
                        a.Loc1,
                        a.RentBeginTime,
                        a.RentEndTime,
                        a.CustShortName,
                        a.CustTel,
                        a.RentArea
                    }).ToList();
                    rmObjList.Add(new { RID = it.Loc5, RName = it.Loc5Name, CB = cb });
                }
                resObjcet.Add(new { TID = item.ResourceTypeID, TName = item.ResourceTypeName, RM = rmObjList });
            }
            JsonSerializerSettings setting = new JsonSerializerSettings
            {
                DateFormatString = "yyyy-MM-dd"
            };
            var obj = JsonConvert.SerializeObject(resObjcet, setting).Replace("null", "\"\"");

            return(Content(obj));
        }
        public void ClickPark_GetDetailView()
        {
            ParkList page = new ParkList(driver);

            page.Navigate();

            ParkDetail result = page.ClickImage_GetDetail();

            Assert.IsNotNull(result);
        }
示例#9
0
        public ContentResult Search(SearchParam param)
        {
            string park = string.Empty;
            var    list = dc.Set <V_Resource>().Where(a => a.ResourceKindID == 1);

            if (!string.IsNullOrEmpty(param.Park))
            {
                park = param.Park;
            }
            else
            {
                park = ParkList.FirstOrDefault();
            }
            list = list.Where(a => a.Loc1 == park);
            if (!string.IsNullOrEmpty(param.Name))
            {
                list = list.Where(a => a.Name.Contains(param.Name));
            }
            if (!string.IsNullOrEmpty(param.Cust))
            {
                list = list.Where(a => a.CustLongName.Contains(param.Cust));
            }
            if (param.Status != null)
            {
                list = list.Where(a => a.Status == param.Status);
            }
            var bulidList = dc.Set <V_Building>().Where(a => a.ParkID == park).Select(a => new { a.ID, a.Name }).ToList();
            var floorList = dc.Set <V_Floor>().Where(a => a.ParkID == park).Select(a => new { a.ID, a.Name, BID = a.BuildingID }).ToList();
            var rmList    = list.Select(a => new
            {
                a.ID,
                a.Name,
                a.Status,
                a.RentBeginTime,
                a.RentEndTime,
                a.CustShortName,
                a.CustTel,
                a.RentArea,
                a.Loc4
            }).ToList();
            JsonSerializerSettings setting = new JsonSerializerSettings
            {
                DateFormatString = "yyyy-MM-dd"
            };
            var obj = JsonConvert.SerializeObject(new
            {
                park   = park,
                blist  = bulidList,
                flist  = floorList,
                rmlist = rmList
            }, setting).Replace("null", "\"\"");

            return(Content(obj));
        }
        public ContentResult Search(SearchParam param)
        {
            var list = dc.Set <V_Public>().Where(a => ParkList.Contains(a.Loc1));

            if (!string.IsNullOrEmpty(param.Park))
            {
                list = list.Where(a => a.Loc1 == param.Park);
            }
            if (!string.IsNullOrEmpty(param.ID))
            {
                list = list.Where(a => a.ResourceID.Contains(param.ID));
            }
            if (!string.IsNullOrEmpty(param.Name))
            {
                list = list.Where(a => a.ResourceName.Contains(param.Name));
            }
            if (!string.IsNullOrEmpty(param.Group))
            {
                list = list.Where(a => a.GroupID == param.Group);
            }
            if (param.Stime != null)
            {
                list = list.Where(a => a.UpdateTime >= param.Stime);
            }
            if (param.Etime != null)
            {
                list = list.Where(a => a.UpdateTime <= param.Etime);
            }
            if (param.Kind != null)
            {
                list = list.Where(a => a.ResourceKindID == param.Kind);
            }
            if (param.Status != null)
            {
                list = list.Where(a => a.Status == param.Status);
            }
            int count = list.Count();

            list = list.OrderByDescending(a => a.UpdateTime).Skip((param.PageIndex - 1) * param.PageSize).Take(param.PageSize);
            JsonSerializerSettings setting = new JsonSerializerSettings
            {
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
                DateFormatString      = "yyyy-MM-dd HH:mm"
            };
            var obj = JsonConvert.SerializeObject(new { count = count, data = list.ToList() }, setting);

            return(Content(obj));
        }
示例#11
0
        public JsonResult Search(SearchParam param)
        {
            var list = from a in dc.Set <T_ResourceGroup>()
                       join b in dc.Set <T_Park>() on a.ParkID equals b.ID into t1
                       from park in t1.DefaultIfEmpty()
                       join c in dc.Set <T_ResourceKind>() on a.ResourceKindID equals c.ID into t2
                       from type in t2.DefaultIfEmpty()
                       select new
            {
                a.ID,
                a.Name,
                a.ParkID,
                a.ResourceKindID,
                a.Enable,
                ParkName         = park.Name,
                ResourceKindName = type.Name
            };

            if (!string.IsNullOrEmpty(param.Park))
            {
                list = list.Where(a => a.ParkID == param.Park);
            }
            else
            {
                list = list.Where(a => ParkList.Contains(a.ParkID));
            }
            if (!string.IsNullOrEmpty(param.ID))
            {
                list = list.Where(a => a.ID.Contains(param.ID));
            }
            if (!string.IsNullOrEmpty(param.Name))
            {
                list = list.Where(a => a.Name.Contains(param.Name));
            }
            if (param.Kind != null)
            {
                list = list.Where(a => a.ResourceKindID == param.Kind);
            }
            if (param.Enable != null)
            {
                list = list.Where(a => a.Enable == param.Enable);
            }
            int count = list.Count();

            list = list.OrderBy(a => a.ID).Skip((param.PageIndex - 1) * param.PageSize).Take(param.PageSize);
            return(Json(new { count = count, data = list.ToList() }, JsonRequestBehavior.AllowGet));
        }
示例#12
0
 public IActionResult ParkImages(int ParkNumber, string parkName)
 {
     if (ParkNumber > 0 && ParkNumber < 60)
     {
         dynamic ParkImagesAndDetails = new ExpandoObject();
         var     ParkList             = new ParkList();
         ParkList.ParkNumber = ParkNumber;
         ParkList.ParkName   = parkName;
         ParkImagesAndDetails.ParkDetails = ParkList;
         var parkImages = _repository.GetParkImages(ParkNumber);
         ParkImagesAndDetails.ParkImages = parkImages;
         return(View(ParkImagesAndDetails));
     }
     else
     {
         return(Error());
     }
 }
        public ActionResult RSSearch(SearchParam param)
        {
            var list = dc.Set <V_Resource>().Where(a => a.Enable == true);

            if (!string.IsNullOrEmpty(param.Park))
            {
                list = list.Where(a => a.Loc1 == param.Park);
            }
            else
            {
                list = list.Where(a => ParkList.Contains(a.Loc1));
            }
            if (!string.IsNullOrEmpty(param.ID))
            {
                list = list.Where(a => a.ID.Contains(param.ID));
            }
            if (!string.IsNullOrEmpty(param.Name))
            {
                list = list.Where(a => a.Name.Contains(param.Name));
            }
            if (!string.IsNullOrEmpty(param.Group))
            {
                list = list.Where(a => a.GroupID == param.Group);
            }
            if (param.Kind != null)
            {
                list = list.Where(a => a.ResourceKindID == param.Kind);
            }
            int count = list.Count();

            list = list.OrderByDescending(a => a.ResourceKindID).Skip((param.PageIndex - 1) * param.PageSize).Take(param.PageSize);
            var result = list.Select(a => new { a.ID, a.Name, a.Loc1Name, a.GroupName, a.RentArea });
            var obj    = JsonConvert.SerializeObject(new { count = count, data = result.ToList() });

            return(Content(obj));
        }
        public ActionResult Search(SearchParam param)
        {
            var list = dc.Set <V_ResourceStatus>().Where(a => true);

            if (!string.IsNullOrEmpty(param.Park))
            {
                list = list.Where(a => a.Loc1 == param.Park);
            }
            else
            {
                list = list.Where(a => ParkList.Contains(a.Loc1));
            }
            if (!string.IsNullOrEmpty(param.ID))
            {
                list = list.Where(a => a.ResourceID.Contains(param.ID));
            }
            if (!string.IsNullOrEmpty(param.Name))
            {
                list = list.Where(a => a.ResourceName.Contains(param.Name));
            }
            if (!string.IsNullOrEmpty(param.Group))
            {
                list = list.Where(a => a.GroupID == param.Group);
            }
            if (param.Kind != null)
            {
                list = list.Where(a => a.ResourceKindID == param.Kind);
            }
            if (param.IType != null)
            {
                list = list.Where(a => a.BusinessType == param.IType);
            }
            if (param.Status != null)
            {
                list = list.Where(a => a.Status == param.Status);
            }
            if (param.Stime != null)
            {
                list = list.Where(a => param.Stime <= a.RentEndTime && param.Etime >= a.RentBeginTime);
            }
            int count = list.Count();

            list = list.OrderByDescending(a => a.RentBeginTime).Skip((param.PageIndex - 1) * param.PageSize).Take(param.PageSize);
            var result = list.Select(a => new
            {
                a.ID,
                a.SysID,
                a.Status,
                a.ResourceID,
                a.ResourceName,
                a.ResourceKindName,
                a.GroupName,
                a.Loc1Name,
                a.RentType,
                a.BusinessType,
                a.CustShortName,
                a.RentBeginTime,
                a.RentEndTime,
                a.UpdateTime,
                a.UpdateUser
            });
            JsonSerializerSettings setting = new JsonSerializerSettings
            {
                DateFormatString = "yyyy-MM-dd HH:mm"
            };
            var obj = JsonConvert.SerializeObject(new { count = count, data = result.ToList() }, setting).Replace(" 00:00", "");

            return(Content(obj));
        }
示例#15
0
        public ActionResult Search(SearchParam param)
        {
            try
            {
                if (param.Stime == null)
                {
                    return(Json(Result.Fail(msg: "请选择时间!"), JsonRequestBehavior.AllowGet));
                }
                DateTime begin       = Convert.ToDateTime(Convert.ToDateTime(param.Stime).ToString("yyyy-MM-dd") + " 09:00:00");
                DateTime end         = Convert.ToDateTime(Convert.ToDateTime(param.Stime).ToString("yyyy-MM-dd") + " 21:00:00");
                DateTime selectTime1 = begin.Date;
                DateTime selectTime2 = begin.Date.AddDays(1);
                string   tableStr    = string.Empty;
                string   detailStr   = string.Empty;
                var      crList      = dc.Set <V_Resource>().Where(a => a.ResourceKindID == 3 && ParkList.Contains(a.Loc1));
                //会议室数据
                if (!string.IsNullOrEmpty(param.Park))
                {
                    crList = crList.Where(a => a.Loc1 == param.Park);
                }
                var crTable = crList.Select(a => new { a.ID, a.Name }).ToList();
                if (crTable.Count() <= 0)
                {
                    tableStr += "<tr><td colspan='25' style='text-align:center;'>暂无数据</td></tr>";
                }
                foreach (var item in crTable)//遍历会议室
                {
                    var tempTime = begin;

                    tableStr += string.Format("<tr><td>{0}</td>", item.Name);

                    var statusList = dc.Set <V_ResourceStatus>()
                                     .Where(a => a.ResourceID == item.ID && selectTime1 < a.RentBeginTime && a.RentEndTime < selectTime2)
                                     .OrderBy(a => a.RentBeginTime)
                                     .ToList();
                    if (statusList.Count() > 0)
                    {
                        //存在数据
                        foreach (var status in statusList)
                        {
                            if (status.RentBeginTime <= tempTime)//小于正常开始时间
                            {
                                if (status.RentEndTime <= end)
                                {
                                    tableStr += TimeSplit(tempTime, status.RentEndTime, status);
                                    tempTime  = Convert.ToDateTime(status.RentEndTime);
                                }
                                else//大于正常结束时间
                                {
                                    tableStr += TimeSplit(tempTime, end, status);
                                    tempTime  = end;
                                }
                            }
                            else
                            {
                                tableStr += TimeSplit(tempTime, Convert.ToDateTime(status.RentBeginTime), null); //空隙
                                if (end < status.RentEndTime)                                                    //超越正常时间
                                {
                                    tableStr += TimeSplit(tempTime, end, status);
                                    tempTime  = end;
                                }
                                else
                                {
                                    tableStr += TimeSplit(Convert.ToDateTime(status.RentBeginTime), Convert.ToDateTime(status.RentEndTime), status);
                                    tempTime  = Convert.ToDateTime(status.RentEndTime);
                                }
                            }

                            //状态详情组装
                            detailStr += string.Format(@"<div class='detail' data-id='{0}'>
                                                                <p><span>资源编号:</span><span>{1}</span></p>
                                                                <p><span>公司(个人):</span><span>{2}</span></p>
                                                                <p><span>联系电话:</span><span>{3}</span></p>
                                                                <p><span>开始时间:</span>{4}<span></span></p>
                                                                <p><span>结束时间:</span>{5}<span></span></p>
                                                                </div>",
                                                       status.ID,
                                                       status.ResourceID,
                                                       status.CustLongName,
                                                       status.CustTel,
                                                       status.RentBeginTime,
                                                       status.RentEndTime);
                        }
                        if (tempTime < end)//时间刻度数据组装:后面空格
                        {
                            tableStr += TimeSplit(tempTime, end, null);
                        }
                    }
                    else
                    {
                        //没有数据
                        tableStr += TimeSplit(begin, end, null);
                    }
                }

                return(Json(new { Flag = 1, table = tableStr, detail = detailStr }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(Result.Exception(exmsg: ex.StackTrace), JsonRequestBehavior.AllowGet));
            }
        }