예제 #1
0
        public static string ConvertStatusToString(CaseStatus status)
        {
            switch (status)
            {
            case CaseStatus.Closed:
                return("Closed");

            case CaseStatus.DefectConfirmed:
                return("Defect Confirmed");

            case CaseStatus.EnhancementRequestCreated:
                return("Enhancement Created");

            case CaseStatus.FromSupport:
                return("From Support");

            case CaseStatus.New:
                return("New");

            case CaseStatus.WaitForSupport:
                return("Wait Support");

            case CaseStatus.WaitingForClose:
                return("Waiting for Close");

            default:
                return(status.ToString());
            }
        }
예제 #2
0
파일: CaseDal.cs 프로젝트: srbhkumar/ofr
        public Tuple <int, List <Case> > GetCasesByPage(int page, CaseStatus status, int size, bool flaggedOnly, HttpRequestMessage request)
        {
            List <string> jurisdictions = UserDal.GetGroupsFromHeader(request);

            var feedOptions = new FeedOptions
            {
                EnableCrossPartitionQuery = true,
                MaxItemCount      = -1,
                EnableScanInQuery = true
            };



            var skipCount = (page - 1) * size;
            var takeCount = size;

            //Although these appear to be repeated queries they are done in this way because they are executed remotely (on cosmosdb) and we
            //do not want to retrieve all cases with their full data in order to count them
            var cases = Client.CreateDocumentQuery <Case>(
                UriFactory.CreateDocumentCollectionUri(WebConfigurationManager.AppSettings["documentDatabase"], WebConfigurationManager.AppSettings["caseCollection"]),
                feedOptions)
                        .Where(c => (c.Status == status.ToString() && (jurisdictions.Contains(c.Jurisdiction) || jurisdictions.Contains("Admin")) && (!flaggedOnly || c.Flagged)))
                        .OrderBy(c => c.Data["DateofDeath"])
                        .Take(skipCount + takeCount)
                        .ToArray()
                        .Skip(skipCount);

            var count = Client.CreateDocumentQuery <Case>(
                UriFactory.CreateDocumentCollectionUri(WebConfigurationManager.AppSettings["documentDatabase"], WebConfigurationManager.AppSettings["caseCollection"]),
                feedOptions)
                        .Where(c => (c.Status == status.ToString() && (jurisdictions.Contains(c.Jurisdiction) || jurisdictions.Contains("Admin")) && (!flaggedOnly || c.Flagged)))
                        .ToList <Case>().Count;

            return(new Tuple <int, List <Case> >(count, cases.ToList <Case>()));
        }
예제 #3
0
        private HttpResponseMessage GetPageByType(int number, CaseStatus status, int size, bool flaggedOnly, HttpRequestMessage request)
        {
            using (var operation = this.TelClient.StartOperation <RequestTelemetry>("Get" + status.ToString() + "CasePage"))
            {
                if (size < 1 || number < 1)
                {
                    return(Request.CreateResponse(HttpStatusCode.BadRequest, "Invalid query parameter"));
                }
                operation.Telemetry.Url = Request.RequestUri;
                try
                {
                    operation.Telemetry.ResponseCode = HttpStatusCode.OK.ToString();

                    var caseResponse = _caseDal.GetCasesByPage(number, status, size, flaggedOnly, request);
                    return(Request.CreateResponse(HttpStatusCode.OK,
                                                  new
                    {
                        total = caseResponse.Item1,
                        cases = caseResponse.Item2.ToList(),
                        page = number
                    }, Configuration.Formatters.JsonFormatter, "application/json"));
                }
                catch (Exception ex)
                {
                    return(HandleExceptions(ex, operation, Request));
                }
            }
        }
        protected override void ReadElementValueEvent(object sender, ReadElementEventArgs eventArgs)
        {
            if (eventArgs.Path.Matches("tittel", "arkivdel"))
            {
                _currentArkivdelName = eventArgs.Value;
            }
            if (eventArgs.Path.Matches("systemID", "arkivdel"))
            {
                _currentArkivdelSystemId = eventArgs.Value;
            }
            if (eventArgs.Path.Matches("saksstatus", "mappe"))
            {
                if (_currentSaksStatus != eventArgs.Value)
                {
                    _currentNumberOfSaksstatus = 0;
                }

                _currentSaksStatus = eventArgs.Value;
                _currentNumberOfSaksstatus++;
                var status = new CaseStatus {
                    Arkivdel = _currentArkivdelName, Status = _currentSaksStatus, NumberOfSaksstatus = _currentNumberOfSaksstatus
                };
                if (!_statuses.Contains(status))
                {
                    _statuses.Add(status);
                }
                else
                {
                    var statusCurrent = _statuses.Where(s => s.Status == _currentSaksStatus).First();
                    _statuses.Remove(status);
                    statusCurrent.NumberOfSaksstatus = _currentNumberOfSaksstatus;
                    _statuses.Add(statusCurrent);
                }
            }
        }
예제 #5
0
파일: CaseDal.cs 프로젝트: srbhkumar/ofr
        public void UpdateStatusById(string id, CaseStatus status, string username, HttpRequestMessage request)
        {
            var feedOptions = new FeedOptions
            {
                EnableCrossPartitionQuery = true,
                MaxItemCount      = -1,
                EnableScanInQuery = true
            };
            var caseById = Client.CreateDocumentQuery <Case>(
                UriFactory.CreateDocumentCollectionUri(WebConfigurationManager.AppSettings["documentDatabase"], WebConfigurationManager.AppSettings["caseCollection"]),
                feedOptions)
                           .Where(c => c.id == id)
                           .AsEnumerable().FirstOrDefault();
            var keyValue = caseById.Jurisdiction;

            var result = Client.ExecuteStoredProcedureAsync <object>(
                UriFactory.CreateStoredProcedureUri(WebConfigurationManager.AppSettings["documentDatabase"], WebConfigurationManager.AppSettings["caseCollection"], "SetCaseStatus"),
                new RequestOptions {
                PartitionKey = new PartitionKey(keyValue)
            },
                id,
                status.ToString(),
                username
                ).Result;
        }
        private int GetCount(IQueryable <Models.Examination> examinations, CaseStatus caseStatus)
        {
            var caseStatusPredicate = GetCaseStatusPredicate(caseStatus);
            var result = examinations.Count(caseStatusPredicate);

            return(result);
        }
        public async Task <IActionResult> PutCaseStatus(CaseStatus caseStatus)
        {
            _context.Entry(caseStatus).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(NoContent());
        }
예제 #8
0
    public void ChangeType()
    {
        CaseStatus files = Files.Load().GetCaseStatus();

        if (type == SelectionType.NONE)
        {
            if (files.clues.Count > 0)
            {
                type = SelectionType.CLUE;
                clue = files.clues[0];
            }
            else if (files.witnesses.Count > 0)
            {
                type    = SelectionType.WITNESS;
                witness = files.witnesses[0];
            }
        }
        else if (type == SelectionType.CLUE)
        {
            if (files.witnesses.Count > 0)
            {
                type    = SelectionType.WITNESS;
                witness = files.witnesses[0];
            }
            else
            {
                type = SelectionType.NONE;
            }
        }
        else if (type == SelectionType.WITNESS)
        {
            type = SelectionType.NONE;
        }
    }
        public async Task <ActionResult <CaseStatus> > PostCaseStatus(CaseStatus caseStatus)
        {
            _context.CaseStatuses.Add(caseStatus);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetCaseStatus", new { id = caseStatus.Id }, caseStatus));
        }
예제 #10
0
        public void Import(string subject, string description, string caseNumber, CaseStatus status)
        {
            var @event = new CaseImported(subject, description, caseNumber, status);

            Apply(@event);
            Append(Guid.NewGuid(), CaseImported.EventType, @event);
        }
        public frmCaseOpenOrClose(CaseStatus mode, string caseID)
        {
            InitializeComponent();

            this._caseID = caseID;
            this._mode   = mode;
        }
예제 #12
0
파일: Case.cs 프로젝트: eske/INSAWars
 public Case(int x, int y)
 {
     this.x = x;
     this.y = y;
     status = CaseStatus.FREE;
     units = new List<Unit>();
 }
예제 #13
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,CaseStatusName,Active")] CaseStatus caseStatus)
        {
            if (id != caseStatus.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(caseStatus);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CaseStatusExists(caseStatus.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(caseStatus));
        }
예제 #14
0
 public UpdateCaseStatusCommand(long caseID, CaseStatus status,
                                CaseMinorStatus?statusMinor = null)
 {
     _caseID      = caseID;
     _status      = status;
     _statusMinor = statusMinor;
 }
예제 #15
0
 internal CompanyCase(int comId,int caseId,short sta)
     : this()
 {
     companyId = comId;
     id = caseId;
     status = (CaseStatus)sta;
 }
예제 #16
0
 public Case(int x, int y)
 {
     this.x = x;
     this.y = y;
     status = CaseStatus.FREE;
     units  = new List <Unit>();
 }
        public async Task <IActionResult> PutCaseStatus(int id, CaseStatus caseStatus)
        {
            if (id != caseStatus.Id)
            {
                return(BadRequest());
            }

            _context.Entry(caseStatus).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CaseStatusExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #18
0
        /// <summary>
        /// Get a specific status from a Case
        /// </summary>
        /// <param name="caseId">The Case Id of a Case which you have already posted</param>
        /// <param name="caseStatusId">The Id of the CaseStatus you want to get</param>
        /// <returns></returns>
        public static async Task <CaseStatus> GetCaseStatusAsync(string caseId, Guid caseStatusId)
        {
            string uri = string.Format(Constants.UriCaseStatusGet, BaseUrl, caseId, caseStatusId);

            CaseStatus response = await PerformHttpCallAsync <CaseStatus>(uri, HttpMethod.Get, null, true, HttpRequestTimeout);

            return(response);
        }
예제 #19
0
        /// <summary>
        /// Post your CaseStatus to an existing Case
        /// </summary>
        /// <param name="caseId">The Case Id of a Case which you have already posted</param>
        /// <param name="caseStatus">Your CaseStatus which you want to post</param>
        /// <returns></returns>
        public static async Task <CaseStatus> PostCaseStatusAsync(string caseId, CaseStatus caseStatus)
        {
            string uri = string.Format(Constants.UriCaseStatusPost, BaseUrl, caseId);

            CaseStatus response = await PerformHttpCallAsync <CaseStatus>(uri, HttpMethod.Post, caseStatus, true, HttpRequestTimeout);

            return(response);
        }
예제 #20
0
        private void Apply(CaseImported @event)
        {
            Subject     = @event.Subject;
            Description = @event.Description;

            CaseNumber = @event.CaseNumber;

            Status = @event.Status;
        }
예제 #21
0
 /// <summary>
 /// Makes the given city use this case as a field.
 /// </summary>
 /// <param name="city">The city the field belongs to.</param>
 public virtual void Use(City city)
 {
     if (status != CaseStatus.CITY)
     {
         City     = city;
         status   = CaseStatus.USED;
         Occupant = city.Player;
     }
 }
예제 #22
0
        private Case(CaseId id, CaseImported @event)
            : base(id)
        {
            Subject     = @event.Subject;
            Description = @event.Description;

            CaseNumber = @event.CaseNumber;

            Status = @event.Status;
        }
예제 #23
0
        private Case(CaseId id, CaseCreated @event)
            : base(id)
        {
            Subject     = @event.Subject;
            Description = @event.Description;

            CaseNumber = null;

            Status = CaseStatus.InProgress;
        }
예제 #24
0
        private async Task ChangeCasesStatus(IEnumerable <object> selectedItems, CaseStatus status)
        {
            ShowLoadingAnimation = true;
            try
            {
                await Task.Run(() =>
                {
                    var selectedListViewItems =
                        selectedItems.Select(item => (VirtualListItem <ICustomersDetailViewModel>)item).ToList();
                    var selectedCases =
                        selectedListViewItems.Select(listItem => (CustomersDetailViewModel)listItem.Data).ToList();

                    using (var repository = _customerRepository.GetRepositoryInstance())
                    {
                        foreach (var customersDetailViewModel in selectedCases)
                        {
                            var caseFromDb =
                                repository.Cases.Where(c => c.CaseId == customersDetailViewModel.InnerItem.CaseId).SingleOrDefault();
                            if (caseFromDb != null)
                            {
                                caseFromDb.Status = status.ToString();
                            }
                        }

                        repository.UnitOfWork.Commit();
                    }
                });
            }
            catch (Exception ex)
            {
                string errorActionString = null;
                switch (status)
                {
                case CaseStatus.Open:
                    errorActionString = "reopen";
                    break;

                case CaseStatus.Pending:
                    errorActionString = "take";
                    break;

                case CaseStatus.Resolved:
                    errorActionString = "resolve";
                    break;
                }

                ShowErrorDialog(ex, string.Format("An error occurred when trying to {0} selected cases: {1}", errorActionString, ex.InnerException.Message));
            }
            finally
            {
                ShowLoadingAnimation = false;
                RaiseChangeCaseStatusCanExecute();
                RefreshCommand.Execute();
            }
        }
예제 #25
0
        //TODO: Debug this method. response.Data is always null.
        public IEnumerable<Case> Get(CaseStatus caseStatus)
        {
            var url = caseStatus == CaseStatus.Open ? "kases/open.xml" : "kases/closed.xml";
            var response = _client.Execute<List<Case>>(new RestRequest(url, Method.GET));
            var kases = response.Data;

            foreach (var kase in kases)
                kase.LoadParties(response.Content);

            return kases;
        }
예제 #26
0
        public async Task <IActionResult> Create([Bind("Id,CaseStatusName,Active")] CaseStatus caseStatus)
        {
            if (ModelState.IsValid)
            {
                _context.Add(caseStatus);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(caseStatus));
        }
예제 #27
0
        /// <summary>
        /// Builds a city on this case. If the case was used as a field by another city, it is removed.
        /// </summary>
        /// <param name="city">The city to build.</param>
        public virtual void BuildCity(City city)
        {
            if (status == CaseStatus.USED)
            {
                this._city.RemoveField(this);
            }

            City     = city;
            status   = CaseStatus.CITY;
            Occupant = city.Player;
        }
예제 #28
0
 public DomainLegalCase(int caseNo, string regDate, DateTime gregDate, string defendant, string description, int statusId, CaseStatus status, IList <CaseAppointment> appointments, IList <CaseFollowing> followings)
 {
     CaseNo           = caseNo;
     RegisteredAt     = regDate;
     GregDate         = gregDate;
     Defendant        = defendant;
     Description      = description;
     StatusId         = statusId;
     CaseStatus       = status;
     CaseAppointments = new ObservableCollection <CaseAppointment>(appointments);
     CaseFollowings   = new ObservableCollection <CaseFollowing>(followings);
 }
예제 #29
0
        private CaseStatus CreateCaseStatus(Guid caseId)
        {
            CaseStatus caseStatus = new CaseStatus();

            caseStatus.CaseId = caseId;
            int rnd = Random.Next(3);

            caseStatus.Status     = (CaseStatusType)rnd;
            caseStatus.CreatedOn  = CreateRandomDate(3);
            caseStatus.ModifiedOn = CreateRandomDate(3);
            return(caseStatus);
        }
예제 #30
0
 private CompanyCase()
 {
     category = "";
     title = "";
     clientName = "";
     clientIndustry = "";
     clientWebsite = "";
     period = "";
     background = "";
     description = "";
     result = "";
     status = CaseStatus.None;
 }
예제 #31
0
        public IEnumerable <Kase> Get(CaseStatus caseStatus)
        {
            var url      = caseStatus == CaseStatus.Open ? "kases/open.xml" : "kases/closed.xml";
            var response = _client.Execute <List <Kase> >(new RestRequest(url, Method.GET));
            var kases    = response.Data;

            foreach (var kase in kases)
            {
                kase.LoadParties(response.Content);
            }

            return(kases);
        }
예제 #32
0
        private bool CanChangeCaseStatus(IList <object> selectedItems, CaseStatus status)
        {
            var result = false;

            if (selectedItems != null && selectedItems.Count > 0)
            {
                var selectedListViewItems =
                    selectedItems.Select(item => (VirtualListItem <ICustomersDetailViewModel>)item).ToList();
                var selectedCases =
                    selectedListViewItems.Select(listItem => (CustomersDetailViewModel)listItem.Data).ToList();

                if (selectedCases.All(c => c.Status == status))
                {
                    result = true;
                }
            }

            switch (status)
            {
            case CaseStatus.Open:
                IsTakeContextVisible = result;
                if (result)
                {
                    IsResolveContextVisible = !result;
                    IsReopenContextVisible  = !result;
                }

                break;

            case CaseStatus.Pending:
                IsResolveContextVisible = result;
                if (result)
                {
                    IsTakeContextVisible   = !result;
                    IsReopenContextVisible = !result;
                }
                break;

            case CaseStatus.Resolved:
                IsReopenContextVisible = result;
                if (result)
                {
                    IsTakeContextVisible    = !result;
                    IsResolveContextVisible = !result;
                }

                break;
            }

            return(result);
        }
예제 #33
0
파일: Case.cs 프로젝트: shayaneumar/gabbar
 /// <summary>
 /// Creates an immutable Case object
 /// </summary>        
 /// <param name="id">Globally unique identifier for the case</param>
 /// <param name="title">Title of the case</param>
 /// <param name="createdBy">User who created the case</param>
 /// <param name="createdDateTime">Time and Date that the case was created</param>
 /// <param name="owner">User who owns the case</param>
 /// <param name="notes">The list of notes on the case</param>
 /// <param name="status">Status of the case</param>
 public Case(string id, string title, string createdBy, DateTimeOffset createdDateTime, string owner, IEnumerable<CaseNote> notes, CaseStatus status)
 {
     Id = id;
     Title = title;
     CreatedBy = createdBy;
     CreatedDateTime = createdDateTime;
     CreatedDateString = CreatedDateTime.ToString("d", CultureInfo.CurrentCulture);
     CreatedTimeString = CreatedDateTime.ToString("t", CultureInfo.CurrentCulture);
     CreatedDateTimeString = CreatedDateTime.ToString("g", CultureInfo.CurrentCulture);
     CreatedDateTimeSortableString = CreatedDateTime.ToString("s", CultureInfo.InvariantCulture);
     Owner = owner;
     Notes = notes.ToList();
     StatusEnum = status;
 }
예제 #34
0
        public async Task UpdateStatus(long id, CaseStatus status, CaseMinorStatus?statusMinor = null)
        {
            var param = new DynamicParameters();

            param.Add("@ID", id);
            param.Add("@Status", status);
            param.Add("@StatusMinor", statusMinor);

            await SqlMapper.ExecuteAsync(_unitOfWork.Connection,
                                         "UpdateCaseStatus",
                                         param,
                                         commandType : CommandType.StoredProcedure,
                                         transaction : _unitOfWork.Transaction);
        }
예제 #35
0
 static TestOutcome Map(CaseStatus caseStatus)
 {
     switch (caseStatus)
     {
         case CaseStatus.Passed:
             return TestOutcome.Passed;
         case CaseStatus.Failed:
             return TestOutcome.Failed;
         case CaseStatus.Skipped:
             return TestOutcome.Skipped;
         default:
             return TestOutcome.None;
     }
 }
예제 #36
0
        public static string ConvertStatusClass(CaseStatus status)
        {
            switch (status)
            {
            case CaseStatus.FromSupport:
            case CaseStatus.WaitingForClose:
                return("btn-danger");

            case CaseStatus.New:
                return("btn-warning");

            default:
                return("btn-success");
            }
        }
예제 #37
0
        public static void SetStatus(int id,int comId,CaseStatus sta)
        {
            /*
             CompanyCaseSetStatus
            @id int,
            @comId int=0,
            @sta smallint
             */

            Database.ExecuteNonQuery(CommandType.StoredProcedure, "CompanyCaseSetStatus",
                new SqlParameter[] {Database.MakeInParam("@id",SqlDbType.Int,id),
                                    Database.MakeInParam("@comId",SqlDbType.Int,comId),
                                    Database.MakeInParam("@sta",SqlDbType.SmallInt,(short)sta)});
        }
예제 #38
0
파일: Case.cs 프로젝트: shayaneumar/gabbar
 public Case CloneWith(string id = null, string title = null, CaseStatus? status = null, string createdBy = null, DateTimeOffset? createdDateTime = null, string owner = null, IEnumerable<CaseNote> notes = null)
 {
     return new Case(
         id:id??Id,
         title:title??Title,
         status: status??StatusEnum,
         createdBy:createdBy??CreatedBy,
         createdDateTime:createdDateTime??CreatedDateTime,
         owner:owner??Owner,
         notes:notes??Notes
         );
 }
예제 #39
0
 private string GetStatusString(CaseStatus sta,int id)
 {
     switch (sta)
     {
         case CaseStatus.None:
             return "<img src=\"skin/blank.gif\" class=\"False\"/><a href=\"javascript:;\" onclick=\"invisitEval(" + id.ToString() + ")\">����</a>";
         case CaseStatus.Evaluating:
             return "<img src=\"skin/blank.gif\" class=\"False\"/>�ȴ�";
         case CaseStatus.Evalueated:
             return "<img src=\"skin/blank.gif\" class=\"True\"/>";
     }
     return "...";
 }
예제 #40
0
 static string Result(CaseStatus status)
 {
     switch (status)
     {
         case CaseStatus.Passed:
             return "Success";
         case CaseStatus.Failed:
             return "Failure";
         case CaseStatus.Skipped:
             return "Ignored";
         default:
             throw new ArgumentOutOfRangeException(nameof(status));
     }
 }
예제 #41
0
파일: Case.cs 프로젝트: eske/INSAWars
 /// <summary>
 /// Makes the given city use this case as a field.
 /// </summary>
 /// <param name="city">The city the field belongs to.</param>
 public virtual void Use(City city)
 {
     if (status != CaseStatus.CITY)
     {
         City = city;
         status = CaseStatus.USED;
         Occupant = city.Player;
     }
 }
예제 #42
0
파일: Case.cs 프로젝트: eske/INSAWars
 public virtual void Free()
 {
     City = null;
     status = CaseStatus.FREE;
 }
 public static CaseHistoryEvent ConvertBack(CaseStatus cs)
 {
     return (CaseHistoryEvent)(int)cs;
 }
예제 #44
0
파일: Case.cs 프로젝트: eske/INSAWars
        /// <summary>
        /// Builds a city on this case. If the case was used as a field by another city, it is removed.
        /// </summary>
        /// <param name="city">The city to build.</param>
        public virtual void BuildCity(City city)
        {
            if (status == CaseStatus.USED)
            {
                this._city.RemoveField(this);
            }

            City = city;
            status = CaseStatus.CITY;
            Occupant = city.Player;
        }
예제 #45
0
 CaseResult(string name, CaseStatus status, TimeSpan duration)
 {
     Name = name;
     Status = status;
     Duration = duration;
 }