SayyehBanTools 1.4.2

dotnet add package SayyehBanTools --version 1.4.2
NuGet\Install-Package SayyehBanTools -Version 1.4.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SayyehBanTools" Version="1.4.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SayyehBanTools --version 1.4.2
#r "nuget: SayyehBanTools, 1.4.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SayyehBanTools as a Cake Addin
#addin nuget:?package=SayyehBanTools&version=1.4.2

// Install SayyehBanTools as a Cake Tool
#tool nuget:?package=SayyehBanTools&version=1.4.2

🌟 SayyehBanTools 🌟

Authors

توضیحات

این package یک ابزار کمکی از دستورات جمع شده برای افزایش سرعت در کد نویسی میباشد. تا بتوانید عملیات کدنویسی سریتر انجام دهید.

Description

SayyehBanTools is a powerful extension to enhance this package. You can also contribute to improving this package and make it stronger together.


Don't forget to include the link to your GitHub repository: SayyehBanTools (https://github.com/SayyehBan/SayyehBanTools) 🚀

Mathematical Calculations

How to work with the Calculator Class and invoke the Calculator Class

نحوه کار با کلاس محاسبات و فراخوانی کلاس محاسبات

// برداشتن اعداد برای محاسبات

double[] numbers = { 2.6, 7, 8, 9 };

// ایجاد نمونه ای از کلاس محاسبات

Calculator calculator = new Calculator();

// انجام عملیات ضرب

double resultMultiply = calculator.Multiply(numbers);

// انجام عملیات جمع

double resultAdd = calculator.Add(numbers);

// انجام عملیات منفی

double resultSubtract = calculator.Subtract(numbers);

// انجام عملیات تقسیم

double resultDivide = calculator.Divide(numbers);

// انجام عملیات درصد تخفیف

decimal resultDiscount = calculator.Discount(200000, 20);

// انجام عملیات درصد مالیات

decimal resultTaxation = calculator.Taxation(500000, 9);

////////////////////////////////////////////////////////////////

// Getting numbers for calculations

double[] numbers = { 2.6, 7, 8, 9 };

// Creating an instance of the Calculator class

Calculator calculator = new Calculator();

// Performing multiplication operation double resultMultiply = calculator.Multiply(numbers);

// Performing addition operation

double resultAdd = calculator.Add(numbers);

// Performing subtraction operation

double resultSubtract = calculator.Subtract(numbers);

// Performing division operation

double resultDivide = calculator.Divide(numbers);

// Performing discount percentage operation

decimal resultDiscount = calculator.Discount(200000, 20);

// Performing taxation percentage operation

decimal resultTaxation = calculator.Taxation(500000, 9);

    Converting numbers into words for displaying amounts

long moneyNumber = 15451225858;

// تبدیل عدد به حروف برحسب واحد پول ایران

string moneyRaghamToHorof = ConvertNumbertToString.ConvertRaghamToHorof(moneyNumber);

// دا کردن سه رقم اعشار اعداد

string moneyRaghamToJodaJoda = ConvertNumbertToString.ConvertRaghamToJodaJoda(moneyNumber);

// تبدیل عدد به حروف برحسب واحد پول ایران

string moneyNumToString = ConvertNumToString.convert(moneyNumber.ToString());

/////////////////////////////////////////////////////////////////////////////////

کاربرد زیرمجموعه دستورها در StringExtensions: به ترتیب

StringExtensions.HasValue: بررسی اینکه آیا مقدار وجود داره یا خیر

StringExtensions.ToInt: تبدیل به Int

StringExtensions.ToDecimal: تبدیل به ToDecimal

StringExtensions.ToNumeric (int): دریافت مقدار int و نمایش آن به صورت سه رقم اعشار

StringExtensions.ToNumeric (decimal): دریافت مقدار decimal و نمایش آن به صورت سه رقم اعشار

StringExtensions.ToCurrency (int): دریافت مقدار int و نمایش آن به صورت ارزی

StringExtensions.ToCurrency (decimal): دریافت مقدار decimal و نمایش آن به صورت ارزی

StringExtensions.En2Fa: جایگزین عدد انگلیسی به جای عدد پارسی

StringExtensions.Fa2En: جایگزین عدد پارسی به جای عدد انگلیسی

StringExtensions.FixPersianChars: جایگزین حروف عربی و غیر ایرانی به جای حروف پارسی

StringExtensions.RemovePoint: حذف نقطه یا علامت اعشار از اعداد

StringExtensions.CleanString: انجام چندین عملیات پاکسازی با هم

StringExtensions.NullIfEmpty: جلوگیری از مقدار خالی و ارسال Null به جای مقدار خالی

StringExtensions.HtmlTags: حذف تگ‌های html از متن

StringExtensions.ASCII: حذف مقدار عملکر گردها از متن

//////////////////////////////////////////////////////////////

string stringExtensions = StringExtensions.CleanString("چطوری خوبی");

long moneyNumber = 15451225858;

// Convert the number to words based on Iranian currency

string moneyRaghamToHorof = ConvertNumbertToString.ConvertRaghamToHorof(moneyNumber);

// Splitting the decimal numbers

string moneyRaghamToJodaJoda = ConvertNumbertToString.ConvertRaghamToJodaJoda(moneyNumber);

// Convert the number to words based on Iranian currency

string moneyNumToString = ConvertNumToString.convert(moneyNumber.ToString());

// The usage of StringExtensions subset

In order:

StringExtensions.HasValue: Check if a value exists or not

StringExtensions.ToInt: Convert to Int

StringExtensions.ToDecimal: Convert to Decimal

StringExtensions.ToNumeric: Get the int value and display it with split decimal numbers

StringExtensions.ToNumeric: Get the decimal value and display it with split decimal numbers

StringExtensions.ToCurrency: Get the int value and display it as currency

StringExtensions.ToCurrency: Get the decimal value and display it as currency

StringExtensions.En2Fa: Replace Persian numbers with English ones

StringExtensions.Fa2En: Replace English numbers with Persian ones

StringExtensions.FixPersianChars: Replace Persian characters with non-Iranian ones

StringExtensions.RemovePoint: Remove the decimal point or comma from the numbers

StringExtensions.CleanString: Perform several cleaning operations together

StringExtensions.NullIfEmpty: Take care of empty values and send Null instead of an empty value

StringExtensions.HtmlTags: Remove html tags from descriptions

StringExtensions.ASCII: Remove operation characters

////

string stringExtensions = StringExtensions.CleanString("How are you");

    **Analyzing Persian texts: converting non-Persian characters to Persian, converting English numbers into Persian, and vice versa, etc.
/////////////////////////////////////////////////////////////     Date operations: converting and calculating time

In order to convert date and time to your local area, you first need to perform the using operation.

using SayyehBanTools.ShowDateTime

Then, wherever you need to convert the date to your location, use this command.

ConvertDateTime.ConvertToLocalDateTime(item.Time)

This way, wherever you have stored the date and time in UTC format inside the database, you display it in the desired country's format.

برای اینکه بتوانید تاریخ و زمان را به منطقه خودتان تبدیل کنید، ابتدا باید عمل using را انجام دهید.

using SayyehBanTools.ShowDateTime

سپس، در هر جایی که نیاز به تبدیل تاریخ به موقعیت مکانی خود دارید، از این دستور استفاده کنید.

ConvertDateTime.ConvertToLocalDateTime(item.Time)

به این شکل، هر جا که تاریخ و زمان را در فرمت UTC در دیتابیس ذخیره کرده‌اید، آن را با فرمت کشور مورد نظر نمایش می‌دهید. ///////////////////////////////////////////////////////////////     Encoding and decoding encoded values
    Generating values, meaning generating numbers, etc.** ///////////////////////////////////////////////////////////////////

Common List and How to Use Commons

توضیحات به پارسی:

در این بخش، ما یک PagingExtensions در لیست Common داریم که امکان صفحه‌بندی را به صورت LINQ to SQL و یا فقط LINQ فراهم می‌کند.

Description in English:

In this section, we have a PagingExtensions in the Common list that provides pagination functionality in LINQ to SQL and/or just LINQ.

How to Use Pagination Command

public PaginatedItemsDto<CatalogTypeListDto> GetList(int? parentId, int page, int pageSize) { int totalCount = 0;

var model = context.CatalogTypes.AsQueryable().PagedResult(page, pageSize, out totalCount);
var result = mapper.ProjectTo<CatalogTypeListDto>(model).ToList();
return new PaginatedItemsDto<CatalogTypeListDto>(page, pageSize, totalCount, result);

}

In this section, you can use the pagination command .PagedResult(page, pageSize, out totalCount);.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.4.2 63 5/12/2024
1.4.1 70 5/11/2024
1.3.9 84 4/29/2024
1.3.8 80 4/29/2024
1.3.7 84 4/26/2024
1.3.6 88 4/20/2024
1.3.5 78 4/19/2024
1.3.4 79 4/19/2024
1.3.3 65 4/18/2024
1.3.2 74 4/15/2024
1.3.1 91 4/14/2024
1.2.9 77 4/14/2024
1.2.8 76 4/14/2024
1.2.7 95 4/14/2024
1.2.6 77 4/13/2024
1.2.5 98 4/13/2024
1.2.4 82 4/2/2024
1.2.3 72 4/2/2024
1.2.2 96 4/2/2024
1.2.1 87 3/31/2024
1.2.0 69 3/31/2024
1.1.9 75 3/28/2024
1.1.8 86 3/28/2024
1.1.7 82 3/27/2024
1.1.6 81 3/22/2024
1.1.5 76 3/12/2024
1.1.4 85 3/10/2024
1.1.3 88 3/10/2024
1.1.2 86 3/6/2024
1.1.1 83 2/29/2024
1.1.0 94 2/28/2024
1.0.9 83 2/24/2024
1.0.8 78 2/19/2024
1.0.7 120 2/19/2024
1.0.6 105 2/19/2024
1.0.5 83 2/19/2024
1.0.4 82 2/16/2024
1.0.3 86 2/5/2024
1.0.2 82 2/5/2024
1.0.1 85 2/1/2024
1.0.0 79 1/30/2024