Example #1
0
        /// <summary>
        /// 生成附件集合List
        /// </summary>
        /// <param name="ComAttachXML">附件信息</param>
        /// <param name="NoticeId">通知编号</param>
        /// <param name="ItemType">附件类型</param>
        /// <returns></returns>
        private IList <Eyousoft_yhq.Model.Attach> GetAttachList(string ComAttachXML, string NoticeId)
        {
            if (string.IsNullOrEmpty(ComAttachXML))
            {
                return(null);
            }
            IList <Eyousoft_yhq.Model.Attach> ResultList = null;

            ResultList = new List <Eyousoft_yhq.Model.Attach>();
            XElement root = XElement.Parse(ComAttachXML);
            IEnumerable <XElement> xRow = root.Elements("row");

            foreach (XElement tmp1 in xRow)
            {
                Eyousoft_yhq.Model.Attach model = new Eyousoft_yhq.Model.Attach()
                {
                    Name       = tmp1.Attribute("Name").Value,
                    FilePath   = tmp1.Attribute("FilePath").Value,
                    Size       = int.Parse(tmp1.Attribute("Size").Value),
                    ItemId     = NoticeId,
                    IsWebImage = this.GetBoolean(tmp1.Attribute("IsWebImage").Value)
                };
                ResultList.Add(model);
                model = null;
            }
            return(ResultList);
        }
Example #2
0
        /// <summary>
        /// 附件操作
        /// </summary>
        /// <returns>附件列表</returns>
        private IList <Eyousoft_yhq.Model.Attach> NewGetAttach()
        {
            IList <Eyousoft_yhq.Model.Attach> lst = new List <Eyousoft_yhq.Model.Attach>();

            #region 手机端图片处理
            //新上传附件
            string[] upload = Utils.GetFormValues(this.UploadControl1.ClientHideID);
            if (upload.Length != 0)
            {
                for (int i = 0; i < upload.Length; i++)
                {
                    string[] newupload = upload[i].Split('|');
                    if (newupload != null && newupload.Length > 1)
                    {
                        Eyousoft_yhq.Model.Attach attModel = new Eyousoft_yhq.Model.Attach();
                        attModel.FilePath   = newupload[1];
                        attModel.Name       = newupload[0];
                        attModel.IsWebImage = false;
                        lst.Add(attModel);
                    }
                }
            }
            else
            {
                //之前上传的附件
                string stroldupload = Utils.GetFormValue("hideFileInfo");

                if (!string.IsNullOrEmpty(stroldupload))
                {
                    string[] oldupload = stroldupload.Split(',');
                    if (oldupload != null && oldupload.Length > 0)
                    {
                        for (int i = 0; i < oldupload.Length; i++)
                        {
                            if (!string.IsNullOrEmpty(oldupload[i]))
                            {
                                string[] uploaditem = oldupload[i].Split('|');
                                Eyousoft_yhq.Model.Attach attModel = new Eyousoft_yhq.Model.Attach();
                                attModel.Name       = uploaditem[0];
                                attModel.FilePath   = uploaditem[1];
                                attModel.IsWebImage = bool.Parse(uploaditem[2]);
                                lst.Add(attModel);
                            }
                        }
                    }
                }
            }
            #endregion



            return(lst);
        }
Example #3
0
 public bool Update(Eyousoft_yhq.Model.Attach model)
 {
     throw new NotImplementedException();
 }
Example #4
0
        /// <summary>
        /// 附件操作
        /// </summary>
        /// <returns>附件列表</returns>
        private IList<Eyousoft_yhq.Model.Attach> NewGetAttach()
        {
            IList<Eyousoft_yhq.Model.Attach> lst = new List<Eyousoft_yhq.Model.Attach>();
            #region 手机端图片处理
            //新上传附件
            string[] upload = Utils.GetFormValues(this.upload1.ClientHideID);
            if (upload.Length != 0)
            {
                for (int i = 0; i < upload.Length; i++)
                {
                    string[] newupload = upload[i].Split('|');
                    if (newupload != null && newupload.Length > 1)
                    {
                        Eyousoft_yhq.Model.Attach attModel = new Eyousoft_yhq.Model.Attach();
                        attModel.FilePath = newupload[1];
                        attModel.Name = newupload[0];
                        attModel.IsWebImage = false;
                        lst.Add(attModel);
                    }
                }
            }
            else
            {
                //之前上传的附件
                string stroldupload = Utils.GetFormValue("hideFileInfo");

                if (!string.IsNullOrEmpty(stroldupload))
                {
                    string[] oldupload = stroldupload.Split(',');
                    if (oldupload != null && oldupload.Length > 0)
                    {
                        for (int i = 0; i < oldupload.Length; i++)
                        {
                            if (!string.IsNullOrEmpty(oldupload[i]))
                            {
                                string[] uploaditem = oldupload[i].Split('|');
                                Eyousoft_yhq.Model.Attach attModel = new Eyousoft_yhq.Model.Attach();
                                attModel.Name = uploaditem[0];
                                attModel.FilePath = uploaditem[1];
                                attModel.IsWebImage = bool.Parse(uploaditem[2]);
                                lst.Add(attModel);
                            }
                        }
                    }
                }
            }
            #endregion

            #region 网站端图片处理
            //新上传网站附件
            string[] upload2 = Utils.GetFormValues(this.upload2.ClientHideID);
            if (upload2.Length != 0)
            {
                for (int i = 0; i < upload2.Length; i++)
                {
                    string[] newupload = upload2[i].Split('|');
                    if (newupload != null && newupload.Length > 1)
                    {
                        Eyousoft_yhq.Model.Attach attModel = new Eyousoft_yhq.Model.Attach();
                        attModel.FilePath = newupload[1];
                        attModel.Name = newupload[0];
                        attModel.IsWebImage = true;
                        lst.Add(attModel);
                    }
                }
            }
            else
            {
                //之前上传的网站附件
                string stroldwebupload = Utils.GetFormValue("hideWebFileInfo");
                if (!string.IsNullOrEmpty(stroldwebupload))
                {
                    string[] oldupload = stroldwebupload.Split(',');
                    if (oldupload != null && oldupload.Length > 0)
                    {
                        for (int i = 0; i < oldupload.Length; i++)
                        {
                            if (!string.IsNullOrEmpty(oldupload[i]))
                            {
                                string[] uploaditem = oldupload[i].Split('|');
                                Eyousoft_yhq.Model.Attach attModel = new Eyousoft_yhq.Model.Attach();
                                attModel.Name = uploaditem[0];
                                attModel.FilePath = uploaditem[1];
                                attModel.IsWebImage = bool.Parse(uploaditem[2]);
                                lst.Add(attModel);
                            }
                        }
                    }
                }
            }

            #endregion

            return lst;
        }
Example #5
0
 /// <summary>
 /// 生成附件集合List
 /// </summary>
 /// <param name="ComAttachXML">附件信息</param>
 /// <param name="NoticeId">通知编号</param>
 /// <param name="ItemType">附件类型</param>
 /// <returns></returns>
 private IList<Eyousoft_yhq.Model.Attach> GetAttachList(string ComAttachXML, string NoticeId)
 {
     if (string.IsNullOrEmpty(ComAttachXML)) return null;
     IList<Eyousoft_yhq.Model.Attach> ResultList = null;
     ResultList = new List<Eyousoft_yhq.Model.Attach>();
     XElement root = XElement.Parse(ComAttachXML);
     IEnumerable<XElement> xRow = root.Elements("row");
     foreach (XElement tmp1 in xRow)
     {
         Eyousoft_yhq.Model.Attach model = new Eyousoft_yhq.Model.Attach()
         {
             Name = tmp1.Attribute("Name").Value,
             FilePath = tmp1.Attribute("FilePath").Value,
             Size = int.Parse(tmp1.Attribute("Size").Value),
             ItemId = NoticeId,
             IsWebImage = this.GetBoolean(tmp1.Attribute("IsWebImage").Value)
         };
         ResultList.Add(model);
         model = null;
     }
     return ResultList;
 }