Ejemplo n.º 1
0
        private void lbl_wodeshangchuan_Click(object sender, EventArgs e)
        {
            pb_shangchuangongxiang.Visible = false;
            pb_shangchuangeren.Visible     = true;

            _shareresult = false;
            //更新按钮样式
            lbl_gongxiang.ForeColor      = Color.Black;
            lbl_gongxiang.BackColor      = Color.White;
            lbl_wodeshangchuan.ForeColor = Color.White;
            lbl_wodeshangchuan.BackColor = Color.Gray;


            //获得所有共享资料
            var list = GetGerenwenjian(tb_kw.Text);

            //加载到Panelfujianzhong
            panel_fujian.Controls.Clear();

            foreach (JJFujianInfo s in list)
            {
                UCfujianInfo myuc = new UCfujianInfo(s)
                {
                    Dock = DockStyle.Top
                };
                panel_fujian.Controls.Add(myuc);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 点击共享文件按钮时触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lbl_gongxiang_Click(object sender, EventArgs e)
        {
            pb_shangchuangongxiang.Visible = true;
            pb_shangchuangeren.Visible     = false;
            _shareresult = true;

            //更新按钮样式
            lbl_gongxiang.ForeColor      = Color.White;
            lbl_gongxiang.BackColor      = Color.Gray;
            lbl_wodeshangchuan.ForeColor = Color.Black;
            lbl_wodeshangchuan.BackColor = Color.White;

            //获得所有共享资料
            var list = GetGongxiang(tb_kw.Text);

            //加载到Panelfujianzhong
            panel_fujian.Controls.Clear();
            foreach (JJFujianInfo s in list)
            {
                //如果登陆者是创建人或者在可见范围内,就新增这个uc
                var listp = Regex.Split(s._kejian, @"\|").ToList();
                if (listp.Contains(JJLoginInfo._shiming) || s._chuangjianren.Equals(JJLoginInfo._shiming))
                {
                    UCfujianInfo myuc = new UCfujianInfo(s)
                    {
                        Dock = DockStyle.Top
                    };
                    panel_fujian.Controls.Add(myuc);
                }
            }
        }
Ejemplo n.º 3
0
 private void panel_fujian_ControlRemoved(object sender, ControlEventArgs e)
 {
     list_fujian.Clear();
     foreach (Control c in panel_fujian.Controls)
     {
         UCfujianInfo myuc = c as UCfujianInfo;
         if (!list_fujian.Contains(myuc.file))
         {
             list_fujian.Add(myuc.path);
         }
     }
 }
Ejemplo n.º 4
0
        private async void pb_shangchuan_Click(object sender, EventArgs e)
        {
            pb_shangchuangongxiang.Visible = true;
            pb_shangchuangeren.Visible     = false;

            //上传共享文件

            OpenFileDialog ofd = new OpenFileDialog();

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                string file = Path.GetFileName(ofd.FileName);

                JJFujianInfo info = new JJFujianInfo()
                {
                    _wenjianming       = file,
                    _chuangjianren     = JJLoginInfo._shiming,
                    _quanlujing        = $"{uripath}/{file}",
                    _chuangjianshijian = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"),
                    _xiazaicishu       = 0,
                    _kejian            = string.Empty,
                    _leixing           = "共享"
                };



                //添加控件,显示正在上传
                UCfujianInfo myuc = new UCfujianInfo(info)
                {
                    Dock = DockStyle.Top
                };
                panel_fujian.Controls.Add(myuc);

                Application.DoEvents();
                //开始上传
                myuc.lbl_info.Visible = true;
                myuc.lbl_info.Text    = "正在上传……";
                Application.DoEvents();
                //UpSound_Request(uripath, ofd.FileName, "xxx.zip", progressBar1);
                await JJMethod.UpLoadFile(ofd.FileName, uripath, false);

                InsertFile(info);

                //上传完之后,不显示正在上传
                myuc.lbl_info.Text    = string.Empty;
                myuc.lbl_info.Visible = false;
            }
        }
Ejemplo n.º 5
0
        public UCchengguo(JJchengguoInfo ji)
        {
            InitializeComponent();
            myinfo = ji;
            tb_guanjianchengguo.Text = ji._guanjianchengguo;
            tb_jutiyaoqiu.Text       = ji._jutiyaoqiu;
            //加载附件
            foreach (string s in Regex.Split(ji._fujian, @"\|"))
            {
                UCfujianInfo myuc = new UCfujianInfo(s)
                {
                    Dock = DockStyle.Top
                };
                uCfujian1.panel_fujian.Controls.Add(myuc);
            }

            dtp_shixian.Text         = ji._shixian;
            tb_banliyijian.Text      = ji._banliyijian;
            tb_banlirenyuan.Text     = ji._banlirenyuan;
            tb_jinzhanqingkuang.Text = ji._jinzhanqingkuang;
        }
Ejemplo n.º 6
0
        private void pb_shangchuan_Click(object sender, EventArgs e)
        {
            //选择文件
            OpenFileDialog ofd = new OpenFileDialog();

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                //实例化ucfujianinfo
                UCfujianInfo myuc = new UCfujianInfo(ofd.FileName)
                {
                    Dock = DockStyle.Top
                };
                panel_fujian.Controls.Add(myuc);
            }



            ////构造存放位置路径
            //string str_path = "http://" + $"49.233.40.109/常规事项/{JJLoginInfo._huaming}/";
            ////string str_path = "http://" + $"49.233.40.109/haahah/";
            ////上传
            //JJMethod.UpLoadFile(str, str_path, false);
        }