Пример #1
0
        /// <summary>
        /// 选择数据库事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void dbItem_Selected(TreeViewItem selectedItem)
        {
            try
            {
                UC_DBOperation uc_db = new UC_DBOperation(this);
                spOperator.Children.Clear();
                spOperator.Children.Add(uc_db);
                UC_DBOpeartionDefault uc_DBOpeartionDefault = new UC_DBOpeartionDefault(this);
                spOperator.Children.Add(uc_DBOpeartionDefault);
                App.GCurrentDBServer = selectedItem.Tag as DBInfo;

                ////没有打开过 才加载语言种类
                //if (selectedItem.Items.Count <= 0)
                //{
                selectedItem.Items.Clear();
                InitTreeLanguageItem(selectedItem);
                //}
                TreeViewItemProps.SetItemImageName(selectedItem, System.IO.Path.Combine(App.GStrApplicationDirectory, @"Images\00000015.ico"));

                DataTable       dt         = GetAllLanguages(selectedItem);
                UC_LanguageData uc_LanData = new UC_LanguageData(dt, this);
                dpData.Children.Clear();
                dpData.Children.Add(uc_LanData);
                //lstAllLans = uc_LanData.lstViewrSource;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message,
                                this.TryFindResource("ErrorMsgTitle").ToString(), MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Пример #2
0
        void UC_ConfirmExportLan_Loaded(object sender, RoutedEventArgs e)
        {
            imgSave.Source                = new BitmapImage(new Uri(System.IO.Path.Combine(App.GStrApplicationDirectory, @"Images\00000024.ico"), UriKind.RelativeOrAbsolute));
            imgOperation.Source           = new BitmapImage(new Uri(System.IO.Path.Combine(App.GStrApplicationDirectory, @"Images\00000018.ico"), UriKind.RelativeOrAbsolute));
            imgCancel.Source              = new BitmapImage(new Uri(System.IO.Path.Combine(App.GStrApplicationDirectory, @"Images\00000026.ico"), UriKind.RelativeOrAbsolute));
            dpSave.MouseLeftButtonDown   += dpSave_MouseLeftButtonDown;
            dpCancel.MouseLeftButtonDown += dpCancel_MouseLeftButtonDown;
            uc_Export = LanManagerWindow.dpDetail.Children[0] as UC_ExportLan;
            UC_LanguageData uc_LanData = LanManagerWindow.dpData.Children[0] as UC_LanguageData;

            //DataView dv = uc_LanData.lvLanguage.ItemsSource as DataView;
            lstAllLanguages = uc_LanData.lstViewrSource;
        }
Пример #3
0
 /// <summary>
 /// 刷新
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void dpRefersh_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     LanManagerWindow.lblState.Content = TryFindResource("Refreshing").ToString();
     //如果需要刷新语言包
     if (LanManagerWindow.dpData.Children.Count > 0)
     {
         UC_LanguageData uc_data = LanManagerWindow.dpData.Children[0] as UC_LanguageData;
         Common.RefershData(uc_data.lvLanguage);
         uc_data.lstViewrSource = uc_data.lvLanguage.ItemsSource as List <LanguageInfo>;
     }
     LanManagerWindow.InitControl();
     LanManagerWindow.lblState.Content = TryFindResource("RefreshDone").ToString();
 }
Пример #4
0
        /// <summary>
        /// 选择语言事件
        /// </summary>
        void Language_Selected(TreeViewItem selectedItem)
        {
            UC_LanguageData uc_LanData = dpData.Children[0] as UC_LanguageData;
            DataRow         row        = selectedItem.Tag as DataRow;
            string          strLanCode = row["C002"].ToString();

            lstAllLans = uc_LanData.lstViewrSource;
            List <LanguageInfo> lstSingleLan = lstAllLans.Where(p => p.LanguageCode == strLanCode).ToList();

            if (lstSingleLan.Count > 0)
            {
                uc_LanData.lvLanguage.ItemsSource = lstSingleLan;
            }
        }
Пример #5
0
        void InitControlContent()
        {
            RRLanguangeTypesResult = AboutLanguagesInServer.WCFOperationMthodA("HTTP", App.GCurrentUmpServer.Host, App.GCurrentUmpServer.Port, 1, App.GCurrentDBServer);
            UC_LanguageData uc_LanData = LanManagerWindow.dpData.Children[0] as UC_LanguageData;

            lstAllLanguages = uc_LanData.lvLanguage.ItemsSource as List <LanguageInfo>;

            IListStrAllowSurportLanguageCode = new List <string>();
            if (RRLanguangeTypesResult.BoolReturn)
            {
                if (RRLanguangeTypesResult.DataSetReturn.Tables.Count > 0)
                {
                    for (int i = 0; i < RRLanguangeTypesResult.DataSetReturn.Tables[0].Rows.Count; i++)
                    {
                        IListStrAllowSurportLanguageCode.Add(RRLanguangeTypesResult.DataSetReturn.Tables[0].Rows[i]["C002"].ToString());
                    }
                }
            }
        }
Пример #6
0
        void InstanceBackgroundWorkerImportAppenUpdate_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (bIsImportSuccess)
            {
                List <string> lstParams = new List <string>();
                lstParams.Add(App.GCurrentDBServer.DbType.ToString());
                lstParams.Add(App.GCurrentDBServer.Host);
                lstParams.Add(App.GCurrentDBServer.Port);
                lstParams.Add(App.GCurrentDBServer.ServiceName);
                lstParams.Add(App.GCurrentDBServer.LoginName);
                lstParams.Add(App.GCurrentDBServer.Password);
                lstParams.Add(strImportLanguageType);

                ReturnResult result = AboutLanguagesInServer.WCFOperationMthodA("HTTP", App.GCurrentUmpServer.Host, App.GCurrentUmpServer.Port, 7, lstParams);
                MessageBox.Show(this.TryFindResource("Message002").ToString(),
                                this.TryFindResource("Message003").ToString(), MessageBoxButton.OK, MessageBoxImage.Information);
                if (LanManagerWindow.dpData.Children.Count > 0)
                {
                    UC_LanguageData uc_data = LanManagerWindow.dpData.Children[0] as UC_LanguageData;
                    Common.RefershData(uc_data.lvLanguage);
                    uc_data.lstViewrSource = uc_data.lvLanguage.ItemsSource as List <LanguageInfo>;
                }

                LanManagerWindow.InitControl();
            }
            else
            {
                MessageBox.Show(this.TryFindResource("Error005").ToString() + App.GStrLoginUserApplicationDataPath + "\\UMP.PF.MAMT\\Log" + DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day + ".log",
                                this.TryFindResource("ErrorMsgTitle").ToString(), MessageBoxButton.OK, MessageBoxImage.Error);
            }
            LanManagerWindow.spOperator.Children.RemoveAt(1);
            UC_DBOpeartionDefault defaultWin = new UC_DBOpeartionDefault(LanManagerWindow);

            LanManagerWindow.spOperator.Children.Add(defaultWin);
            LanManagerWindow.dpDetail.Children.Clear();
        }
Пример #7
0
        /// <summary>
        /// 保存编辑语言
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void dpSave_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            List <string>       lstParams;
            List <LanguageInfo> lstLans = GetLanguagesEdited();
            ReturnResult        result  = null;

            for (int i = 0; i < lstLans.Count; i++)
            {
                lstParams = new List <string>();
                lstParams.Add(App.GCurrentDBServer.DbType.ToString());
                lstParams.Add(App.GCurrentDBServer.Host);
                lstParams.Add(App.GCurrentDBServer.Port);
                lstParams.Add(App.GCurrentDBServer.ServiceName);
                lstParams.Add(App.GCurrentDBServer.LoginName);
                lstParams.Add(App.GCurrentDBServer.Password);
                lstParams.Add(lstLans[i].LanguageCode);
                lstParams.Add(lstLans[i].MessageID);
                if (lstLans[i].DisplayMessage.Length > 1024)
                {
                    lstParams.Add(lstLans[i].DisplayMessage.Substring(0, 1024));
                    lstParams.Add(lstLans[i].DisplayMessage.Substring(1024));
                }
                else
                {
                    lstParams.Add(lstLans[i].DisplayMessage);
                    lstParams.Add(string.Empty);
                }
                if (lstLans[i].TipMessage.Length > 1024)
                {
                    lstParams.Add(lstLans[i].TipMessage.Substring(0, 1024));
                    lstParams.Add(lstLans[i].TipMessage.Substring(1024));
                }
                else
                {
                    lstParams.Add(lstLans[i].TipMessage);
                    lstParams.Add(string.Empty);
                }

                result = AboutLanguagesInServer.WCFOperationMthodA("HTTP", App.GCurrentUmpServer.Host, App.GCurrentUmpServer.Port
                                                                   , 3, lstParams);
                if (!result.BoolReturn)
                {
                    MessageBox.Show(lstLans[i].LanguageCode + this.TryFindResource("SaveLanguageItemError").ToString(),
                                    this.TryFindResource("ErrorMsgTitle").ToString(), MessageBoxButton.OK, MessageBoxImage.Error);
                }
                else
                {
                    UC_LanguageInfo uc_Info = new UC_LanguageInfo(lstLans, LanManagerWindow);
                    LanManagerWindow.dpDetail.Children.Clear();
                    LanManagerWindow.dpDetail.Children.Add(uc_Info);

                    LanManagerWindow.spOperator.Children.RemoveAt(1);
                    UC_DBOpeartionDefault uc_Default = new UC_DBOpeartionDefault(LanManagerWindow);
                    LanManagerWindow.spOperator.Children.Add(uc_Default);
                }
            }

            TreeView     tree               = LanManagerWindow.spContent.Children[2] as TreeView;
            TreeViewItem item               = tree.SelectedItem as TreeViewItem;
            string       strContextValue    = item.DataContext.ToString();
            string       strSelectedLanCode = string.Empty;

            if (strContextValue.StartsWith("Lan-"))
            {
                DataRow row = item.Tag as DataRow;
                strSelectedLanCode = row["C002"].ToString();
            }
            UC_LanguageData data = LanManagerWindow.dpData.Children[0] as UC_LanguageData;

            Common.RefershData(data.lvLanguage, strSelectedLanCode);
            data.lstViewrSource = data.lvLanguage.ItemsSource as List <LanguageInfo>;
            List <LanguageInfo> lstSingleLans = null;

            if (!string.IsNullOrEmpty(strSelectedLanCode))
            {
                lstSingleLans = data.lstViewrSource.Where(p => p.LanguageCode == strSelectedLanCode).ToList();
                data.lvLanguage.ItemsSource = null;
                data.lvLanguage.ItemsSource = lstSingleLans;
            }
        }