Пример #1
0
        ////全选
        //private void checkAll_Click(object sender, RoutedEventArgs e)
        //{
        //    CheckBox cb = (CheckBox)sender;
        //    CheckAllRecord(cb);
        //}
        //public void CheckAllRecord(CheckBox cb)
        //{
        //    if (List.ItemsSource != null)
        //    {
        //        //CheckBox cb = (CheckBox)sender;
        //        if (cb.IsChecked == true)//全选
        //        {
        //            foreach (object ovj in List.ItemsSource)
        //            {
        //                CheckBox cb1 = List.Columns[5].GetCellContent(ovj).FindName("singnCheck") as CheckBox; //cb为
        //                cb1.IsChecked = true;
        //            }
        //        }
        //        else//取消
        //        {
        //            foreach (object obj in List.ItemsSource)
        //            {
        //                CheckBox cb2 = List.Columns[5].GetCellContent(obj).FindName("singnCheck") as CheckBox;

        //                cb2.IsChecked = false;
        //            }
        //        }
        //    }
        //}

        private void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
        {
            if (AutoInitReadOnlyControl)
            {
                UserConfig uc = new SMT.FileUpLoad.Classes.UserConfig();
                uc.CompanyCode            = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                uc.SystemCode             = SystemCode;
                uc.ModelCode              = ModelCode;
                uc.UserID                 = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                uc.ApplicationID          = FormId;
                uc.NotShowThumbailChckBox = true;

                uc.NotShowUploadButton = true;
                uc.NotShowDeleteButton = true;
                uc.NotAllowDelete      = true;
                uc.NotShowDeleteButton = true;

                uc.Multiselect = true;
                uc.Filter      = "所有文件 (*.*)|*.*";
                //uc.Filter = "图片文件(*.jpg,*.gif,*.bmp)|*.jpg;*.gif;*.bmp";
                uc.MaxConcurrentUploads = 5;
                uc.MaxSize    = "20.MB";
                uc.CreateName = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
                uc.PageSize   = 20;
                Init(uc);
            }
        }
Пример #2
0
       public void Init(UserConfig uc)
       {
           usc = uc;
           if (uc.NotShowUploadButton)
           {
               btnUp.Visibility = Visibility.Collapsed;
           }
           SystemCode = uc.SystemCode;
           ModelCode = uc.ModelCode;
           UserID = uc.UserID;
           ApplicationID = uc.ApplicationID;
           IsLimitCompanyCode = uc.IsLimitCompanyCode;
           Client.GetFileListByOnlyApplicationIDAsync(ApplicationID);
           //if (IsLimitCompanyCode)
           //{

           //    Client.GetFileListByApplicationIDAsync(uc.CompanyCode, uc.SystemCode, uc.ModelCode, uc.ApplicationID, uc.OnlyShowMySelf == true ? uc.CreateName : null);  //获取文件列表
           //}
           //else
           //{
           //    Client.GetFileListByApplicationIDAsync(string.Empty, uc.SystemCode, uc.ModelCode, uc.ApplicationID, uc.OnlyShowMySelf == true ? uc.CreateName : null);  //获取文件列表
           //}
       }
Пример #3
0
        ////全选
        //private void checkAll_Click(object sender, RoutedEventArgs e)
        //{
        //    CheckBox cb = (CheckBox)sender;
        //    CheckAllRecord(cb);
        //}
        //public void CheckAllRecord(CheckBox cb)
        //{
        //    if (List.ItemsSource != null)
        //    {
        //        //CheckBox cb = (CheckBox)sender;
        //        if (cb.IsChecked == true)//全选
        //        {
        //            foreach (object ovj in List.ItemsSource)
        //            {
        //                CheckBox cb1 = List.Columns[5].GetCellContent(ovj).FindName("singnCheck") as CheckBox; //cb为
        //                cb1.IsChecked = true;
        //            }
        //        }
        //        else//取消
        //        {
        //            foreach (object obj in List.ItemsSource)
        //            {
        //                CheckBox cb2 = List.Columns[5].GetCellContent(obj).FindName("singnCheck") as CheckBox;

        //                cb2.IsChecked = false;
        //            }
        //        }
        //    }
        //}

        private void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
        {
            if (AutoInitReadOnlyControl)
            {
                UserConfig uc = new SMT.FileUpLoad.Classes.UserConfig();
                uc.CompanyCode = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                uc.SystemCode = SystemCode;
                uc.ModelCode = ModelCode;
                uc.UserID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                uc.ApplicationID = FormId;
                uc.NotShowThumbailChckBox = true;

                uc.NotShowUploadButton = true;
                uc.NotShowDeleteButton = true;
                uc.NotAllowDelete = true;
                uc.NotShowDeleteButton = true;

                uc.Multiselect = true;
                uc.Filter = "所有文件 (*.*)|*.*";
                //uc.Filter = "图片文件(*.jpg,*.gif,*.bmp)|*.jpg;*.gif;*.bmp";
                uc.MaxConcurrentUploads = 5;
                uc.MaxSize = "20.MB";
                uc.CreateName = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
                uc.PageSize = 20;
                Init(uc);
            }
        }
Пример #4
0
        public FileUploadWindow2(UserConfig uc)
        {//第1步(初始化条件)

            InitializeComponent();
            if (uc != null)
            {
                NotShowDeleteButton = uc.NotShowDeleteButton;
            }
            this.OverlayOpacity = 0;
            #region 用户定义设置          
           // this.SmtFileListId = Guid.NewGuid().ToString();// uc.SmtFileListId;//主键ID
            this.CustomFileName = uc.CustomFileName;//文件名(用户自定义)         
            this.FileUrl = uc.FileUrl;//文件地址
            this.CompanyCode = uc.CompanyCode;//公司代号
            this.CompanyName = uc.CompanyName;//公司名字
            this.SystemCode = uc.SystemCode;//系统代号
            this.ModelCode = uc.ModelCode;//模块代号
            this.ApplicationID = uc.ApplicationID;//业务ID
            this.ThumbnailUrl = uc.ThumbnailUrl;//缩略图地址
            this.Indexl =uc.Indexl;//排序
            this.Remark = uc.Remark;//备注
            this.CreateTime =String.IsNullOrEmpty(uc.CreateTime.ToString())?uc.CreateTime: DateTime.Now;//创建时间
            this.CreateName = uc.CreateName;//创建人
            this.UpdateTime = String.IsNullOrEmpty(uc.UpdateTime.ToString())?uc.UpdateTime: DateTime.Now;;//修改时间
            this.UpdateName = uc.UpdateName;//修改人
            if (SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo != null)
            {
                this.OWNERCOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                this.OWNERDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                this.OWNERPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                this.OWNERERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].EmployeePostID;
            }
            this.Multiselect = uc.Multiselect;
            this.Filter = uc.Filter;
            this.MaxConcurrentUploads = uc.MaxConcurrentUploads;
            this.MaxSize =ByteConverter.GetByte(uc.MaxSize);
            #endregion       
            uploading = false;
            #endregion
            #region 显示按钮控制
            addFilesButton.Visibility = uc.NotShowSelectButton == true ? Visibility.Collapsed : Visibility.Visible;
            uploadButton.Visibility = uc.NotShowUploadButton == true ? Visibility.Collapsed : Visibility.Visible;
            clearFilesButton.Visibility = uc.NotShowClearButton == true ? Visibility.Collapsed : Visibility.Visible;
            displayThumbailChckBox.Visibility = uc.NotShowThumbailChckBox == true ? Visibility.Collapsed : Visibility.Visible;
            #endregion
           
           // addFilesButton.Visibility = Visibility.Collapsed;
            addFilesButton.Click += new RoutedEventHandler(addFilesButton_Click);
            uploadButton.Click += new RoutedEventHandler(uploadButton_Click);
            clearFilesButton.Click += new RoutedEventHandler(clearFilesButton_Click);
            displayThumbailChckBox.Checked += new RoutedEventHandler(displayThumbailChckBox_Checked);
            displayThumbailChckBox.Unchecked += new RoutedEventHandler(displayThumbailChckBox_Checked);
            Loaded += new RoutedEventHandler(FileUploadControl_Loaded);
         

        }