Beispiel #1
0
 private Brush GetRecordBackground(AppealInfoItems appealInfoItems)
 {
     try
     {
         int rowNumber = appealInfoItems.RowNumber;
         if (rowNumber % 2 == 0)
         {
             return(Brushes.LightGray);
         }
     }
     catch (Exception) { }
     return(Brushes.Transparent);
 }
Beispiel #2
0
 private void LvAppealData_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         AppealInfoItems appealInfoItems = LvAppealData.SelectedItem as AppealInfoItems;
         if (appealInfoItems != null && appealInfoItems.ReferenceID != 0 && appealInfoItems.ScoreID != 0)
         {
             mListAppealInfoItems = appealInfoItems;
             CreatAppealInfoDetail();
         }
         else
         {
             PanelAppealDetail.IsVisible = false;
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Beispiel #3
0
        private void PlayRecord(AppealInfoItems seldate)
        {
            try
            {
                mUCPlayBox                  = new UCPlayBox();
                mUCPlayBox.CurrentApp       = CurrentApp;
                mUCPlayBox.RecoredReference = seldate.ReferenceID.ToString();
                mUCPlayBox.IsAutoPlay       = true;
                //BorderPlayBox.Child = mUCPlayBox;
                //PanelPlayBox.IsVisible = true;

                #region 写操作日志
                string strLog = string.Format("{0} {1}", Utils.FormatOptLogString("3105T00001"), seldate.ReferenceID.ToString());
                CurrentApp.WriteOperationLog(S3105Consts.OPT_Play.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);
                #endregion
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Beispiel #4
0
        public AppealManageMainView()
        {
            InitializeComponent();

            mListCurrentAppealItems = new ObservableCollection <AppealInfoItems>();
            mListAllAppealInfo      = new List <AppealInfoItems>();
            mListAppealInfoItems    = new AppealInfoItems();
            mListAuInfoItems        = new ObservableCollection <AgentAndUserInfoItems>();
            mListBasicOperations    = new ObservableCollection <OperationInfo>();
            mPageIndex   = 0;
            mPageCount   = 0;
            mPageSize    = 100;
            mRecordTotal = 0;
            mMaxRecords  = 100000;
            Unloaded    += AppealManagePage_Unloaded;
            PanelAppealDetail.IsVisible = false;
            //PanelMemo.IsVisible = false;
            //PanelPlayBox.IsVisible = false;
            TxtPage.KeyUp           += TxtPage_KeyUp;
            LvAppealData.ItemsSource = mListCurrentAppealItems;
            //LvAppealData.MouseDoubleClick+=LvAppealData_MouseDoubleClick;
            LvAppealData.SelectionChanged += LvAppealData_SelectionChanged;
        }
Beispiel #5
0
 private void AddNewAppealInfo(AppealInfoItems appealInfoItems)
 {
     Dispatcher.Invoke(new Action(() => mListCurrentAppealItems.Add(appealInfoItems)));
 }
Beispiel #6
0
        public void QueryAppealInfo(string strCondition, List <DateTimeSpliteAsDay> lstDateTimeSplitAsDay)
        {
            mListAllAppealInfo.Clear();
            mListCurrentAppealItems.Clear();
            mListAppealInfoItems = null;
            mRecordTotal         = 0;
            mPageIndex           = 0;
            mPageCount           = 0;
            mPageSize            = S3105Consts.USER_PARAM_PAGESIZE;
            mMaxRecords          = S3105Consts.USER_PARAM_MAXRECORDS;
            try
            {
                PanelBasicOpts.IsEnabled = false;
                PanelOtherOpts.IsEnabled = false;
                SetBusy(true, string.Empty);
                mWorker = new BackgroundWorker();
                //注册线程主体方法
                mWorker.DoWork += (s, de) =>
                {
                    CurrentApp.WriteLog("QueryRecord", string.Format("{0}", strCondition));

                    WebRequest webRequest = new WebRequest();
                    webRequest.Session = CurrentApp.Session;
                    webRequest.Code    = (int)S3105Codes.GetAppealInfoData;
                    webRequest.ListData.Add(strCondition);
                    //Service31051Client client = new Service31051Client();
                    Service31051Client client    = new Service31051Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31051"));
                    WebReturn          webReturn = client.UMPTaskOperation(webRequest);
                    client.Close();
                    if (!webReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                        return;
                    }
                    if (webReturn.ListData == null)
                    {
                        ShowException(CurrentApp.GetLanguageInfo("3105T00101", string.Format("ListData is null")));
                        return;
                    }
                    if (webReturn.ListData.Count <= 0)
                    {
                        SetPageState();
                        return;
                    }
                    for (int i = 0; i < webReturn.ListData.Count; i++)
                    {
                        OperationReturn optReturn = XMLHelper.DeserializeObject <AppealInfo>(webReturn.ListData[i]);
                        if (!optReturn.Result)
                        {
                            ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                            continue;
                        }
                        AppealInfo appealInfo = optReturn.Data as AppealInfo;
                        if (appealInfo == null)
                        {
                            ShowException(CurrentApp.GetLanguageInfo("3105T00101", string.Format("ListData is null")));
                            return;
                        }
                        AppealInfoItems item = new AppealInfoItems(appealInfo);
                        mRecordTotal    = item.RowNumber;
                        item.Background = GetRecordBackground(item);
                        if (item.Appealint > 0)
                        {
                            item.AppealState = CurrentApp.GetLanguageInfo(string.Format("3105T000{0}", 77 + item.Appealint), item.Appealint.ToString());
                        }
                        if (item.AgentNum != 0)
                        {
                            item.AgentName = AgentAndUserFullName(item.AgentNum);
                            item.AgentID   = AgentAndUserName(item.AgentNum);
                        }
                        mListAllAppealInfo.Add(item);
                        if (mRecordTotal < mPageSize + 1)
                        {
                            AddNewAppealInfo(item);
                        }
                    }
                    SetPageState();
                };
                //当后台操作已完成、被取消或引发异常时发生
                mWorker.RunWorkerCompleted += (s, re) =>
                {
                    mWorker.Dispose();
                    SetBusy(false, string.Empty);
                    PanelBasicOpts.IsEnabled = true;
                    PanelOtherOpts.IsEnabled = true;
                };
                mWorker.RunWorkerAsync();//触发DoWork事件
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
                CurrentApp.WriteOperationLog(S3105Consts.OPT_Query.ToString(), ConstValue.OPT_RESULT_FAIL, "");
            }
            #region 写操作日志
            CurrentApp.WriteOperationLog(S3105Consts.OPT_Query.ToString(), ConstValue.OPT_RESULT_SUCCESS, "");
            #endregion
        }