private void Image_MouseLeftButtonDown_1(object sender, MouseButtonEventArgs e)
        {
            var list = SP.Children.OfType <JoinRow>().Select(item => item.VM.Name).ToList();

            Window    Home_Window = App.Current.Windows.OfType <Home>().FirstOrDefault();
            AddFolder win         = new AddFolder(UserID, UserPWD, list, this.win);

            var success = win.ShowDialog();

            if (success == true)
            {
                GetUserFolder.AsyncPOST(UserID, UserPWD, (fd) => {
                    this.Dispatcher.BeginInvoke(new Action(() => {
                        SP.Children.Clear();
                        if (fd.FolderList.Folder != null)
                        {
                            foreach (FolderDataFolderListFolder item in fd.FolderList.Folder)
                            {
                                SP.Children.Add(new JoinRow(UserID, UserPWD, item, ChangeBackground));
                            }
                        }
                    }));
                });
            }
        }
        private void Image_MouseLeftButtonDown_1(object sender, MouseButtonEventArgs e)
        {
            var list = WP.Children.OfType <FolderRoom>().Select(item => item.VM.Name).ToList();

            Window    Home_Window = App.Current.Windows.OfType <Home>().FirstOrDefault();
            AddFolder win         = new AddFolder(UserID, UserPWD, list, Home_Window);

            var success = win.ShowDialog();

            if (success == true)
            {
                GetUserFolder.AsyncPOST(UserID, UserPWD, (fd) => {
                    this.Dispatcher.BeginInvoke(new Action(() => {
                        WP.Children.Clear();
                        if (fd.FolderList.Folder != null)
                        {
                            foreach (FolderDataFolderListFolder item in fd.FolderList.Folder)
                            {
                                WP.Children.Add(new FolderRoom(UserID, UserPWD, item, dictEvent, DelCallback, RenameCallback, () => {
                                    return(WP.Children.OfType <FolderRoom>().Select(item2 => item2.VM.Name).ToList());
                                }));
                            }
                        }
                    }));
                    SaveData(fd);
                });
            }
        }
        private void InitUI()
        {
            //txtQuest.Text = string.Format("請輸入{0}識別碼", PaperLess_Emeeting.Properties.Settings.Default.CourseOrMeeting_String);
            //SP.Children.Add(new JoinRow("", "", null, ChangeBackground));
            //SP.Children.Add(new JoinRow("", "", null, ChangeBackground));
            //SP.Children.Add(new JoinRow("", "", null, ChangeBackground));
            //SP.Children.Add(new JoinRow("", "", null, ChangeBackground));
            //SP.Children.Add(new JoinRow("", "", null, ChangeBackground));
            //SP.Children.Add(new JoinRow("", "", null, ChangeBackground));

            GetUserFolder.AsyncPOST(UserID, UserPWD, (fd) => { GetUserFolder_DoAction(fd); });
        }
        private void InitUI()
        {
            MouseTool.ShowLoading();
            //LawCT_Title.Text = MyPL.Properties.Settings.Default.LawButtonName;
            txtTitle.Text = ButtonName;
            //Network.HttpRequest hr = new Network.HttpRequest();
            if (1 == 1 || NetworkTool.CheckNetwork() > 0)
            {
                // 非同步POST方法
                //GetLawData.AsyncPOST((ld) => { GetLawData_DoAction(ld); });
                GetUserFolder.AsyncPOST(UserID, UserPWD, (fd) => { GetUserFolder_DoAction(fd); });
                //, () => { this.Dispatcher.BeginInvoke(new Action(() => { AutoClosingMessageBox.Show("無法取得資料,請稍後再試"); })); });
            }
            else
            {
                DataTable dt = MSCE.GetDataTable("select LawJson from LawData");


                if (dt.Rows.Count > 0)
                {
                    LawData ld = JsonConvert.DeserializeObject <LawData>(dt.Rows[0]["LawJson"].ToString());
                    GetLawData_DoAction(ld);
                }
                else
                {
                    AutoClosingMessageBox.Show("無法取得資料,請稍後再試");
                    MouseTool.ShowArrow();
                }
            }



            #region  步POST
            //LawData lawData = GetLawData.POST();

            //if (lawData != null)
            //{
            //    int i=0;
            //    foreach (LawDataLaw item in lawData.LawList)
            //    {
            //        i++;
            //        bool IsLastRow= (i==lawData.LawList.Length);
            //        LawRowSP.Children.Add(new LawRow(item,IsLastRow, LawListCT_HangTheDownloadEvent_Callback));
            //    }
            //}
            //else
            //{
            //    AutoClosingMessageBox.Show("無法取得資料,請稍後再試");
            //}
            #endregion
        }
Beispiel #5
0
        private void InitSelectDB()
        {
            DataTable dt = MSCE.GetDataTable("select UserID,UserName,UserPWD,MeetingID from NowLogin");

            if (dt.Rows.Count > 0)
            {
                UserID = dt.Rows[0]["UserID"].ToString();
                //UserName = dt.Rows[0]["UserName"].ToString();
                UserPWD = dt.Rows[0]["UserPWD"].ToString();
                //MeetingID = dt.Rows[0]["MeetingID"].ToString();
            }

            dt = MSCE.GetDataTable("select a.FolderID , b.FolderName  from userfile as a join userFolder as b on a.FolderID = b.folderID where a. userid =@1 and a.fileid=@2"
                                   , UserID
                                   , FileID);
            if (dt.Rows.Count > 0)
            {
                FolderID   = dt.Rows[0]["FolderID"].ToString();
                FolderName = dt.Rows[0]["FolderName"].ToString();
            }

            if (FolderName == null || FolderName.Length == 0)
            {
                GetUserFolder.AsyncPOST(UserID, UserPWD, (fd) =>
                {
                    if (fd.FolderList.Folder != null)
                    {
                        foreach (FolderDataFolderListFolder item in fd.FolderList.Folder)
                        {
                            if (item.ID.Equals(FolderID))
                            {
                                FolderName = item.Name;
                                break;
                            }
                        }
                    }
                    this.Dispatcher.BeginInvoke(new Action(() =>
                    {
                        txtName.Text = FolderName;
                    }));
                });
            }
        }
 private void DelCallback(bool obj)
 {
     if (obj)
     {
         GetUserFolder.AsyncPOST(UserID, UserPWD, (fd) => {
             this.Dispatcher.BeginInvoke(new Action(() => {
                 WP.Children.Clear();
                 if (fd.FolderList.Folder != null)
                 {
                     foreach (FolderDataFolderListFolder item in fd.FolderList.Folder)
                     {
                         WP.Children.Add(new FolderRoom(UserID, UserPWD, item, dictEvent, DelCallback, RenameCallback, () => {
                             return(WP.Children.OfType <FolderRoom>().Select(item2 => item2.VM.Name).ToList());
                         }));
                     }
                 }
             }));
             SaveData(fd);
         });
     }
 }