Exemple #1
0
        private void btn_ModifyClick(object sender, RoutedEventArgs e)
        {
            flg = false;

            Image btn = sender as Image;
            GuaranteeProcessView gpv = btn.DataContext as GuaranteeProcessView;
            GuaranteeProcess     gp  = new GuaranteeProcess();

            gp.GUID          = gpv.GUID;
            gp.ACTIVITY_GUID = gpv.ACTIVITY_GUID;
            gp.NAME          = gpv.NAME;
            gp.TASK          = gpv.TASK;
            gp.PHOTO         = gpv.PHOTO;
            gp.TYPE          = gpv.TYPE;
            MonitorEquipInput dlg = new MonitorEquipInput(gp);

            dlg.RefreshListEvent += () => { getGuaranteeProcessList(type); };
            dlg.ShowDialog(this);
        }
Exemple #2
0
        //public MonitorEquip(int p)
        //{
        //    InitializeComponent();


        //    GuaranteeProcess gp = new GuaranteeProcess();
        //    gp.NAME = "111";
        //    gp.TASK = "222";
        //    gpList.Add(gp);



        //    GuaranteeProcess gp1 = new GuaranteeProcess();
        //    gp1.NAME = "333";
        //    gp1.TASK = "444";
        //    gpList.Add(gp1);
        //    this.flc_ImgList.ItemsSource = gpList;
        //}

        //   public MonitorEquip(int mode)
        //{
        //    InitializeComponent();

        //    tb_Modify.Visibility = System.Windows.Visibility.Visible;
        //}

        private void GroupBox_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (!flg)
            {
                flg = true;
                return;
            }
            var groupBox             = (DevExpress.Xpf.LayoutControl.GroupBox)sender;
            GuaranteeProcessView gpv = groupBox.DataContext as GuaranteeProcessView;

            if (gpv.GUID == "add")
            {
                GuaranteeProcess gp = new GuaranteeProcess();
                gp.GUID          = Utility.NewGuid();
                gp.ACTIVITY_GUID = this.activityGuid;
                gp.TYPE          = type;
                MonitorEquipInput dlg = new MonitorEquipInput(gp);
                dlg.RefreshListEvent += () => { getGuaranteeProcessList(type); };
                dlg.ShowDialog(this);
            }
            else if (gpv.GUID == "import")
            {
                GuaranteeProcess gp = new GuaranteeProcess();
                gp.ACTIVITY_GUID = this.activityGuid;
                gp.TYPE          = type;
                ImportTask it = new ImportTask(gp);
                it.RefreshListEvent += () => { getGuaranteeProcessList(type); };
                it.ShowDialog(this);
            }
            else
            {
                if (IsVoide(gpv.NAME))
                {
                    string path = System.Windows.Forms.Application.StartupPath + "\\tempVideo\\";
                    if (!Directory.Exists(path))
                    {
                        Directory.CreateDirectory(path);
                    }
                    string filePath = path + gpv.NAME;
                    if (File.Exists(filePath))
                    {
                        if (MessageBox.Show("当前视频文件已存在,是否重新下载?", "消息提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                        {
                            if (DownLoadVideo(gpv.GUID))
                            {
                                Video video = new Video(filePath);
                                video.ShowDialog();
                            }
                            else
                            {
                                MessageBox.Show("视频下载失败", "消息提示");
                            }
                        }
                        else
                        {
                            Video video = new Video(filePath);
                            video.ShowDialog();
                        }
                    }
                    else
                    {
                        if (DownLoadVideo(gpv.GUID))
                        {
                            Video video = new Video(filePath);
                            video.ShowDialog();
                        }
                        else
                        {
                            MessageBox.Show("视频下载失败", "消息提示");
                        }
                    }
                }
                else
                {
                    groupBox.State = groupBox.State == GroupBoxState.Normal ? GroupBoxState.Maximized : GroupBoxState.Normal;
                }
            }
        }