Пример #1
0
        public MainViewModel()
        {
            var configuration = Configuration.GetConfiguration("defaultconfig.json");

            Config.CollectionTarget       = configuration.CollectionConnectionString;
            Config.DeletedTarget          = configuration.DeletedConnectionString;
            collectionHistory             = new CollectionHistory();
            deletedHisotry                = new DeleteHisotry();
            deletedHisotry.DeletedHistory = new List <string>();
            MyFiles.Clear();
            history = new DirectoryHistory(FilePath);
            foreach (var logicalDrive in Directory.GetLogicalDrives())
            {
                DirectoriesAndFiles.Add(new DirectoryViewModel(logicalDrive));
            }

            history.HistoryChanged += History_HistoryChanged;

            CompressCollectionCommand = new DelegateCommand(CompressCollection);
            OpenCommand            = new DelegateCommand(Open);
            CompressCommand        = new DelegateCommand(Compress);
            DecompressCommand      = new DelegateCommand(Decompress);
            DeleteFileCommand      = new DelegateCommand(DeleteFile);
            AddToCollectionCommand = new DelegateCommand(AddToCollection);
            MoveBackCommand        = new DelegateCommand(MoveBack, CanMoveBack);
            MoveForwardCommand     = new DelegateCommand(MoveForward, CanMoveForward);
            MoveForwardCommand     = new DelegateCommand(MoveForward, CanMoveForward);
        }
Пример #2
0
        public void HandleGetHistory(ApiRequest request)
        {
            var x = CollectionHistory.GetAllEvents(_currentBookCollectionSelection.CurrentSelection)
                    .OrderByDescending(b => b.When).ToArray();

            request.ReplyWithJson(JsonConvert.SerializeObject(
                                      x
                                      ));
        }
Пример #3
0
        public void HandleGetHistory(ApiRequest request)
        {
            var currentBookOnly = request.GetParamOrNull("currentBookOnly");
            IEnumerable <BookHistoryEvent> events;

            if (currentBookOnly == "true")
            {
                events = CollectionHistory.GetBookEvents(request.CurrentBook.BookInfo);
            }
            else
            {
                events = CollectionHistory.GetAllEvents(_currentBookCollectionSelection.CurrentSelection);
            }
            var result = events.OrderByDescending(b => b.When).ToArray();

            request.ReplyWithJson(JsonConvert.SerializeObject(
                                      result
                                      ));
        }
 protected void EgvItemRules_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         DataRowView dataItem = (DataRowView)e.Row.DataItem;
         Label       label    = (Label)e.Row.FindControl("LblSuccessRecord");
         Label       label2   = (Label)e.Row.FindControl("LblFailureRecord");
         int         num      = CollectionHistory.SuccessRecord(DataConverter.CLng(dataItem["ItemId"].ToString()));
         int         num2     = CollectionHistory.FailureRecord(DataConverter.CLng(dataItem["ItemId"].ToString()));
         label.Text = "<span style='color:blue'>" + num.ToString() + "</span>";
         if (num2 == 0)
         {
             label2.Text = "<span style='color:green'>" + num2.ToString() + "</span>";
         }
         else
         {
             label2.Text = "<span style='color:red'>" + num2.ToString() + "</span>";
         }
     }
 }
Пример #5
0
        protected void BtnBatchDelete_Click(object sender, EventArgs e)
        {
            StringBuilder selectList = new StringBuilder("");

            selectList = this.EgvHistory.SelectList;
            if (selectList.Length > 0)
            {
                if (CollectionHistory.Delete(selectList.ToString()))
                {
                    AdminPage.WriteSuccessMsg("<li>删除指定的采集历史记录成功!</li>", "HistoryManage.aspx");
                }
                else
                {
                    AdminPage.WriteErrMsg("<li>删除失败!</li>");
                }
            }
            else
            {
                AdminPage.WriteErrMsg("<li>请选择要删除的采集历史记录!</li>");
            }
        }
Пример #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if ((!base.IsPostBack && (BasePage.RequestString("Action") == "Delete")) && CollectionHistory.Delete(BasePage.RequestString("HistoryID")))
     {
         AdminPage.WriteSuccessMsg("<li>删除指定的采集历史记录成功!</li>", "HistoryManage.aspx");
     }
 }
Пример #7
0
 protected void BtnDeleteSuccess_Click(object sender, EventArgs e)
 {
     CollectionHistory.DeleteSuccess();
     AdminPage.WriteSuccessMsg("<li>删除全部成功采集历史记录成功!</li>", "HistoryManage.aspx");
 }
        private async Task AddHistoryActivity()
        {
            try
            {
                CollectionHistory history = new CollectionHistory();
                history.ActionID = ActivityContext.SelectedAction.Id;
                history.ActionDate = DateTime.Now;
                history.ClientNodeID = CurrentClientNodeID;
                history.FollowUpDate = ActivityContext.FollowUpDate;
                history.Comment = ActivityContext.Comment;
                history.ActivityByUserEntityID = CurrentEntityId;
                List<int> contractSelected = new List<int>();
                CollectionSystemDefault collectionDefault = await CollectionsQueueSettingsFunctions.ReadCollectionSystemDefaultAsync();

                if (ActivityContext.AddMultipe)
                {
                    contractSelected = ActivityContext.ContractContext.Items.Where(it => it.IsSelected).Select(it => it.Id).ToList();
                    if (contractSelected.Count == 0)
                    {
                        contractSelected.Add(this.SelectedQueue.ContractId);
                    }
                }
                else
                {
                    contractSelected.Add(this.SelectedQueue.ContractId);
                }
                await QueueAssignmentFunctions.AddHistoryActivity(history, contractSelected);
                foreach (int contractId in contractSelected)
                {
                    int categoryId = 0;
                    int.TryParse("1" + collectionDefault.NoteCategoryID, out categoryId);
                    await AddDefaultNewNoteActivity(ActivityContext.SelectedAction.Text, ActivityContext.Comment, contractId, categoryId);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Has error when add History on Activity Screen.");
            }
        }