Ejemplo n.º 1
0
        public string Get_PageInfo(QueryCommon <TechnicalInfoQuery_Web> query)
        {
            if (query.ParamInfo.Type > 0)
            {
                query.ParamInfo.EndTime = DateTime.Now.Date;
            }
            //else
            //{
            //    query.ParamInfo.StartTime = query.ParamInfo.StartTime.Date;
            //    query.ParamInfo.EndTime = query.ParamInfo.EndTime.Date.AddDays(1);
            //}

            Result_Model <PageInfo> resModel    = new Result_Model <PageInfo>();
            ITechnicalInfoService   jobsService = ServiceHelper.Create <ITechnicalInfoService>();

            resModel = jobsService.Get_PageInfo_Web(query);
            return(Newtonsoft.Json.JsonConvert.SerializeObject(resModel));
        }
Ejemplo n.º 2
0
        public Result_List <Result_Model <TechnicalInfo> > Get_PreNext_ById_Web(long Id)
        {
            Result_List <Result_Model <TechnicalInfo> > res = new Result_List <Result_Model <TechnicalInfo> >();

            try
            {
                ITechnicalInfoService jobsService = ServiceHelper.Create <ITechnicalInfoService>();
                res = jobsService.Get_PreNext_ById_Web(Id);
            }
            catch (Exception ex)
            {
                res.Msg = new Result_Msg()
                {
                    IsSuccess = false, Message = "Failed to read, cause of failure :" + ex.Message
                };
            }

            return(res);
        }
Ejemplo n.º 3
0
        public Result_List <Result_AttachmentInfo> GetObjectList_ById_Web(long Id)
        {
            Result_List <Result_AttachmentInfo> res = new Result_List <Result_AttachmentInfo>();

            try
            {
                ITechnicalInfoService jobsService = ServiceHelper.Create <ITechnicalInfoService>();
                res = jobsService.GetObjectList_ById_Web(Id);
                //res.List.Select(x => x.FileName == System.IO.Path.GetFileName(x.AttachmentName));
            }
            catch (Exception ex)
            {
                res.Msg = new Result_Msg()
                {
                    IsSuccess = false, Message = "Failed to read, cause of failure :" + ex.Message
                };
            }

            return(res);
        }
Ejemplo n.º 4
0
        public string MeetingsList_Web(QueryCommon <TechnicalInfoQuery_Web> query)
        {
            if (query.ParamInfo.Type > 0)
            {
                query.ParamInfo.EndTime = DateTime.Now.Date;
            }
            //else
            //{
            //    query.ParamInfo.StartTime = query.ParamInfo.StartTime.Date;
            //    query.ParamInfo.EndTime = query.ParamInfo.EndTime.Date.AddDays(1);
            //}

            ITechnicalInfoService jobsService                = ServiceHelper.Create <ITechnicalInfoService>();
            Result_List_Pager <Result_TechnicalInfo> res     = jobsService.GetMeetingsList_Web(query);
            List <Result_AttachmentInfo>             resItem = new List <Result_AttachmentInfo>();

            foreach (var item in res.List)
            {
                resItem = GetObjectList_ById_Web(item.Id).List.Where(x => x.AttachmentName != null && x.AttachmentName != "" && x.AttachmentName.LastIndexOf('.') > 0).ToList();
                if (resItem != null && resItem.Count > 0)
                {
                    Result_AttachmentInfo imgItem = resItem.Where(x => HashSet_Common.ImageTypeArr.Contains(x.AttachmentName.Substring(x.AttachmentName.LastIndexOf('.'), x.AttachmentName.Length - x.AttachmentName.LastIndexOf('.')))).FirstOrDefault();
                    if (imgItem != null)
                    {
                        item.AttachmentName = imgItem.AttachmentName;
                    }
                    else
                    {
                        item.AttachmentName = "";
                    }
                }
                else
                {
                    item.AttachmentName = "";
                }
            }

            return(Newtonsoft.Json.JsonConvert.SerializeObject(res));
        }
Ejemplo n.º 5
0
        public string GetObjectById_Web(int Id)
        {
            Result_Model_TechAttachmentList_PreNextRow resAll = new Result_Model_TechAttachmentList_PreNextRow()
            {
                Model          = new Result_TechnicalInfo(),
                AttachmentList = new Result_List <Result_AttachmentInfo>(),
                Msg            = new Result_Msg()
                {
                    IsSuccess = true, Message = string.Empty
                },
                PreNextRow = new Result_List <Result_Model <TechnicalInfo> >()
            };

            try
            {
                ITechnicalInfoService jobsService = ServiceHelper.Create <ITechnicalInfoService>();
                resAll.Model = jobsService.GetObjectById_Web(Id);
                if (resAll.Model != null && resAll.Msg.IsSuccess)
                {
                    resAll.AttachmentList = GetObjectList_ById_Web(Id);
                    if (!resAll.AttachmentList.Msg.IsSuccess)
                    {
                        resAll.Msg.IsSuccess = false;
                        resAll.Msg.Message  += "Failed to obtain a list of attachments \n\r";
                    }
                    else
                    {
                        foreach (var item in resAll.AttachmentList.List)
                        {
                            try
                            {
                                item.FileName = item.AttachmentName.Substring(item.AttachmentName.LastIndexOf('/') + 1, item.AttachmentName.Length - item.AttachmentName.LastIndexOf('/') - 1);
                            }
                            catch (Exception)
                            {
                                item.FileName = "附件信息获取失败";
                            }
                        }
                    }
                    resAll.PreNextRow = Get_PreNext_ById_Web(Id);
                    if (!resAll.PreNextRow.Msg.IsSuccess)
                    {
                        resAll.Msg.IsSuccess = false;
                        resAll.Msg.Message  += "Get the last page, the next page \n\r";
                    }
                }
                else
                {
                    resAll.Msg.IsSuccess = false;
                    resAll.Msg.Message  += "Failed to get conference data \n\r";
                }
            }
            catch (Exception ex)
            {
                resAll.Msg = new Result_Msg()
                {
                    IsSuccess = false, Message = "Failed to read, cause of failure :" + ex.Message
                };
            }

            return(Newtonsoft.Json.JsonConvert.SerializeObject(resAll));
        }