示例#1
0
        public VdText(double x, double y, int owner, int shapeId, CleanupRequest cleanupRequest) :
            base(owner, shapeId)
        {
            initText(DaoUtils.UserIdToColor(owner));

            _cleanupRequest = cleanupRequest;

            HandleMove(x, y);

            RemoveFocus();
        }
示例#2
0
文件: VdText.cs 项目: gdlprj/duscusys
        public VdText(double x, double y, int owner, int shapeId, CleanupRequest cleanupRequest) :
            base(owner, shapeId)
        {
            initText(DaoUtils.UserIdToColor(owner));

            _cleanupRequest = cleanupRequest;

            HandleMove(x,y);    

            RemoveFocus();
        }
示例#3
0
        public ActionResult SaveCleanupRequest(CleanupRequest data)
        {
            data.UserId   = (int)Session["UserId"];
            data.BranchId = 1;
            data.AddedOn  = DateTime.Now;
            data.Approval = false;
            data.Status   = true;

            db.CleanupRequests.Add(data);
            db.SaveChanges();

            return(RedirectToAction("CleanupRequest", new { }));
        }
示例#4
0
        public ActionResult ApproveConfirmation(int?id)
        {
            //
            CleanupRequest obj = db.CleanupRequests.Find(id);

            if (obj != null && obj.Approval == true)
            {
                obj.Status = false;
                UpdateModel(obj);

                db.SaveChanges();
            }

            else
            {
                return(Content("Task Not Approved"));
            }
            return(Content("Task Completed"));
        }
示例#5
0
        public ActionResult ApproveCleanup(int?id)
        {
            // id = db.AmbulanceMasters.Where(e => e.Engaged == false);
            CleanupRequest obj = db.CleanupRequests.Find(id);

            if (obj != null)
            {
                obj.Approval = true;
                UpdateModel(obj);
                // db.AmbulanceMasters.Add(obj);
                db.SaveChanges();
            }

            else
            {
                return(Content("Not such an object"));
            }
            return(Content("Request Approved"));
        }
示例#6
0
        public async Task <TransactionCleanupAttempt> ProcessCleanupRequest(CleanupRequest cleanupRequest, bool isRegular = true)
        {
            if (string.IsNullOrEmpty(cleanupRequest.AtrId))
            {
                throw new ArgumentNullException(nameof(cleanupRequest.AtrId));
            }

            _logger.LogDebug("Cleaner.{creator}: Processing cleanup request: {req}", _creatorName, cleanupRequest);
            try
            {
                await Forwards.ForwardCompatibility.Check(null, Forwards.ForwardCompatibility.CleanupEntry, cleanupRequest.ForwardCompatibility).CAF();
                await CleanupDocs(cleanupRequest).CAF();
                await CleanupAtrEntry(cleanupRequest).CAF();

                return(new TransactionCleanupAttempt(
                           Success: true,
                           IsRegular: isRegular,
                           AttemptId: cleanupRequest.AttemptId,
                           AtrId: cleanupRequest.AtrId,
                           AtrBucketName: cleanupRequest.AtrCollection.Scope.Bucket.Name,
                           AtrCollectionName: cleanupRequest.AtrCollection.Name,
                           AtrScopeName: cleanupRequest.AtrCollection.Scope.Name,
                           Request: cleanupRequest,
                           FailureReason: null));
            }
            catch (Exception ex)
            {
                _logger.LogDebug("Cleaner.{creator}: Cleanup Failed for {req}!  Reason: {ex}", _creatorName, cleanupRequest, ex);
                // TODO: publish stream of failed cleanups and their cause.
                return(new TransactionCleanupAttempt(
                           Success: false,
                           IsRegular: isRegular,
                           AttemptId: cleanupRequest.AttemptId,
                           AtrId: cleanupRequest.AtrId,
                           AtrBucketName: cleanupRequest.AtrCollection.Scope.Bucket.Name,
                           AtrCollectionName: cleanupRequest.AtrCollection.Name,
                           AtrScopeName: cleanupRequest.AtrCollection.Scope.Name,
                           Request: cleanupRequest,
                           FailureReason: ex));
            }
        }
示例#7
0
 public AnalysisRequest()
 {
     Cleanup  = new CleanupRequest();
     Entities = new EntitiesRequest();
     Download = new DownloadRequest();
 }
示例#8
0
 private Task CleanupDocs(CleanupRequest cleanupRequest) => cleanupRequest.State switch
 {