Пример #1
0
        public async Task <IActionResult> PutJurisdiction(Jurisdiction jurisdiction)
        {
            if (jurisdiction.DefaultManagerId == 999999999)
            {
                jurisdiction.DefaultManagerId = null;
            }
            if (jurisdiction.SecondaryAgentId == 999999999)
            {
                jurisdiction.SecondaryAgentId = null;
            }
            if (jurisdiction.TertiaryAgentId == 999999999)
            {
                jurisdiction.TertiaryAgentId = null;
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!JurisdictionExists(jurisdiction.Id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Пример #2
0
        /// <summary>
        /// 获取所有权限
        /// </summary>
        public static void GetJurisdictions(out List <Jurisdiction> list)
        {
            list = new List <Jurisdiction>();
            string sql = "select JurisdictionID,JurisdictionName,Description from ipvt_jurisdictiontable";

            MySqlDataReader reader = null;

            try
            {
                reader = CustomMySqlHelper.ExecuteDataReader(sql);
                while (reader.Read())
                {
                    var jur = new Jurisdiction();
                    jur.Id          = EvaluationHelper.ObjectToInt(reader["JurisdictionID"]);
                    jur.JurName     = reader["JurisdictionName"].ToString();
                    jur.Description = reader["Description"].ToString();

                    list.Add(jur);
                }
            }
            catch (Exception ex)
            {
                LogHelper.MainLog("error in GetJurList(int gid)!" + ex.Message);
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();                 //读取完关闭reader对象
                }
            }
        }
Пример #3
0
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as JurisdictionalAuthorizationComponent;

                if (dest == null)
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }

                base.CopyTo(dest);
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (Country != null)
                {
                    dest.Country = (Hl7.Fhir.Model.CodeableConcept)Country.DeepCopy();
                }
                if (Jurisdiction != null)
                {
                    dest.Jurisdiction = new List <Hl7.Fhir.Model.CodeableConcept>(Jurisdiction.DeepCopy());
                }
                if (LegalStatusOfSupply != null)
                {
                    dest.LegalStatusOfSupply = (Hl7.Fhir.Model.CodeableConcept)LegalStatusOfSupply.DeepCopy();
                }
                if (ValidityPeriod != null)
                {
                    dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopy();
                }
                return(dest);
            }
        //保存
        private void BtnSave_Click()
        {
            bool success = false;

            try
            {
                if (!InputValidity(md))
                {
                    return;                    //验证失败
                }
                var model = new Jurisdiction();
                model.Code   = int.Parse(View.txtCode.Text);
                model.Name   = View.txtName.Text.Trim();
                model.Remark = View.txtRemark.Text;
                model.Value  = View.txtValue.Text;
                if (md != null)
                {
                    model.ID = int.Parse(View.txtID.Text);            //修改需要ID的值
                }
                if (new JurisdictionBIZ().Insert(model) > 0)
                {
                    MessageBox.Show("保存成功!");
                    View.Close();
                }
                else
                {
                    MessageBox.Show("保存失败!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存失败!原因是:" + ex.Message);
                UIHelper.WriteLog(ex.Message);
            }
        }
Пример #5
0
        protected override void ProcessRecord()
        {
            string json = string.Empty;

            if (ParameterSetName == "Pipeline")
            {
                json = InvokeWebRequest(InputObject);
            }
            else
            {
                json = InvokeWebRequest();
            }

            string directory = "C:\\ProgramData\\sped.mobi\\";

            Jurisdiction jurisdiction = JsonModelSerializer.DeserializeJurisdiction(json);

            if (!Directory.Exists(directory))
            {
                Directory.CreateDirectory(directory);
            }

            File.WriteAllText(Path.Combine(directory, Regex.Replace(jurisdiction.Data.Title, @"(\\|\/)", string.Empty) + ".json"), JObject.Parse(json).ToString());


            WriteObject(jurisdiction);
        }
Пример #6
0
        public void AgencyQueryServiceClassSetUp()
        {
            _factory             = new MockRepository(MockBehavior.Loose);
            _unitOfWorkAdmin     = _factory.Create <IAdministrationUnitOfWork>();
            _jurisdiction        = new Jurisdiction("ori", "agencyCode");
            _agency              = new AgencyDerived(_jurisdiction, "name");
            _agencyConfiguration = new AgencyConfigurationDerived(_agency, "name");
            _agencyList          = new List <AgencyDerived>();
            _agencyList.Add(_agency);

            _authorizationPolicy = new Mock <IServiceAuthorizationPolicy>();
            _identityProvider    = new Mock <IServiceIdentityProvider>();

            var identityContext = new IdentityContext {
                IdentityId = Guid.NewGuid()
            };

            _identityProvider.Setup(x => x.GetPrincipalIdentifier()).Returns(identityContext.IdentityId);
            _identityProvider.Setup(x => x.GetIdentityContext()).Returns(identityContext);

            _unitOfWorkAdmin.Setup(item => item.Find <Agency>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>()))
            .Returns(_agency);

            _unitOfWorkAdmin.Setup(item => item.GetEntityQuery <Agency>(It.IsAny <TrackingMode>()))
            .Returns(_agencyList.AsQueryable());

            _agencyQueryService = new AgencyQueryService(_unitOfWorkAdmin.Object, Mock.Of <ILog>(), _authorizationPolicy.Object, _identityProvider.Object);
        }
        public void AssemblyInitialization()
        {
            AutomapperConfiguration.Initialize();
            var jurisdiction = new Jurisdiction("ori", "agencyCode");

            AgencyDetails = new AgencyDerived(jurisdiction, "name");
        }
        /// <summary>
        /// Saves the jurisdiction information.
        /// </summary>
        /// <param name="jurisdictionView">The jurisdiction view.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentException">AdminSaveJurisdiction</exception>
        public string SaveJurisdictionInfo(IJurisdictionListView jurisdictionView)
        {
            var result = string.Empty;

            if (jurisdictionView == null)
            {
                throw new ArgumentException("AdminSaveJurisdiction");
            }

            var newRecord = new Jurisdiction
            {
                IsActive         = true,
                JurisdictionName = jurisdictionView.JurisdictionName,
            };

            try
            {
                using (
                    var dbContext = (PitalyticsEntities)this.dbContextFactory.GetDbContext())
                {
                    dbContext.Jurisdictions.Add(newRecord);
                    dbContext.SaveChanges();
                }
            }
            catch (Exception e)
            {
                result = string.Format("SaveJurisdiction - {0} , {1}", e.Message,
                                       e.InnerException != null ? e.InnerException.Message : "");
            }

            return(result);
        }
Пример #9
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as MarketingStatus;

            if (dest == null)
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }

            base.CopyTo(dest);
            if (Country != null)
            {
                dest.Country = (Hl7.Fhir.Model.CodeableConcept)Country.DeepCopy();
            }
            if (Jurisdiction != null)
            {
                dest.Jurisdiction = (Hl7.Fhir.Model.CodeableConcept)Jurisdiction.DeepCopy();
            }
            if (Status != null)
            {
                dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy();
            }
            if (DateRange != null)
            {
                dest.DateRange = (Hl7.Fhir.Model.Period)DateRange.DeepCopy();
            }
            if (RestoreDateElement != null)
            {
                dest.RestoreDateElement = (Hl7.Fhir.Model.FhirDateTime)RestoreDateElement.DeepCopy();
            }
            return(dest);
        }
Пример #10
0
        private StringContent BuildJson(Jurisdiction jurisdiction)
        {
            var json = JsonConvert.SerializeObject(jurisdiction);
            var data = new StringContent(json, Encoding.UTF8, "application/json");

            return(data);
        }
Пример #11
0
        public void AgencyQueryServiceClassSetUp()
        {
            _factory             = new MockRepository(MockBehavior.Loose);
            _unitOfWorkAdmin     = _factory.Create <IAdministrationUnitOfWork>();
            _jurisdiction        = new Jurisdiction("ori", "agencyCode");
            _agency              = new AgencyDerived(_jurisdiction, "name");
            _agencyConfiguration = new AgencyConfigurationDerived(_agency, "name");
            _rmsSystem           = new RMSSystem(Guid.NewGuid(), "description");
            _user = _rmsSystem.CreateUserAccount(_agency, "username", "password");
            _unitOfWorkAdmin.Setup(item => item.Find <Agency>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>()))
            .Returns(_agency);

            _unitOfWorkAdmin.Setup(item => item.Find <User>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>()))
            .Returns(_user);

            _authorizationPolicy = new Mock <IServiceAuthorizationPolicy>();
            _identityProvider    = new Mock <IServiceIdentityProvider>();

            var identityContext = new IdentityContext()
            {
                IdentityId = Guid.NewGuid()
            };

            _identityProvider.Setup(x => x.GetPrincipalIdentifier()).Returns(identityContext.IdentityId);
            _identityProvider.Setup(x => x.GetIdentityContext()).Returns(identityContext);


            _iPasswordQueryService = new PasswordQueryService(_unitOfWorkAdmin.Object, Mock.Of <ILog>(), _authorizationPolicy.Object, _identityProvider.Object);
            SetUpAgencyPasswordConfiguration();
        }
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOfCustomersD?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOfCustomersAbroad?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOfCustomersEU?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOfCustomers?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ThereofActiveD?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ThereofActiveAbroad?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ThereofActiveEU?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ThereofActive?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOfOccasionalCustD?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOfOccasionalCustAbroad?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOfOccasionalCustEU?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOfOccasionalCust?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOpenBalanceD?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOpenBalanceAboad?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOpenBalanceEU?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOpenBalance?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOfInvoicesD?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOfInvoicesAbroad?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOfInvoicesEU?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOfInvoices?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOfEmployeesD?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumOfEmployeesAbroad?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumTransCustD?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumTransCustAbroad?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumTransCustEU?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NumTransCust?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ApplicableCommercialLaw?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Jurisdiction?.GetHashCode() ?? 0);
            return(hashCode);
        }
 public static void UpdateJurisdiction(this AppDbContext context, Jurisdiction jurisdiction)
 {
     Jurisdiction _jurisdiction = context.Jurisdictions.FirstOrDefault<Jurisdiction>(x => x.Id == jurisdiction.Id);
     _jurisdiction.Name = jurisdiction.Name;
     _jurisdiction.SelectMessage = jurisdiction.SelectMessage;
     context.Jurisdictions.Update(_jurisdiction);
     context.SaveChanges();
 }
Пример #14
0
 public override int GetHashCode()
 {
     return(StartDate.GetHashCode()
            + EndDate.GetHashCode()
            + TaxType.GetHashCode()
            + Jurisdiction.GetHashCode()
            + Percent.GetHashCode());
 }
Пример #15
0
 public int Add(Jurisdiction jurisdiction)
 {
     using (SqlSugarClient db = Educationcontext.GetClient())
     {
         var result = db.Insertable <Jurisdiction>(jurisdiction).ExecuteReturnIdentity();
         return(result);
     }
 }
Пример #16
0
        public void CreateUser()
        {
            _jurisdiction = new Jurisdiction("ori", "agencyCode");
            _agency       = new AgencyDerived(_jurisdiction, "name");
            var result = rmssystem.CreateUserAccount(_agency, "data", "data1");

            result.Should().BeOfType(typeof(User));
        }
Пример #17
0
        private void SetUpAgency()
        {
            var jurisdiction = new Jurisdiction("ori", "agencyCode");

            _agency = new AgencyDerived(jurisdiction, "name");
            _administrationUnitOfWork.Setup(item => item.Find <Agency>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>()))
            .Returns(_agency);
        }
 public JurisdictionDto Map(Jurisdiction entity)
 {
     return new JurisdictionDto
                {
                    Id = entity.Id,
                    Name = entity.Name
                };
 }
Пример #19
0
        public static JurisdictionInfrastructure Create()
        {
            Jurisdiction          model     = new Jurisdiction();
            JurisdictionViewModel viewModel = new JurisdictionViewModel(model);
            JurisdictionView      view      = new JurisdictionView(viewModel);

            return(new JurisdictionInfrastructure(model, viewModel, view));
        }
Пример #20
0
 public Models.Jurisdiction GetModel(Jurisdiction jurisdiction)
 {
     return(new Models.Jurisdiction()
     {
         JurisdictionId = jurisdiction.JurisdictionId,
         JurisdictionName = jurisdiction.JurisdictionName,
     });
 }
        public void ClassLevelSetUp()
        {
            var jurisdiction = new Jurisdiction("ori", "agencyCode");

            _agency   = new AgencyDerived(jurisdiction, "name");
            _workflow = _agency.CreateWorkflow("Workflow Title", null);
            _workflowInstanceService = new WorkflowInstanceService();
            SetUpReport();
        }
Пример #22
0
        public void ClassLevelSetUp()
        {
            var jurisdiction = new Jurisdiction("ori", "agencyCode");
            var agency       = new AgencyDerived(jurisdiction, "name");
            var rmsSystem    = new RMSSystem(Guid.NewGuid(), "RMS Description");

            _user = rmsSystem.CreateUserAccount(agency, "New User", "1ab");
            _passwordConfiguration = PasswordConfiguration.Empty;
        }
Пример #23
0
        public async Task <IActionResult> Edit(Jurisdiction jurisdiction)
        {
            var result = await _jurisdictionProcessor.EditJurisdiction(jurisdiction);

            if (result == null)
            {
                return(RedirectToAction("NoAccess", "Home"));
            }
            return(RedirectToAction("Index"));
        }
Пример #24
0
        public override bool IsValid(params ILegalPerson[] persons)
        {
            if (!IsCourtAssigned())
            {
                return(false);
            }

            if (Jurisdiction != null && !Jurisdiction.IsValid(persons))
            {
                AddReasonEntryRange(Jurisdiction.GetReasonEntries());
                return(true);
            }

            if (Venue != null && !Venue.IsValid(persons))
            {
                AddReasonEntryRange(Venue.GetReasonEntries());
                return(true);
            }

            if (ServiceOfProcess != null && !ServiceOfProcess.IsValid(persons))
            {
                AddReasonEntryRange(ServiceOfProcess.GetReasonEntries());
                return(true);
            }

            var plaintiff = this.Plaintiff(persons);

            if (plaintiff == null)
            {
                return(false);
            }

            var plaintiffTitle = plaintiff.GetLegalPersonTypeName();

            var complaint = LinkedTo as Complaint;

            if (complaint == null)
            {
                AddReasonEntry($"{nameof(LinkedTo)} is not of type {nameof(Complaint)}");
                return(false);
            }

            if (!complaint.TryGetRequestedRelief(plaintiff, out var requestedRelief))
            {
                return(false);
            }

            if (!IsReliefCanBeGranted(requestedRelief))
            {
                AddReasonEntry($"{plaintiffTitle} {plaintiff.Name}, {nameof(IsReliefCanBeGranted)} is false");
                return(true);
            }

            return(false);
        }
        public IHttpActionResult GetJurisdiction(int id)
        {
            Jurisdiction jurisdiction = _jurisdictionrepository.Get(id);

            if (jurisdiction == null)
            {
                return(NotFound());
            }

            return(Ok(jurisdiction));
        }
        public IHttpActionResult PostJurisdiction(Jurisdiction jurisdiction)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            jurisdiction.CreateTime = DateTime.Now;
            _jurisdictionrepository.Insert(jurisdiction);

            return(CreatedAtRoute("DefaultApi", new { id = jurisdiction.Id }, jurisdiction));
        }
Пример #27
0
        private static Jurisdiction InitializeItem(Jurisdiction item, IEnumerable <ImportItem> systemValues)
        {
            if (item == null)
            {
                item = new OrderEntityFactory().CreateEntity <Jurisdiction>();
            }
            var itemProperties = item.GetType().GetProperties();

            systemValues.ToList().ForEach(x => SetPropertyValue(item, itemProperties.FirstOrDefault(y => y.Name == x.Name), x.Value));

            return(item);
        }
Пример #28
0
        /// <summary>
        /// 修改/设置权限
        /// </summary>
        /// <param name="jurisdiction"></param>
        /// <returns></returns>
        public int UptJurisdiction(Jurisdiction jur)
        {
            string sqlText = $"UPDATE dbo.Jurisdiction SET JurisdictionUser = '******', JurisdictionHuiyi = '{jur.JurisdictionHuiyi}', JurisdictionWuliao = '{jur.JurisdictionWuliao}', JurisdictionHuodong = '{jur.JurisdictionHuodong}', JurisdictionGonggao = '{jur.JurisdictionGonggao}', JurisdictionData = '{jur.JurisdictionData}' WHERE J_PositionId = '{jur.J_PositionId}'";

            if (SqlDbHelper.ExecuteNonQuery(sqlText))
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
Пример #29
0
        public async Task <string> DeleteJurisdiction(Jurisdiction jurisdiction)
        {
            string url       = $"https://{apiUrl}/api/Jurisdiction/{jurisdiction.Id}";
            var    apiHelper = new ApiHelper(_accessor).InitializeClient();
            var    data      = BuildJson(jurisdiction);
            var    response  = await apiHelper.DeleteAsync(url);

            if (!response.IsSuccessStatusCode)
            {
                return(null);
            }
            return(response.Content.ReadAsStringAsync().Result);
        }
Пример #30
0
        /// <summary>
        /// Serialize to a JSON object
        /// </summary>
        public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }

            ((Fhir.R4.Models.BackboneElement) this).SerializeJson(writer, options, false);

            if (Country != null)
            {
                writer.WritePropertyName("country");
                Country.SerializeJson(writer, options);
            }

            if (Jurisdiction != null)
            {
                writer.WritePropertyName("jurisdiction");
                Jurisdiction.SerializeJson(writer, options);
            }

            if (Status != null)
            {
                writer.WritePropertyName("status");
                Status.SerializeJson(writer, options);
            }

            if (DateRange != null)
            {
                writer.WritePropertyName("dateRange");
                DateRange.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(RestoreDate))
            {
                writer.WriteString("restoreDate", (string)RestoreDate !);
            }

            if (_RestoreDate != null)
            {
                writer.WritePropertyName("_restoreDate");
                _RestoreDate.SerializeJson(writer, options);
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
        /// <summary>
        /// Update region
        /// </summary>
        /// <param name="context"></param>
        /// <param name="regionInfo"></param>
        public static void UpdateSeedJurisdictionInfo(this AppDbContext context, Jurisdiction jurisdictionInfo)
        {
            Jurisdiction jurisdiction = context.GetJurisdictionByName(jurisdictionInfo.Name);
            if (jurisdiction == null)
            {
                context.AddJurisdiction(jurisdictionInfo);
            }
            else
            {
                jurisdiction.Name = jurisdictionInfo.Name;
                jurisdiction.SelectMessage = jurisdictionInfo.SelectMessage;
                context.UpdateJurisdiction(jurisdiction);

            }
        }
Пример #32
0
        public StateSettings(IResource stateSettings)
        {
            log = LogManager.GetLog(this.GetType());

            ActiveJurisdiction = new Jurisdiction(Jurisdiction.JurisdictionSetting.Default);
        }