Пример #1
0
        public IQueryable <M_Case> GetCaseById2(int caseid)
        {
            CaseService dbcase   = new CaseService();
            var         caselist = dbcase.LoadEntities(t => t.ID == caseid);

            return(caselist);
        }
        // GET: Case
        private CaseService CreateCaseService()
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new CaseService(userId);

            return(service);
        }
        // GET: Project/Create
        public ActionResult Create()
        {   //create a List of objects through calling your service
            //Store that List in a Viewbag as one of 3-4 parameters of a SelectList object
            //@Html.DropDownList() in your view

            var cpuDb = new CPUService();

            ViewBag.CpuId = new SelectList(cpuDb.GetAllCPUs().ToList(), "CpuId", "Name");


            var memDb = new MemoryService();

            ViewBag.MemoryId = new SelectList(memDb.GetAllMemories().ToList(), "MemoryId", "Name");

            var caseDb = new CaseService();

            ViewBag.CaseId = new SelectList(caseDb.GetAllCases().ToList(), "CaseId", "Name");

            var videoDb = new VideoCardService();

            ViewBag.VideoId = new SelectList(videoDb.GetAllVideoCards().ToList(), "VideoId", "Name");

            var mobaDb = new MOBAService();

            ViewBag.MotherboardId = new SelectList(mobaDb.GetAllMOBAs().ToList(), "MotherboardId", "Name");

            var psuDb = new PSUService();

            ViewBag.PsuId = new SelectList(psuDb.GetAllPowerSupplyUnits().ToList(), "PsuId", "Name");

            return(View());
        }
Пример #4
0
        // GET: Case
        public ActionResult Index()
        {
            var service  = new CaseService();
            var CaseList = service.GetAllCases();

            return(View(CaseList));
        }
Пример #5
0
        // GET : Case/Details/{id}
        public ActionResult Details(int id)
        {
            var service = new CaseService();
            var model   = service.GetCaseById(id);

            return(View(model));
        }
Пример #6
0
        public IHttpActionResult GetCase(int id)
        {
            CaseService caseService = CreateCaseService();
            var         currentCase = caseService.GetCaseById(id);

            return(Ok(currentCase));
        }
Пример #7
0
        private CaseService CreateCaseService()
        {
            var officerId   = Guid.Parse(User.Identity.GetUserId());
            var suspectCase = new CaseService(officerId);

            return(suspectCase);
        }
Пример #8
0
        public IHttpActionResult Get()
        {
            CaseService caseService = CreateCaseService();
            var         cases       = caseService.GetCases();

            return(Ok(cases));
        }
Пример #9
0
        // GET : Case/Edit/{id}
        public ActionResult Edit(int id)
        {
            var service = new CaseService();
            var detail  = service.GetCaseById(id);
            var model   = new CaseEdit
            {
                Name                     = detail.Name,
                Manufacturer             = detail.Manufacturer,
                Color                    = detail.Color,
                PowerSupply              = detail.PowerSupply,
                Type                     = detail.Type,
                SidePanelWindow          = detail.SidePanelWindow,
                PowerSupplyShroud        = detail.PowerSupplyShroud,
                FrontPanelUSB            = detail.FrontPanelUSB,
                MotherboardFormFactor    = detail.MotherboardFormFactor,
                External52Bay            = detail.External52Bay,
                External35Bay            = detail.External35Bay,
                Internal35Bay            = detail.Internal35Bay,
                Internal25Bay            = detail.Internal25Bay,
                FullHeightExpansionSlots = detail.FullHeightExpansionSlots,
                HalfHeightExpansionSlots = detail.HalfHeightExpansionSlots,
                IsAvailable              = detail.IsAvailable
            };

            return(View(model));
        }
Пример #10
0
        /// <summary>
        /// 添加ITunes备份文件夹;
        /// </summary>
        public void AddITunesBackUpDir()
        {
            if (CaseService.ConfirmCaseLoaded() != true)
            {
                return;
            }

            string backUpPath = null;

            //由于暂时不能处理包含了非ASCII的路径;在输入纯ASCII码前,不能进行
            while (true)
            {
                backUpPath = DialogService.Current.OpenDirect();

                if (string.IsNullOrEmpty(backUpPath))
                {
                    return;
                }

                if (WordsIScn(backUpPath) == true)
                {
                    MsgBoxService.Show(LanguageService.FindResourceString(Constants.InvalidItunesBPath));
                    continue;
                }

                break;
            }

            AddITunesBackUpDir(backUpPath);
        }
Пример #11
0
        public virtual void close(CaseExecutionTriggerDto triggerDto)
        {
            try
            {
                CaseService caseService = engine.CaseService;
                CaseExecutionCommandBuilder commandBuilder = caseService.withCaseExecution(caseInstanceId);

                initializeCommand(commandBuilder, triggerDto, "close");

                commandBuilder.close();
            }
            catch (NotFoundException e)
            {
                throw createInvalidRequestException("close", Status.NOT_FOUND, e);
            }
            catch (NotValidException e)
            {
                throw createInvalidRequestException("close", Status.BAD_REQUEST, e);
            }
            catch (NotAllowedException e)
            {
                throw createInvalidRequestException("close", Status.FORBIDDEN, e);
            }
            catch (ProcessEngineException e)
            {
                throw createRestException("close", Status.INTERNAL_SERVER_ERROR, e);
            }
        }
Пример #12
0
        public ActionResult Resumen(int?id)
        {
            try
            {
                var datos = CaseService.InformacionCaso(id).First();
                if (datos != null)
                {
                    ViewBag.caseFolderId = id;
                    ViewBag.caseNumber   = datos.CaseNumber;

                    return(View("Resumen", datos));
                }
                else
                {
                    ViewBag.caseFolderId = id;
                    return(View("_SinDatos"));
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                ViewBag.caseFolderId = id;
                return(View("_SinDatos"));
            }
        }
Пример #13
0
 public ServerService(CaseService caseService, DonorService donorService, VolunteerService volunteerService, DonationService donationService)
 {
     _caseService      = caseService;
     _donorService     = donorService;
     _volunteerService = volunteerService;
     _donationService  = donationService;
 }
        public void SetUpTests()
        {
            _dataModelMock  = new Mock <IDatamodel>();
            _keyMock        = new Mock <IKey>();
            _dataRecordMock = new Mock <IDataRecord>();

            _dataModelServiceMock = new Mock <IDataModelService>();
            _dataModelServiceMock.Setup(d => d.GetDataModel(_connectionModel, _instrumentName, _serverParkName)).Returns(_dataModelMock.Object);
            _dataModelServiceMock.Setup(d => d.GetDataModel(_connectionModel, _databaseFile)).Returns(_dataModelMock.Object);

            _keyServiceMock = new Mock <IKeyService>();
            _keyServiceMock.Setup(d => d.KeyExists(_connectionModel, _keyMock.Object, _instrumentName, _serverParkName)).Returns(true);
            _keyServiceMock.Setup(d => d.GetKey(_dataModelMock.Object, _keyName)).Returns(_keyMock.Object);
            _keyServiceMock.Setup(d => d.GetPrimaryKey(_dataModelMock.Object)).Returns(_keyMock.Object);

            _dataRecordServiceMock = new Mock <IDataRecordService>();
            _dataRecordServiceMock.Setup(d => d.GetDataRecord(_dataModelMock.Object)).Returns(_dataRecordMock.Object);
            _dataRecordServiceMock.Setup(d => d.GetDataRecord(_connectionModel, _keyMock.Object, _instrumentName, _serverParkName))
            .Returns(_dataRecordMock.Object);

            _fieldServiceMock = new Mock <IFieldService>();

            _mapperServiceMock = new Mock <IDataMapperService>();

            _sut = new CaseService(
                _dataModelServiceMock.Object,
                _dataRecordServiceMock.Object,
                _keyServiceMock.Object,
                _fieldServiceMock.Object,
                _mapperServiceMock.Object);
        }
        private async Task <Tuple <DateTime, IEnumerable <Case> > > GetCasesAsync(DateTime?queryDateTime = null)
        {
            IEnumerable <Case> cases = null;
            int days = 0;

            if (!queryDateTime.HasValue)
            {
                queryDateTime = DateTime.Today;
            }


            // continue querying until we get data.
            while (cases == null || cases.Count() == 0)
            {
                queryDateTime = queryDateTime.Value.AddDays(days--);
                cases         = await CaseService.GetCasesByDate(queryDateTime.Value);
            }

            if (cases == null)
            {
                return(null);
            }
            else
            {
                return(new Tuple <DateTime, IEnumerable <Case> >(queryDateTime.Value, cases));
            }
        }
Пример #16
0
        public M_Case GetCaseById(int caseid)
        {
            CaseService dbcase   = new CaseService();
            var         caselist = dbcase.LoadEntities(t => t.ID == caseid);

            return(caselist.FirstOrDefault());
        }
Пример #17
0
        public bool Create(WxPostCaseViewModel model)
        {
            CaseService dbcase   = new CaseService();
            M_Case      caseitem = new M_Case()
            {
                CaseOfSubmit    = DateTime.Now,
                Complainant     = model.accuser,
                ComplainantId   = model.accuserid,
                DateOfBegin     = DateTime.Now,
                DateOfEnd       = DateTime.Now.AddDays(10),
                originalpay     = model.originalpay,
                Publisher       = model.accuser,
                PublisherId     = model.accuserid,
                Respondent      = model.respondent,
                RespondentId    = model.respondentid,
                StatementOfCase = model.description,
                StateOfCase     = model.state,
                Title           = model.title,
                OtherPay1       = model.otherPay1,
                OtherPay2       = model.otherPay2,
                OtherPay3       = model.otherPay3,
            };
            var result = dbcase.AddEntity(caseitem);

            if (result.ID != 0)
            {
                return(true);
            }
            return(false);
        }
Пример #18
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void init()
        public virtual void init()
        {
            historyService             = engineRule.HistoryService;
            managementService          = engineRule.ManagementService;
            caseService                = engineRule.CaseService;
            processEngineConfiguration = engineRule.ProcessEngineConfiguration;
        }
Пример #19
0
        public JsonResult InsertInvestment(int caseId, int caseDetailId, DateTime?fechadecision, string payments, string comment, string caseNumber, int beneficiario)
        {
            DateTime workingDate = DateTime.Now;

            var currentCase = CaseService.FindCaseByNumber(caseNumber);

            var transaction = new Transaction
            {
                CaseDetailId      = caseDetailId,
                TransactionTypeId = (int)TransactionTypeEnum.Inversion,
                TransactionDate   = workingDate,
                TransactionAmount = decimal.Zero,
                Comment           = comment
            };

            TransactionService.CreateTransaction(transaction);


            var amount = decimal.Zero;

            var serializedPayments = JsonConvert.DeserializeObject <List <PaymentTransaction> >(payments);

            foreach (var serializedPayment in serializedPayments)
            {
                var entidad = new Entity
                {
                    FullName = serializedPayment.Entidad,
                    SourceId = 9
                };
                EntityService.CreateEntity(entidad);

                var payment = new Payment
                {
                    CaseId           = caseId,
                    CaseDetailId     = caseDetailId,
                    TransactionId    = transaction.TransactionId,
                    CaseNumber       = caseNumber,
                    ConceptId        = currentCase.ConceptId.Value,
                    ClassId          = 3,
                    Amount           = serializedPayment.Inversion,
                    EntityId_RemitTo = entidad.EntityId,
                    Remitter         = entidad,
                    ToDate           = fechadecision,
                    TransactionNum   = transaction.TransactionId.ToString().PadLeft(9, '0'),
                    CheckBk          = 0,
                    StatusId         = 12,
                    IssueDate        = workingDate,
                    StatusChangeDate = workingDate
                };
                amount += serializedPayment.Inversion.Value;

                PaymentService.CreatePayment(payment);
            }

            transaction.TransactionAmount = amount;

            TransactionService.ModifyTransaction(transaction);

            return(Json(new BasicDataTablesResult(new { Status = "OK" })));
        }
Пример #20
0
 public FacilityUserController()
 {
     _ealertFacilitiesService = new EAlertFacilitiesService();
     _ealertCaseTypesService  = new EAlertCaseTypesService();
     _facilityService         = new FacilityService();
     _caseService             = new CaseService();
     _uCLService = new UCLService();
 }
Пример #21
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void init()
        public virtual void init()
        {
            runtimeService    = processEngineRule.RuntimeService;
            taskService       = processEngineRule.TaskService;
            caseService       = processEngineRule.CaseService;
            repositoryService = processEngineRule.RepositoryService;
            filterService     = processEngineRule.FilterService;
        }
Пример #22
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void init()
        public virtual void init()
        {
            repositoryService          = engineRule.RepositoryService;
            identityService            = engineRule.IdentityService;
            processEngineConfiguration = engineRule.ProcessEngineConfiguration;
            caseService    = engineRule.CaseService;
            historyService = engineRule.HistoryService;
        }
        public ActionResult Index()
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new CaseService(userId);
            var model   = service.GetCases();

            return(View(model));
        }
Пример #24
0
 public void Initialize()
 {
     TestCommon.InitializeTest();
     CaseService.ConfirmCaseLoaded();
     Assert.IsNotNull(CaseService.Current.CurrentCase);
     _hashSetStatusManagementService = ServiceProvider.GetInstance <IHashSetStatusManagementService>();
     Assert.IsNotNull(_hashSetStatusManagementService);
 }
Пример #25
0
        public ActionResult DeleteConfirmed(int id)
        {
            CaseService caseservice = db.CaseServices.Find(id);

            db.CaseServices.Remove(caseservice);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #26
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void init() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void init()
        {
            repositoryService = engineRule.RepositoryService;
            runtimeService    = engineRule.RuntimeService;
            caseService       = engineRule.CaseService;
            decisionService   = engineRule.DecisionService;
            managementService = engineRule.ManagementService;
        }
Пример #27
0
 public MainViewModel(ICaseService service, IScreen hostScreen = null)
     : base(hostScreen)
 {
     this.service = service as CaseService;
     AddCmd       = ReactiveCommand.Create(Add);
     NavigateCmd  = ReactiveCommand.Create(Navigate);
     InitCmd      = ReactiveCommand.CreateFromTask(Init);
 }
Пример #28
0
        public ActionResult CaseInformation(string CaseNumber)
        {
            QueriesViewModel model = new QueriesViewModel();

            model.CaseModel.Case = CaseService.FindCaseDetailByNumber(CaseNumber);

            return(View(model));
        }
    public void ProcessRequest(HttpContext context)
    {
        // send the file in 10k chunks -- should help with mem consumption
        Stream stream = null;

        byte[] buffer = new Byte[10000];
        // Length of the file:
        int length;
        // Total bytes to read:
        long dataToRead;

        try
        {
            CaseService svc = new CaseService();
            // Retrieve the attachment
            DownloadFileResponse response = svc.RetrieveAttachment(context.Request["f"].ToString(), context.Request["u"].ToString());
            AttachmentContract   file     = response.Attachment;
            stream = new MemoryStream(response.FileBytes);
            // Total bytes to read:
            dataToRead = Convert.ToInt64(file.FileSize);
            context.Response.ContentType = "application/octet-stream";
            context.Response.AddHeader("Content-Disposition", "attachment; filename=" + file.FileName);
            // Read the bytes.
            while (dataToRead > 0)
            {
                // Verify that the client is connected.
                if (context.Response.IsClientConnected)
                {
                    // Read the data in buffer.
                    length = stream.Read(buffer, 0, 10000);
                    // Write the data to the current output stream.
                    context.Response.OutputStream.Write(buffer, 0, length);
                    // Flush the data to the HTML output.
                    context.Response.Flush();
                    buffer     = new Byte[10000];
                    dataToRead = dataToRead - length;
                }
                else
                {
                    //prevent infinite loop if user disconnects
                    dataToRead = -1;
                }
            }
        }
        catch (Exception)
        {
            // Trap the error, if any.
            throw;
        }
        finally
        {
            if (stream != null)
            {
                //Close the file.
                stream.Close();
            }
        }
    }
 public PhysicianController()
 {
     _physicianStatusService = new PhysicianStatusService();
     _physician = new PhysicianService();
     _physicianStatusLogService    = new PhysicianStatusLogService();
     _physicianStatusSnoozeService = new PhysicianStatusSnoozeService();
     _caseService = new CaseService();
     _uclService  = new UCLService();
 }