public async Task <string> RenderOrgAgreementHtmlAsync(AgreementType type, string orgName, DateTimeOffset?acceptedDate, bool forPdf) { string viewName; switch (type) { case AgreementType.CommunityPracticeOrgAgreement: viewName = forPdf ? "/Views/CommunityPracticeOrganizationAgreementPdf.cshtml" : "/Views/CommunityPracticeOrganizationAgreement.cshtml"; break; case AgreementType.CommunityPharmacyOrgAgreement: viewName = forPdf ? "/Views/CommunityPharmacyOrganizationAgreementPdf.cshtml" : "/Views/CommunityPharmacyOrganizationAgreement.cshtml"; break; default: throw new ArgumentException($"Invalid AgreementType {type} in {nameof(RenderOrgAgreementHtmlAsync)}"); } DateTimeOffset displayDate = acceptedDate ?? DateTimeOffset.Now; // Converting to BC time here since we aren't localizing this time in the web client displayDate = displayDate.ToOffset(new TimeSpan(-7, 0, 0)); return(await _razorConverterService.RenderViewToStringAsync(viewName, new Tuple <string, DateTimeOffset>(orgName, displayDate))); }
public PrivacyViewModel(AgreementType type) { switch (type) { case AgreementType.GDPR: header = "Политика конфиденциальности сookie"; target = String.Empty; list = String.Empty; break; case AgreementType.Client: header = "Согласие на обработку персональных данных Пользователя информационной системы «Школьная библиотека»"; target = "идентификация стороны при регистрации в информационной системе"; list = "фамилия, имя, отчество, дата рождения, пол, класс, адрес электронной почты, телефон"; break; case AgreementType.Admin: header = "Согласие на обработку персональных данных Администратора информационной системы «Школьная библиотека»"; target = "управление информационной системой"; list = "адрес электронной почты и телефон"; break; case AgreementType.Librarian: header = "Согласие на обработку персональных данных Библиотекаря"; target = "учёта данных о движении библиотечного фонда"; list = "фамилия, имя, отчество"; break; } }
private string GetEncodedPdf(AgreementType type) { string filename; switch (type) { case AgreementType.CommunityPracticeOrgAgreement: filename = "CommunityPracticeOrganizationAgreement.pdf"; break; case AgreementType.CommunityPharmacyOrgAgreement: filename = "CommunityPharmacyOrganizationAgreement.pdf"; break; default: throw new ArgumentException($"Invalid AgreementType {type} in {nameof(GetEncodedPdf)}"); } var assembly = Assembly.GetExecutingAssembly(); var resourcePath = assembly.GetManifestResourceNames() .Single(str => str.EndsWith(filename)); using (Stream stream = assembly.GetManifestResourceStream(resourcePath)) using (var reader = new MemoryStream()) { stream.CopyTo(reader); return(Convert.ToBase64String(reader.ToArray())); } }
public void Update(AgreementType agreementType) { AgreementType be = null; try { be = CrudFactory.Retrieve <AgreementType>(agreementType); if (be != null) { if (!String.IsNullOrEmpty(agreementType.AgreementTypeName)) { CrudFactory.Update(agreementType); } else { // Agreement Type Name is required. throw new BusinessException(58); } } else { // Agreement Type Not Found. throw new BusinessException(57); } } catch (Exception ex) { ExceptionManager.GetInstance().Process(ex); } }
public Agreement FindByAgencyNotVendorSub(int edOrgId, AgreementType agreementType) { var agreement = Context.Query <Agreement>() .FirstOrDefault(a => a.EducationOrganizationId == edOrgId && a.AgreementTypeId == (int)agreementType); return(agreement); }
public Agreement FindByWamsIdNotVendorSub(string wamsId, AgreementType agreementType) { var agreement = Context.Query <Agreement>() .FirstOrDefault(a => a.WamsId == wamsId && a.AgreementTypeId == (int)agreementType); return(agreement); }
public async void TestCreateAgreement(AgreementType determinedType) { // Arrange var service = CreateService(); var enrollee = new EnrolleeFactory().Generate(); enrollee.Submissions = new[] { new Submission { AgreementType = determinedType, CreatedDate = DateTimeOffset.Now, } }; enrollee.AccessAgreementNote = null; TestDb.Has(enrollee); var expectedAgreementId = TestDb.AgreementVersions .Where(a => a.AgreementType == determinedType) .OrderByDescending(a => a.EffectiveDate) .Select(a => a.Id) .First(); // Act await service.CreateEnrolleeAgreementAsync(enrollee.Id); // Assert AssertAgreementGeneration(enrollee, expectedAgreementId); }
public void UpsertNotVendorSub(int edOrgId, string wamsId, bool agree, AgreementType agreementType, string id) { var agreement = agreementType == AgreementType.Agency ? FindByAgencyNotVendorSub(edOrgId, agreementType) : FindByWamsIdNotVendorSub(wamsId, agreementType); if (agreement != null) { agreement.Agree = agree; agreement.ModifiedDate = DateTime.Now; agreement.ModifierId = id; } else { agreement = new Agreement { EducationOrganizationId = edOrgId, WamsId = wamsId, Agree = agree, AgreementTypeId = (int)agreementType, ModifiedDate = DateTime.Now, ModifierId = id }; Context.AddEntity(agreement); } Context.SaveChanges(wamsId); }
public List <Models.ExcelPriceList> ImportPrice(DataTable dt) { List <Models.ExcelPriceList> list = new List <Models.ExcelPriceList>(); // OfferActionType checkIsExist; OfferActionType actionTypes = OfferActionType.Non; DateTime StartDate = DateTime.Now; DateTime EndDate = DateTime.Now; //Getting the default Margin for reseller ViewModel.DefaultMargin.DefaultMarginResellers odjDMR = new DefaultMargin.DefaultMarginResellers(); Models.DefaultMargin defaultResellerMargin = odjDMR.GetDefaultMargin(); //Getting the default Margin for Customer ViewModel.DefaultMargin.DefaultMarginUsers odjDMU = new DefaultMargin.DefaultMarginUsers(); Models.DefaultMargin defaultUserMargin = odjDMU.GetDefaultMargin(); foreach (DataRow item in dt.Rows) { if (item[0].ToString() != "A/C/D/U") { if (item[0].ToString() != "") { actionTypes = OfferActionTypes.ParseEnum <OfferActionType>(item[0].ToString()); //item["A/C/D/U"] } if (item[1].ToString() != "") { StartDate = Convert.ToDateTime(item[1].ToString()); //item["Valid-From Date"] } if (item[2].ToString() != "") { EndDate = Convert.ToDateTime(item[2].ToString()); //item["Valid To Date"] } AgreementType agreementTypes = AgreementTypes.ParseEnum <AgreementType>(item[5].ToString()); //item["License Agreement Type"] CustomerType customerTypes = CustomerTypes.ParseEnum <CustomerType>(item[8].ToString()); //item["End Customer Type"] LicenseType licenseTypes = LicenseTypes.ParseEnum <LicenseType>(item[7].ToString()); //item["Secondary License Type"] string[] unit = item[6].ToString().Split(' ');//item["Purchase Unit"] PurchaseUnit purchaseUnit = PurchaseUnits.ParseEnum <PurchaseUnit>(unit[1]); Models.ExcelPriceList _m = new Models.ExcelPriceList(); _m.ActionType = Convert.ToInt16(actionTypes); _m.AgreementType = Convert.ToInt16(agreementTypes); _m.CustomerType = Convert.ToInt16(customerTypes); _m.LicenseType = Convert.ToInt16(licenseTypes); _m.PurchaseUnitNumber = Convert.ToInt16(unit[0]); _m.PurchaseUnit = Convert.ToInt16(purchaseUnit); _m.MicrosoftId = item[4].ToString();//item["Offer ID"] _m.StartDate = StartDate; _m.EndDate = EndDate; _m.Price = float.Parse(item[9].ToString()); //item["List Price"] _m.Name = item[3].ToString(); _m.CustomerPrice = item[10].ToString() != "" && item[10].ToString() != " " ? Convert.ToDouble(item[10].ToString()) : Convert.ToDouble((_m.Price * defaultUserMargin.DefaultPercentage / 100) + _m.Price); //item["ERP Price"] _m.ResellerPrice = 0; //item[11].ToString() != "" && item[11].ToString() != " " ? Convert.ToDouble(item[11].ToString()) : Convert.ToDouble(((_m.Price * defaultResellerMargin.DefaultPercentage / 100) + _m.Price));//item["Reseller Price"] list.Add(_m); } } return(list); }
public void Initialize(AgreementType type, Action onComplete) { Confirm.onClick.RemoveAllListeners(); Confirm.onClick.AddListener(() => { onComplete.Invoke(); FrameSetController.GetInstance().LoadPreviousFrame(); }); }
private async Task <int> FetchNewestAgreementVersionIdOfType(AgreementType type) { return(await _context.AgreementVersions .AsNoTracking() .OrderByDescending(a => a.EffectiveDate) .Where(a => a.AgreementType == type) .Select(a => a.Id) .FirstAsync()); }
public BaseEntity BuildObject(Dictionary <string, object> row) { var agreementType = new AgreementType { IdAgreementType = GetIntValue(row, DB_COL_ID), AgreementTypeName = GetStringValue(row, DB_COL_NAME) }; return(agreementType); }
public static Agreement Create(Guid contactId, long numeroConvention, AgreementType agreementType) { contactId.EnsureNotEmpty(nameof(contactId)); var convention = new Agreement(History.Empty); convention.AggregateId = Guid.NewGuid(); convention.UncommitedEvents.Add(new AgreementCreated(convention.AggregateId, 1, contactId, numeroConvention, agreementType)); return(convention); }
public void Should_Construct_AgreementType() { AgreementType agreementType = new AgreementType(nameEn, nameAr, isActive); _ = new AgreementType(); _ = agreementType.AgreementTypeId; _ = agreementType.NameAr; _ = agreementType.NameEn; agreementType.ShouldNotBeNull(); }
public ActionResult PrivacyAgreement(AgreementType type) { if (type == AgreementType.GDPR) { return(View(new PrivacyViewModel(type))); } else { return(PartialView(new PrivacyViewModel(type))); } }
public async Task ThenResponseShouldHaveAccountAgreementTypeSetToLevy() { //Arrange AgreementType agreementType = AgreementType.Levy; const string hashedAgreementId = "ABC123"; //Act var result = await _orchestrator.GetAccount(hashedAgreementId); //Assert Assert.AreEqual(agreementType.ToString(), result.AccountAgreementType.ToString()); }
/// <summary> /// EnterPage /// </summary> public override void EnterPage() { base.EnterPage(); this.checkBoxLicense.IsChecked = false; this.Page.Host.SetNextButtonState(true, checkBoxLicense.IsChecked.Value, null); bool showLicense = PropertyBagDictionary.Instance.PropertyExists(PropertyBagConstants.VhdVersionConfiguration) || PropertyBagDictionary.Instance.PropertyExists(PropertyBagConstants.Server); this.currentAgreementType = AgreementType.Notice; this.licenseAgreementHeader.Text = WpfResources.WPFResourceDictionary.PlsReadNotice; this.acessTextLicense.Text = WpfResources.WPFResourceDictionary.AgreeWithNotice; this.LoadAgreementFile(SetupConstants.LicensePath); }
/// <summary>Converts POC property to textual representation</summary> /// <param name="type">POC object property</param> /// <returns>Textual representation</returns> private static string ConvertTypeToText(AgreementType? type) { if (type == null) return string.Empty; switch (type.Value) { case AgreementType.MetricsPassportsIds: return "Договор на оказание юридических услуг #1 (истребование метрик, обмен паспорта, ID, etc.)"; case AgreementType.DocumentPackageGathering: return "Договор на оказание юридических услуг #2 (сбор пакета документов)"; case AgreementType.CompletionCertificate: return "Акт выполненных работ"; case AgreementType.DocumentReceipt: return "Расписка в получении документов"; default: throw new Exception("Unknonw AgreementType"); } }
/// <summary> /// Initializes a new instance of the IntegrationAccountAgreementInner /// class. /// </summary> /// <param name="agreementType">The agreement type. Possible values /// include: 'NotSpecified', 'AS2', 'X12', 'Edifact'</param> /// <param name="hostPartner">The integration account partner that is /// set as host partner for this agreement.</param> /// <param name="guestPartner">The integration account partner that is /// set as guest partner for this agreement.</param> /// <param name="hostIdentity">The business identity of the host /// partner.</param> /// <param name="guestIdentity">The business identity of the guest /// partner.</param> /// <param name="content">The agreement content.</param> /// <param name="createdTime">The created time.</param> /// <param name="changedTime">The changed time.</param> /// <param name="metadata">The metadata.</param> public IntegrationAccountAgreementInner(AgreementType agreementType, string hostPartner, string guestPartner, BusinessIdentity hostIdentity, BusinessIdentity guestIdentity, AgreementContent content, string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), System.DateTime?createdTime = default(System.DateTime?), System.DateTime?changedTime = default(System.DateTime?), object metadata = default(object)) : base(location, id, name, type, tags) { CreatedTime = createdTime; ChangedTime = changedTime; Metadata = metadata; AgreementType = agreementType; HostPartner = hostPartner; GuestPartner = guestPartner; HostIdentity = hostIdentity; GuestIdentity = guestIdentity; Content = content; CustomInit(); }
// DELETE @ api/agreementType public IHttpActionResult Delete(AgreementType agreementType) { try { mng.Delete(agreementType); apiResp = new ApiResponse(); apiResp.Message = "Eliminación exitosa: Tipo de Convenio."; return(Ok(apiResp)); } catch (BusinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } }
// POST @ api/agreementType public IHttpActionResult Post(AgreementType agreementType) { try { mng.Create(agreementType); apiResp = new ApiResponse(); apiResp.Message = "Registro exitoso: Tipo de Convenio"; return(Ok(apiResp)); } catch (BusinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } }
public void SetRadViewColumnCheckCAN2(AgreementType agreementType) { if (agreementType == AgreementType.CCP || agreementType == AgreementType.XCP) { if (_10msCan2 == null) { _10msCan2 = new GridViewCheckBoxColumn(); _10msCan2.DataType = typeof(int); _10msCan2.Name = "_10ms"; _10msCan2.FieldName = "_10ms"; _10msCan2.HeaderText = "10ms"; gridViewCan2.MasterTemplate.Columns.Add(_10msCan2); //gridView.Columns[13].BestFit(); } if (_100msCan2 == null) { _100msCan2 = new GridViewCheckBoxColumn(); _100msCan2.DataType = typeof(int); _100msCan2.Name = "_100ms"; _100msCan2.FieldName = "_100ms"; _100msCan2.HeaderText = "100ms"; gridViewCan2.MasterTemplate.Columns.Add(_100msCan2); //gridView.Columns[14].BestFit(); } foreach (GridViewDataRowInfo row in this.gridViewCan2.Rows) { row.Cells[12].Value = 0; row.Cells[13].Value = 0; } } else if (agreementType == AgreementType.DBC) { if (_dbcSelectCan2 == null) { _dbcSelectCan2 = new GridViewCheckBoxColumn(); _dbcSelectCan2.DataType = typeof(int); _dbcSelectCan2.Name = "_dbcSelectCan2"; _dbcSelectCan2.FieldName = "_dbcSelectCan2"; _dbcSelectCan2.HeaderText = "选择"; gridViewCan2.MasterTemplate.Columns.Add(_dbcSelectCan2); } foreach (GridViewDataRowInfo row in this.gridViewCan2.Rows) { row.Cells[12].Value = 0; } } }
public async Task <string> RenderOrgAgreementHtmlAsync(AgreementType type, string orgName, DateTimeOffset?acceptedDate, bool forPdf) { RazorTemplate <OrgAgreementRazorViewModel> template = (type, forPdf) switch { (AgreementType.CommunityPharmacyOrgAgreement, false) => RazorTemplates.OrgAgreements.CommunityPharmacy, (AgreementType.CommunityPharmacyOrgAgreement, true) => RazorTemplates.OrgAgreements.CommunityPharmacyPdf, (AgreementType.CommunityPracticeOrgAgreement, false) => RazorTemplates.OrgAgreements.CommunityPractice, (AgreementType.CommunityPracticeOrgAgreement, true) => RazorTemplates.OrgAgreements.CommunityPracticePdf, _ => throw new ArgumentException($"Invalid AgreementType {type} in {nameof(RenderOrgAgreementHtmlAsync)}") }; var displayDate = acceptedDate ?? DateTimeOffset.Now; // Converting to BC time here since we aren't localizing this time in the web client displayDate = displayDate.ToOffset(new TimeSpan(-7, 0, 0)); return(await _razorConverterService.RenderTemplateToStringAsync(template, new OrgAgreementRazorViewModel(orgName, displayDate))); }
internal static string ToSerializedValue(this AgreementType value) { switch (value) { case AgreementType.NotSpecified: return("NotSpecified"); case AgreementType.AS2: return("AS2"); case AgreementType.X12: return("X12"); case AgreementType.Edifact: return("Edifact"); } return(null); }
private string GetEncodedPdf(AgreementType type) { var filename = type switch { AgreementType.CommunityPracticeOrgAgreement => "CommunityPracticeOrganizationAgreement.pdf", AgreementType.CommunityPharmacyOrgAgreement => "CommunityPharmacyOrganizationAgreement.pdf", _ => throw new ArgumentException($"Invalid AgreementType {type} in {nameof(GetEncodedPdf)}") }; var assembly = Assembly.GetExecutingAssembly(); var resourcePath = assembly.GetManifestResourceNames() .Single(str => str.EndsWith(filename)); using Stream stream = assembly.GetManifestResourceStream(resourcePath); using var reader = new MemoryStream(); stream.CopyTo(reader); return(Convert.ToBase64String(reader.ToArray())); }
public Agreement Execute(Guid contactId, IEnumerable <Guid> seatsIds, AgreementType agreementType) { CheckThereAreNoDuplicate(seatsIds); var aggregatesToCommit = new List <AggregateRoot>(); Guid?companyId = null; var agreementNumber = _agreementQueries.GetNextAgreementNumber(); if (agreementNumber <= 0) { throw new Exception("Impossible d'obtenir le numéro de convention."); } var agreement = Agreement.Create(contactId, agreementNumber, agreementType); aggregatesToCommit.Add(agreement); NotificationManager manager = null; foreach (var seatId in seatsIds) { var seat = GetAggregate <Seat>(seatId); if (manager == null) { var managerId = _notificationQueries.GetNotificationManagerId(seat.SessionId); manager = GetAggregate <NotificationManager>(managerId); aggregatesToCommit.Add(manager); } if (companyId.HasValue && companyId.Value != seat.CompanyId) { throw new AgreementCompanyException(); } companyId = seat.CompanyId; seat.AssociateAgreement(agreement.AggregateId); manager.SignalAgreementAssociated(agreement.AggregateId, seat.AggregateId, seat.CompanyId); aggregatesToCommit.Add(seat); } PublishUncommitedEvents(aggregatesToCommit.ToArray()); return(agreement); }
public void Create(AgreementType agreementType) { try { if (!String.IsNullOrEmpty(agreementType.AgreementTypeName)) { CrudFactory.Create(agreementType); } else { // Agreement Type Name is required. throw new BusinessException(58); } } catch (Exception ex) { ExceptionManager.GetInstance().Process(ex); } }
public AgreementType RetrieveById(AgreementType agreementType) { AgreementType be = null; try { be = CrudFactory.Retrieve <AgreementType>(agreementType); if (be == null) { // Agreement Type Not Found. throw new BusinessException(57); } } catch (Exception ex) { ExceptionManager.GetInstance().Process(ex); } return(be); }
private Task PublishAgreementSignedMessage( long accountId, long accountLegalEntityId, long legalEntityId, string legalEntityName, long agreementId, bool cohortCreated, string currentUserName, Guid currentUserRef, AgreementType agreementType, int versionNumber, string correlationId) { return(_eventPublisher.Publish(new SignedAgreementEvent { AccountId = accountId, AgreementId = agreementId, AccountLegalEntityId = accountLegalEntityId, LegalEntityId = legalEntityId, OrganisationName = legalEntityName, CohortCreated = cohortCreated, Created = DateTime.UtcNow, UserName = currentUserName, UserRef = currentUserRef, AgreementType = agreementType, SignedAgreementVersion = versionNumber, CorrelationId = correlationId })); }
public List <AgreementType> GetAgreementTypesList() { types.Clear(); using (SqlConnection sqlConnection = new SqlConnection(connection)) { sqlConnection.Open(); sqlCommand = new SqlCommand(outputQuerryAgreementTypes, sqlConnection); var readerAgreementType = sqlCommand.ExecuteReader(); while (readerAgreementType.Read()) { AgreementType type = new AgreementType() { ID = int.Parse(readerAgreementType["ID"].ToString()), Name = readerAgreementType["Название"].ToString(), }; types.Add(type); } sqlConnection.Close(); } return(types); }
public IHttpActionResult RetrieveById(int pIdAgreementType) { try { var agreementType = new AgreementType { IdAgreementType = pIdAgreementType }; agreementType = mng.RetrieveById(agreementType); apiResp = new ApiResponse(); apiResp.Data = agreementType; return(Ok(apiResp)); } catch (BusinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } }
/*********************************************************/ /* AgreementType Implementations */ /*********************************************************/ #region AgreementType Implementations public CreateAgreementTypeResponse CreateAgreementType(CreateAgreementTypeRequest request) { CreateAgreementTypeResponse response = new CreateAgreementTypeResponse(); response.ExceptionState = false; AgreementType agreementType = new AgreementType(); agreementType.Name = request.Name.ToUpper(new CultureInfo("tr-TR")); agreementType.Description = request.Description.ToUpper(new CultureInfo("tr-TR")); Query query = new Query(); query.Add(Criterion.Create<AgreementType>(c => c.Name, request.Name, CriteriaOperator.Equal)); if (_agreementTypeRepository.FindBy(query).Count() > 0) { response.ExceptionState = true; response.ExceptionMessage = @"Bu isimde bir sözleşme tipi zaten var. Lütfen sözleşme tipi adını benzersiz bir isim olarak düzenleyin."; response.AgreementType = agreementType.ConvertToAgreementTypeView(); return response; } object identityToken = _agreementTypeRepository.Add(agreementType); _unitOfWork.Commit(); if (identityToken == null) { response.ExceptionState = true; response.ExceptionMessage = @"Sözleşme tipi kaydedilemedi. Lütfen daha sonra tekrar deneyin."; return response; } response.AgreementType = _agreementTypeRepository.FindBy((int)identityToken).ConvertToAgreementTypeView(); return response; }
public UpdateAgreementTypeResponse UpdateAgreementType(UpdateAgreementTypeRequest request) { UpdateAgreementTypeResponse response = new UpdateAgreementTypeResponse(); response.ExceptionState = false; AgreementType agreementType = new AgreementType(); agreementType.Id = request.Id; agreementType.Name = request.Name.ToUpper(new CultureInfo("tr-TR")); agreementType.Description = request.Description.ToUpper(new CultureInfo("tr-TR")); if (agreementType.Name != _agreementTypeRepository.FindBy(request.Id).Name) { Query query = new Query(); query.Add(Criterion.Create<AgreementType>(c => c.Name, request.Name, CriteriaOperator.Equal)); if (_agreementTypeRepository.FindBy(query).Count() > 0) { response.ExceptionState = true; response.ExceptionMessage = @"Bu isimde bir sözleşme tipi zaten var. Lütfen sözleşme tipi adını benzersiz bir isim olarak düzenleyin."; response.AgreementType = agreementType.ConvertToAgreementTypeView(); return response; } } _agreementTypeRepository.Save(agreementType); _unitOfWork.Commit(); response.AgreementType = agreementType.ConvertToAgreementTypeView(); return response; }