예제 #1
0
        private void pbBtn_Click(object sender, EventArgs e)
        {
            PanelEx           pxBtn = (PanelEx)sender;
            mMeetingResources model = (mMeetingResources)pxBtn.Tag;

            ShowForm(model.ResourcesType, model.ResourcesName + model.ResourcesType);
        }
예제 #2
0
        public static List <mMeetingResources> GetResourcesList(int meetingId, int userId)
        {
            List <mMeetingResources> list  = new List <mMeetingResources>();
            mMeetingResources        model = null;
            string sql = @"select Id,ResourcesName,ResourcesType,MeetingIssueId,Directory from 
            m_MeetingResources where MeetingIssueId=@meetingId";

            SqlParameter[] paras = new SqlParameter[]
            {
                new SqlParameter("@meetingId", meetingId)
            };

            SqlDataReader reader = SQLHelper.GetReader(sql, paras);

            while (reader.Read())
            {
                model                = new mMeetingResources();
                model.Id             = Tool.ToInt(reader["Id"].ToString());
                model.ResourcesName  = reader["ResourcesName"].ToString();
                model.ResourcesType  = reader["ResourcesType"].ToString();
                model.MeetingIssueId = Tool.ToInt(reader["MeetingIssueId"].ToString());
                model.Directory      = reader["Directory"].ToString();
                list.Add(model);
            }

            return(list);
        }
예제 #3
0
        public static int InsertModel(mMeetingResources model)
        {
            string sql = string.Format(@"insert into m_MeetingResources(ResourcesName,ResourcesType,MeetingIssueId,Directory)
                                  values('{0}','{1}','{2}','{3}')", model.ResourcesName, model.ResourcesType, model.Directory, model.Directory);

            return(SQLHelper.ExcuteSQL(sql));
        }
예제 #4
0
        private void AddImageContro(string fileUrl, string safile)
        {
            mMeetingResources model = new mMeetingResources();

            if (num > 0)
            {
                panelX = panelX - 135;
                labelX = labelX - 130;
            }

            PanelEx panel = new PanelEx();

            panel.Width    = 91;
            panel.Height   = 90;
            panel.Location = new Point(panelX, 47);

            Label label = new Label();

            label.Text     = safile;
            label.Width    = 120;
            label.Height   = 12;
            label.Location = new Point(labelX, 146);
            if (safile.Contains(".doc") || safile.Contains(".docx"))
            {
                panel.BackgroundImage = Resources.文本资料;
                //model.ResourcesType = 1;
            }

            if (safile.Contains(".txt"))
            {
                panel.BackgroundImage = Resources.文本资料;
                //model.ResourcesType = 1;
            }

            if (safile.Contains(".jpg") || safile.Contains(".png"))
            {
                panel.BackgroundImage = Resources.图片资料;
                //model.ResourcesType = 2;
            }

            if (safile.Contains(".mp3") || safile.Contains(".mp4"))
            {
                panel.BackgroundImage = Resources.音频资料;
                //model.ResourcesType = 3;
            }

            panelEx4.Controls.Add(panel);
            panelEx4.Controls.Add(label);
            num++;

            model.ResourcesName = safile;
            model.ResourcesUrl  = fileUrl;

            resources.Add(model);
        }
        public JsonResult Index()
        {
            mMeetingResources model = new mMeetingResources();
            //model.Directory = (iMeeting.GetMeetingMaxId()+1).ToString();

            string msg = "";

            var files = Request.Files[0];

            if (files != null)
            {
                //string saveUrl = string.Format("{0}{1}",Consts.SaveUrlPath, model.Directory);

                //model.ResourcesType = Path.GetExtension(files.FileName);
                //model.ResourcesName = DateTime.Now.ToString("yyyyMMddHHmmsss");


                string saveUrl = string.Format("{0}", Consts.TemporaryPath);

                //model.ResourcesType = Path.GetExtension(files.FileName);
                //model.ResourcesName = Path.GetFileNameWithoutExtension(files.FileName);

                if (!Directory.Exists(saveUrl))
                {
                    Directory.CreateDirectory(saveUrl);
                }

                //files.SaveAs(saveUrl + "\\" + model.ResourcesName + model.ResourcesType);
                files.SaveAs(saveUrl + "\\" + files.FileName);

                msg = "上传成功";

                //if (iResources.InsertModel(model) > 0)
                //{
                //    msg = "上传成功";
                //}
                //else
                //{
                //    msg = "上传失败";
                //}
            }
            return(Json(msg));
        }
예제 #6
0
        public static List <mMeetingResources> GetMeetingResources(int issueid)
        {
            List <mMeetingResources> list  = new List <mMeetingResources>();
            mMeetingResources        model = null;

            string sql = string.Format(@"select Id,ResourcesName,ResourcesType,MeetingIssueId 
                              from [dbo].[m_MeetingResources] where MeetingIssueId='{0}'", issueid);

            SqlDataReader reader = SQLHelper.GetReader(sql);

            while (reader.Read())
            {
                model                = new mMeetingResources();
                model.Id             = Convert.ToInt32(reader["Id"]);
                model.ResourcesName  = reader["ResourcesName"].ToString();
                model.ResourcesType  = reader["ResourcesType"].ToString();
                model.MeetingIssueId = Convert.ToInt32(reader["MeetingIssueId"]);
                list.Add(model);
            }

            return(list);
        }
 public int InsertModel(mMeetingResources model)
 {
     return(MeetingResourcesDao.InsertModel(model));
 }
예제 #8
0
 private void panelEx3_Click(object sender, EventArgs e)
 {
     PanelEx           pxBtn = (PanelEx)sender;
     mMeetingResources model = (mMeetingResources)pxBtn.Tag;
 }