static private FormerPaymentOrderDTO PaymentOrderMockData() { var routeNumber = EmpiriaString.BuildRandomString(16); var controlTag = EmpiriaString.BuildRandomString(6); return(new FormerPaymentOrderDTO(routeNumber, DateTime.Today.AddDays(20), controlTag)); }
protected string GetAllRecordingsText() { const string docMultiTlax = "Registrado con el número de documento electrónico <b>{DOCUMENT}</b>, bajo las siguientes {COUNT} partidas registrales:<br/><br/>"; const string docMultiZac = "Registrado bajo las siguientes {COUNT} inscripciones:<br/><br/>"; const string docOneTlax = "Registrado con el número de documento electrónico <b>{DOCUMENT}</b>, bajo la siguiente partida registral:<br/><br/>"; const string docOneZac = "Registrado bajo la siguiente inscripción:<br/><br/>"; const string t1Tlax = " Partida <b>{NUMBER}</b> del <b>{VOL}</b> Sección <b>{SECTION}</b> del <b>Distrito de {DISTRICT}</b>.<br/>"; const string t1Zac = " Inscripción <b>{NUMBER}</b> del <b>{VOL}</b> <b>{SECTION}</b> del <b>Distrito Judicial de {DISTRICT}</b>.<br/>"; string html = String.Empty; string docMulti = ExecutionServer.LicenseName == "Tlaxcala" ? docMultiTlax : docMultiZac; string docOne = ExecutionServer.LicenseName == "Tlaxcala" ? docOneTlax : docOneZac; if (this.recordings.Count > 1) { html = docMulti.Replace("{DOCUMENT}", transaction.Document.DocumentKey); html = html.Replace("{COUNT}", this.recordings.Count.ToString() + " (" + EmpiriaString.SpeechInteger(this.recordings.Count).ToLower() + ")"); } else if (this.recordings.Count == 1) { html = docOne.Replace("{DOCUMENT}", transaction.Document.DocumentKey); } else if (this.recordings.Count == 0) { throw new Exception("Document does not have recordings."); } for (int i = 0; i < recordings.Count; i++) { string x = (ExecutionServer.LicenseName == "Tlaxcala" ? t1Tlax : t1Zac).Replace("{NUMBER}", recordings[i].Number); x = x.Replace("{VOL}", recordings[i].RecordingBook.Name); x = x.Replace("{SECTION}", recordings[i].RecordingBook.RecordingsClass.Name); x = x.Replace("{DISTRICT}", recordings[i].RecordingBook.RecorderOffice.Alias); html += x; } return html; }
private void Page_Load(object sender, System.EventArgs e) { if (IsPostBack) { if (Request.QueryString.Count != 0) { if (txtDate.Value != String.Empty) { objCalendar.SelectedDate = EmpiriaString.ToDateTime(txtDate.Value); objCalendar.VisibleDate = objCalendar.SelectedDate; txtDate.Value = String.Empty; } else { objCalendar.SelectedDate = DateTime.Today; objCalendar.VisibleDate = DateTime.Today; } isVisible = true; } else if (objCalendar.SelectedDate != DateTime.MinValue) { selectedValue = objCalendar.SelectedDate.ToString("dd/MMM/yyyy"); } } }
private Party FillHumanParty() { if (this.Party == null) { this.Party = new HumanParty(); } HumanParty person = (HumanParty) this.Party; if (!String.IsNullOrEmpty(Request.Form[txtBornDate.Name])) { person.RegistryDate = EmpiriaString.ToDateTime(txtBornDate.Value); } else { person.RegistryDate = ExecutionServer.DateMaxValue; } if (!String.IsNullOrEmpty(Request.Form[cboBornLocation.Name])) { person.RegistryLocation = GeographicRegionItem.Parse(int.Parse(Request.Form[cboBornLocation.Name])); } else { person.RegistryLocation = GeographicRegionItem.Unknown; } person.CURPNumber = txtCURPNumber.Value; person.FirstFamilyName = txtFirstFamilyName.Value; person.FirstName = txtFirstName.Value; person.MaritalFamilyName = txtMaritalFamilyName.Value; person.Gender = (Contacts.Gender) Convert.ToChar(cboGender.Value); person.IFENumber = txtIFENumber.Value; person.Nicknames = txtNicknames.Value; person.SecondFamilyName = txtSecondFamilyName.Value; person.TaxIDNumber = txtTaxIDNumber.Value; person.Save(); return person; }
private string IsNoLabourDateCommandHandler() { DateTime date = EmpiriaString.ToDate(GetCommandParameter("date", false)); bool result = (Empiria.DataTypes.Calendar.IsWeekendDate(date) || Empiria.DataTypes.Calendar.IsNoLabourDate(date)); return result.ToString(); }
private string ValidateAnnotationSemanticsCommandHandler() { int annotationBookId = int.Parse(GetCommandParameter("annotationBookId", true)); int annotationTypeId = int.Parse(GetCommandParameter("annotationTypeId", true)); int number = int.Parse(GetCommandParameter("number", false)); bool useBisNumber = bool.Parse(GetCommandParameter("useBisNumber", true)); int imageStartIndex = int.Parse(GetCommandParameter("imageStartIndex", true)); int imageEndIndex = int.Parse(GetCommandParameter("imageEndIndex", true)); int propertyId = int.Parse(GetCommandParameter("propertyId", true)); DateTime presentationTime = EmpiriaString.ToDateTime(GetCommandParameter("presentationTime", false, ExecutionServer.DateMinValue.ToString("dd/MMM/yyyy"))); DateTime authorizationDate = EmpiriaString.ToDate(GetCommandParameter("authorizationDate", false, ExecutionServer.DateMaxValue.ToString("dd/MMM/yyyy"))); int authorizedById = int.Parse(GetCommandParameter("authorizedById", false, "-1")); RecordingBook recordingBook = RecordingBook.Parse(annotationBookId); RecordingActType annotationType = RecordingActType.Parse(annotationTypeId); Person authorizedBy = Person.Parse(authorizedById); Property property = Property.Parse(propertyId); LandRegistrationException exception = null; if (presentationTime != ExecutionServer.DateMinValue) { exception = LRSValidator.ValidateRecordingDates(recordingBook, Recording.Empty, presentationTime, authorizationDate); if (exception != null) { return exception.Message; } } exception = LRSValidator.ValidateRecordingAuthorizer(recordingBook, authorizedBy, authorizationDate); if (exception != null) { return exception.Message; } return String.Empty; }
private string GetAttachmentImageDirectoryCommandHandler() { string position = GetCommandParameter("position", true); string folderName = GetCommandParameter("name", false, String.Empty); int currentPosition = int.Parse(GetCommandParameter("currentPosition", true)); int recordingId = int.Parse(GetCommandParameter("recordingId", false, "0")); Recording recording = Recording.Parse(recordingId); if (currentPosition == -1) { currentPosition = 0; } RecordingAttachmentFolder folder = recording.GetAttachementFolder(folderName); if (!EmpiriaString.IsInteger(position)) { switch (position) { case "first": return folder.GetImageURL(0); case "previous": return folder.GetImageURL(Math.Max(currentPosition - 1, 0)); case "next": return folder.GetImageURL(Math.Min(currentPosition + 1, folder.FilesCount - 1)); case "last": return folder.GetImageURL(folder.FilesCount - 1); case "refresh": return folder.GetImageURL(currentPosition); default: return folder.GetImageURL(currentPosition); } } else { return folder.GetImageURL(int.Parse(position)); } }
private void AppendConcept() { LRSTransactionAct act = new LRSTransactionAct(this.transaction); act.RecordingActType = RecordingActType.Parse(int.Parse(Request.Form[cboRecordingActType.ClientID])); act.LawArticle = LRSLawArticle.Parse(int.Parse(Request.Form[cboLawArticle.ClientID])); //act.ReceiptNumber = cboReceipts.Value.Length != 0 ? cboReceipts.Value : txtRecordingActReceipt.Value; if (txtOperationValue.Value.Length != 0) { act.OperationValue = Money.Parse(Currency.Parse(int.Parse(cboOperationValueCurrency.Value)), decimal.Parse(txtOperationValue.Value)); } if (txtQuantity.Value.Length != 0) { act.Quantity = decimal.Parse(txtQuantity.Value); } act.Unit = Empiria.DataTypes.Unit.Parse(int.Parse(cboUnit.Value)); act.Notes = EmpiriaString.TrimAll(txtConceptNotes.Value); act.Save(); txtOperationValue.Value = String.Empty; txtQuantity.Value = String.Empty; cboUnit.Value = "-1"; txtConceptNotes.Value = String.Empty; onloadScript += "alert('El concepto se agregó correctamente.');"; }
private void RegisterAsObsoleteRecording(bool appendMode) { if (appendMode) { this.recording = new Recording(); oRecordingPaymentEditorControl.Recording = this.recording; } recording.RecordingBook = this.recordingBook; recording.UseBisNumberTag = chkUseBisRecordingNumber.Checked; recording.Number = txtRecordingNumber.Value; recording.Status = RecordingStatus.Obsolete; recording.StartImageIndex = int.Parse(txtImageStartIndex.Value); recording.EndImageIndex = int.Parse(txtImageEndIndex.Value); recording.Notes = txtObservations.Value; if (txtPresentationDate.Value.Length != 0 && txtPresentationTime.Value.Length != 0) { recording.PresentationTime = EmpiriaString.ToDateTime(txtPresentationDate.Value + " " + txtPresentationTime.Value); } if (txtAuthorizationDate.Value.Length != 0) { recording.AuthorizedTime = EmpiriaString.ToDate(txtAuthorizationDate.Value); } if (cboAuthorizedBy.Value.Length != 0) { recording.AuthorizedBy = Contact.Parse(int.Parse(cboAuthorizedBy.Value)); } oRecordingDocumentEditor.FillRecordingDocument(RecordingDocumentType.Parse(int.Parse(cboRecordingType.Value))); recording.Save(); oRecordingPaymentEditorControl.SaveRecordingMainPayment(); this.recordingBook.Refresh(); }
private void AppendNoLegibleAnnotation() { Recording annotation = new Recording(); oAnnotationPaymentEditorControl.Recording = annotation; annotation.RecordingBook = RecordingBook.Parse(int.Parse(Request.Form["cboAnnotationBook"])); annotation.UseBisNumberTag = chkUseBisAnnotationNumber.Checked; annotation.Number = txtAnnotationNumber.Value; annotation.Status = RecordingStatus.NoLegible; annotation.StartImageIndex = int.Parse(txtAnnotationImageStartIndex.Value); annotation.EndImageIndex = int.Parse(txtAnnotationImageEndIndex.Value); if (txtAnnotationPresentationTime.Value.Length != 0) { annotation.PresentationTime = EmpiriaString.ToDateTime(txtAnnotationPresentationDate.Value + " " + txtAnnotationPresentationTime.Value); } else if (txtAnnotationPresentationDate.Value.Length != 0) { annotation.PresentationTime = EmpiriaString.ToDate(txtAnnotationPresentationDate.Value); } if (txtAnnotationAuthorizationDate.Value.Length != 0) { annotation.AuthorizedTime = EmpiriaString.ToDate(txtAnnotationAuthorizationDate.Value); } if (Request.Form["cboAnnotationAuthorizedBy"].Length != 0) { annotation.AuthorizedBy = Contact.Parse(int.Parse(Request.Form["cboAnnotationAuthorizedBy"])); } annotation.Notes = txtAnnotationObservations.Value; oAnnotationDocumentEditor.Recording = annotation; oAnnotationDocumentEditor.FillRecordingDocument(RecordingDocumentType.Parse(int.Parse(cboAnnotationDocumentType.Value))); Property property = Property.Parse(int.Parse(cboAnnotationProperty.Value)); RecordingActType annotationRecordingActType = RecordingActType.Parse(int.Parse(Request.Form["cboAnnotation"])); annotation.Save(); oAnnotationPaymentEditorControl.SaveRecordingMainPayment(); annotation.CreateRecordingAct(annotationRecordingActType, property); annotation.RecordingBook.Refresh(); }
private StepRelation CreateDependencyAsStepRelation(ProjectItem projectItem, ActivityModel formerModel) { var data = new StepRelationDataHolder(); data.Accessibility = "Private"; data.DrivenMode = "Manual"; data.DueOnRule = ConvertDueOnRule(formerModel); if (EmpiriaString.IsBoolean(formerModel.DueOnRuleAppliesForAllContracts) && !EmpiriaString.ToBoolean(formerModel.DueOnRuleAppliesForAllContracts)) { data.ExecutionContext = ConvertExecutionContext(projectItem); } data.ExtensionData = ConvertRelationExtensionData(formerModel); data.FlowControl = "Sequence"; data.RelationKind = "Dependency"; data.SourceId = projectItem.Id; data.TargetId = formerModel.DueOnControllerId; data.WorkSequenceKind = "FinishToFinish"; data.Save(); return(StepRelation.Parse(data.UID)); }
private void MoveToRecording() { string position = GetCommandParameter("goto"); Recording newRecording = null; switch (position) { case "First": newRecording = recordingBook.GetFirstRecording(); break; case "Previous": newRecording = recordingBook.GetPreviousRecording(this.recording); break; case "Next": newRecording = recordingBook.GetNextRecording(this.recording); break; case "Last": newRecording = recordingBook.GetLastRecording(); break; default: if (EmpiriaString.IsInteger(position)) { newRecording = recordingBook.GetRecording(int.Parse(position)); } break; } if (newRecording != null) { this.recording = newRecording; } }
static private string InitialCleaning(string legalBasis) { var temp = EmpiriaString.TrimAll(legalBasis); temp = temp.Replace(",", ", "); temp = temp.Replace(")", ") "); temp = temp.Replace(" , ", ", "); temp = temp.Replace(". ", " "); temp = EmpiriaString.TrimAll(temp); temp = EmpiriaString.TrimControl(temp); temp = EmpiriaString.RemoveEndPunctuation(temp); if (temp.StartsWith("No aplica")) { return(String.Empty); } if (EmpiriaString.DamerauLevenshteinProximityFactor(temp, "No aplicable") > 0.70m) { return(String.Empty); } return(EmpiriaString.TrimAll(temp)); }
static internal string GetNextControlNoForTicket(Contact provider) { var op = DataOperation.Parse("getKBLastTicketControlNoForProvider", provider.Id); var lastTicket = DataReader.GetScalar <string>(op, "SHL-0000"); return(EmpiriaString.IncrementCounter(lastTicket, "SHL-")); }
static internal string GetNextMeetingControlNo(Project project) { var op = DataOperation.Parse("getPMNextMeetingControlForProject", project.Id); var lastTicket = DataReader.GetScalar <string>(op, "SHL-0000"); return(EmpiriaString.IncrementCounter(lastTicket, "SHL-")); }
static private string GetSignRequestKeywordsFilter(string keywords) { string filter = GeneralDataOperations.AllRecordsFilter; if (!String.IsNullOrWhiteSpace(keywords)) { filter = SearchExpression.ParseAndLike("Keywords", EmpiriaString.BuildKeywords(keywords)); } return(filter); }
private void SaveTransaction() { transaction.RecorderOffice = RecorderOffice.Parse(int.Parse(cboRecorderOffice.Value)); transaction.DocumentNumber = txtDocumentNumber.Value; transaction.DocumentType = LRSDocumentType.Parse(int.Parse(cboDocumentType.Value)); transaction.RequestedBy = EmpiriaString.TrimAll(txtRequestedBy.Value).ToUpperInvariant(); transaction.RequestNotes = EmpiriaString.TrimAll(txtRequestNotes.Value); transaction.ManagementAgency = Contact.Parse(int.Parse(cboManagementAgency.Value)); //transaction.ContactEMail = txtContactEMail.Value; //transaction.ContactPhone = txtContactPhone.Value; // Temporal if (transaction.TransactionType.Id == 704) { ApplyVoidReceipt(); } bool isNew = transaction.IsNew; transaction.Save(); onloadScript = "alert('Los cambios efectuados en la información del trámite se guardaron correctamente.');"; if (!isNew) { return; } if (transaction.TransactionType.Id == 700) { switch (transaction.DocumentType.Id) { case 722: AppendConcept(2292, 848); ApplyVoidReceipt(); return; case 725: AppendConcept(2108, 848); return; default: AppendConcept(2100, 850); return; } } else if (transaction.TransactionType.Id == 701) { switch (transaction.DocumentType.Id) { case 730: AppendConcept(2111, 873); return; case 731: AppendConcept(2110, 874); return; case 732: AppendConcept(2113, 871); return; case 733: AppendConcept(2112, 872); return; } } else if (transaction.TransactionType.Id == 704) { ApplyVoidReceipt(); } }
private void UpdateRecordingsControlDates() { int recordingBookId = int.Parse(GetCommandParameter("id")); DateTime fromDate = EmpiriaString.ToDate(GetCommandParameter("fromDate")); DateTime toDate = EmpiriaString.ToDate(GetCommandParameter("toDate")); RecordingBook recordingBook = RecordingBook.Parse(recordingBookId); recordingBook.RecordingsControlTimePeriod = new TimePeriod(fromDate, toDate); recordingBook.Save(); base.SetOKScriptMsg("Las fechas de control del libro fueron actualizadas correctamente."); }
private ProjectItem ParseActivityWithUID(string activityUID) { if (EmpiriaString.IsInteger(activityUID)) { return(ProjectItem.Parse(int.Parse(activityUID))); } else { return(ProjectItem.Parse(activityUID)); } }
protected override void OnSave() { base.Name = $"Saldos acumulados al {this.BalancesDate.ToLongDateString()}"; base.Keywords = EmpiriaString.BuildKeywords(base.Name); if (IsNew) { _list.Value.Add(this); _list.Value.Sort((x, y) => x.BalancesDate.CompareTo(y.BalancesDate)); } base.OnSave(); }
static public FixedList <Project> GetUserProjectFixedList() { string[] stringArray = GetUserProjectList().Split(','); Project[] array = new Project[stringArray.Length]; for (int i = 0; i < array.Length; i++) { array[i] = Project.Parse(int.Parse(EmpiriaString.TrimAll(stringArray[i]))); } return(new FixedList <Project>(array)); }
static internal FixedList <Note> GetObjectPostingsList(string objectType, string objectUID, string keywords = "") { string filter = $"(ObjectType = '{objectType}' AND ObjectUID = '{objectUID}' AND Status <> 'X')"; if (keywords.Length != 0) { filter += " AND "; filter += SearchExpression.ParseAndLike("Keywords", EmpiriaString.BuildKeywords(keywords)); } return(BaseObject.GetList <Note>(filter, "PostingTime") .ToFixedList()); }
private void FillPrivateContractDocument(RecordingDocumentType documentType) { RecordingDocument document = base.Document; document.ChangeDocumentType(documentType); document.IssuePlace = GeographicRegionItem.Parse(int.Parse(cboPrivateDocIssuePlace.Value)); document.Number = txtPrivateDocNumber.Value; document.MainWitnessPosition = TypeAssociationInfo.Parse(int.Parse(Request.Form[cboPrivateDocMainWitnessPosition.Name])); document.MainWitness = Contact.Parse(int.Parse(Request.Form[cboPrivateDocMainWitness.Name])); if (txtPrivateDocIssueDate.Value.Length != 0) { document.IssueDate = EmpiriaString.ToDate(txtPrivateDocIssueDate.Value); } else { document.IssueDate = ExecutionServer.DateMinValue; } }
private void FillPropertyTitleDocument(RecordingDocumentType documentType) { RecordingDocument document = base.Document; document.ChangeDocumentType(documentType); document.Number = txtPropTitleDocNumber.Value; document.IssuedBy = Contact.Parse(int.Parse(cboPropTitleDocIssuedBy.Value)); document.IssueOffice = Organization.Parse(int.Parse(cboPropTitleIssueOffice.Value)); document.StartSheet = txtPropTitleStartSheet.Value; if (txtPropTitleIssueDate.Value.Length != 0) { document.IssueDate = EmpiriaString.ToDate(txtPropTitleIssueDate.Value); } else { document.IssueDate = ExecutionServer.DateMinValue; } }
private StepDataHolder MapToStepDataHolder(StepType stepType, ProjectItem projectItem, ActivityModel formerModel) { var data = new StepDataHolder(); data.Accessibility = "Private"; data.DrivenMode = "Manual"; data.EstimatedDuration = ConvertEstimatedDuration(formerModel); data.ExecutionContext = ConvertExecutionContext(projectItem); data.ExtensionData = ConvertExtensionData(formerModel); data.IsOptional = !formerModel.IsMandatory; data.Notes = projectItem.Notes; data.OldProjectObjectId = projectItem.Id; if (formerModel.DueOnControllerId > 0 && EmpiriaString.IsInteger(formerModel.DueOnTerm)) { StepRelation relation = CreateDependencyAsStepRelation(projectItem, formerModel); var dueOn = Activity.Parse(formerModel.DueOnControllerId); data.DataModels = $"{formerModel.DueOnTerm} {formerModel.DueOnTermUnit} {formerModel.DueOnCondition} " + $"{dueOn.Name} ({dueOn.Template.ActivityType}) [{formerModel.DueOnControllerId}]"; } if (formerModel.IsPeriodic) { data.PeriodicityRule = formerModel.PeriodicRule.ToJson(); } data.ProcedureEntityId = formerModel.EntityId; data.ProcedureId = formerModel.ProcedureId; data.StepKind = formerModel.ActivityType; data.StepName = projectItem.Name.Trim(); data.StepPosition = 0; data.StepType = stepType; data.Tags = projectItem.Tag; data.Themes = projectItem.Theme; return(data); }
private void FillJudicialDocument(RecordingDocumentType documentType) { RecordingDocument document = base.Document; document.ChangeDocumentType(documentType); document.IssuePlace = GeographicRegionItem.Parse(int.Parse(Request.Form[cboJudicialDocIssuePlace.Name])); document.IssueOffice = Organization.Parse(int.Parse(Request.Form[cboJudicialDocIssueOffice.Name])); document.IssuedBy = Contact.Parse(int.Parse(Request.Form[cboJudicialDocIssuedBy.Name])); document.BookNumber = txtJudicialDocBook.Value; document.Number = txtJudicialDocNumber.Value; if (txtJudicialDocIssueDate.Value.Length != 0) { document.IssueDate = EmpiriaString.ToDate(txtJudicialDocIssueDate.Value); } else { document.IssueDate = ExecutionServer.DateMinValue; } }
private string GetFilter() { string filter = String.Empty; if (cboProcessType.Value.Length != 0) { filter = "(TransactionTypeId = " + cboProcessType.Value + ")"; } if (base.SelectedTabStrip != 3 && base.SelectedTabStrip != 4 && cboStatus.Value.Length != 0) { if (filter.Length != 0) { filter += " AND "; } filter += cboStatus.Value; } if (cboRecorderOffice.Value.Length != 0) { if (filter.Length != 0) { filter += " AND "; } filter += "(RecorderOfficeId = " + cboRecorderOffice.Value + ")"; } if (base.SelectedTabStrip == 5 && cboResponsible.Value.Length != 0) { if (filter.Length != 0) { filter += " AND "; } filter += "(ResponsibleId = " + cboResponsible.Value + ")"; } if (txtSearchExpression.Value.Length != 0) { if (filter.Length != 0) { filter += " AND "; } if (cboSearch.Value.Length == 0) { filter += SearchExpression.ParseAndLike("TransactionKeywords", txtSearchExpression.Value); } else { filter += SearchExpression.ParseAndLike(cboSearch.Value, txtSearchExpression.Value); } } if (cboElapsedTime.Value.Length != 0) { if (filter.Length != 0) { filter += " AND "; } filter += cboElapsedTime.Value; } if (cboDate.Value.Length != 0 && txtFromDate.Value.Length != 0) { if (filter.Length != 0) { filter += " AND "; } filter += "([" + cboDate.Value + "] >= '" + EmpiriaString.ToDate(txtFromDate.Value).ToString("yyyy-MM-dd") + "') AND " + "([" + cboDate.Value + "] < '" + EmpiriaString.ToDate(txtToDate.Value).ToString("yyyy-MM-dd 23:59") + "')"; } return filter; }
private Duration ConvertEstimatedDuration(ActivityModel formerModel) { if (formerModel.Duration.Length != 0 && EmpiriaString.IsInteger(formerModel.Duration) && EmpiriaString.ToInteger(formerModel.Duration) > 0 && formerModel.DurationUnit.Length != 0) { string unit = formerModel.DurationUnit == "Undefined" || formerModel.DurationUnit == "NA" ? "BusinessDays" : formerModel.DurationUnit; return(Duration.Parse($"{formerModel.Duration} {unit}")); } else { return(Duration.Empty); } }
protected string GetMultiselectListItems(System.Web.UI.HtmlControls.HtmlSelect control, string controlName) { const string row = "<tr><td><input id='{CONTROL.ID}' name='{CONTROL.NAME}' type='checkbox' value='{ITEM.VALUE}' /></td>" + "<td id='{ITEM.NAME.ID}' style='white-space:normal;width:98%'>{ITEM.NAME}</td></tr>"; string html = String.Empty; foreach (ListItem item in control.Items) { if (EmpiriaString.IsInteger(item.Value) && (int.Parse(item.Value) > 0)) { string temp = row.Replace("{ITEM.VALUE}", item.Value); temp = temp.Replace("{ITEM.NAME}", item.Text); temp = temp.Replace("{ITEM.NAME.ID}", controlName + "_text_" + item.Value); temp = temp.Replace("{CONTROL.ID}", controlName + "_" + item.Value); temp = temp.Replace("{CONTROL.NAME}", controlName); html += temp; } } return html; }
static private string CleanLegalBasis(string legalBasis) { var temp = legalBasis; temp = temp.Replace("Clausula", "Cláusula"); temp = temp.Replace("Cláusulas", "Cláusula"); temp = temp.Replace("Anexos", "Anexo"); temp = temp.Replace(" y Anexo", "; Anexo"); if (EmpiriaString.IsQuantity(EmpiriaString.RemoveEndPunctuation(temp.Split(' ')[0]))) { temp = "Cláusula " + temp; } if (temp.StartsWith("Cláusula")) { var parts = temp.Split(','); var s = String.Empty; foreach (var part in parts) { var x = EmpiriaString.TrimAll(part); if (s.Length == 0) { s = part; continue; } if (EmpiriaString.IsQuantity(EmpiriaString.RemoveEndPunctuation(x))) { s = $"{s}; {part}"; } else { s = $"{s}, {part}"; } } // foreach temp = s; } temp = EmpiriaString.TrimAll(temp); return(temp); }