Skip to content

Commit 4d81747

Browse files
committed
Adding Various Extension Methods of Common Data Types
1 parent 0a6a6dc commit 4d81747

20 files changed

+2487
-12
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace SadrTools.CommonConsts;
2+
3+
/// <summary>
4+
/// پراپرتی های مربوط به برنامه
5+
/// </summary>
6+
public static class Application
7+
{
8+
/// <summary>
9+
/// نام کاربری شخص لاگین شده
10+
/// </summary>
11+
public static string LoginName { get; set; }
12+
13+
/// <summary>
14+
/// نام شخص لاگین شده
15+
/// </summary>
16+
public static string PersonName { get; set; }
17+
18+
19+
}
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
namespace SadrTools.CommonConsts;
2+
3+
public static class Messages
4+
{
5+
public static class Information
6+
{
7+
/// <summary>
8+
/// نام کاربری یا کلمه عبور صحیح نمیباشد
9+
/// </summary>
10+
public static readonly string WrongUsernamePassword = "نام کاربری یا کلمه عبور اشتباه است";
11+
12+
/// <summary>
13+
/// ورود ناموفق
14+
/// </summary>
15+
public static readonly string UnSuccessfulLogin = "ورود ناموفق";
16+
17+
public static readonly string NotLoggedIn = "کارمندی لاگین نشده است";
18+
19+
public static readonly string SqlException = "وقوع مشکل در هنگام کار با دیتایس";
20+
21+
public static readonly string SqlExceptionCaption = "خطای بانک اطلاعاتی";
22+
23+
public static readonly string Exception = "وقوع مشکل در سیستم";
24+
25+
public static readonly string ExceptionCaption = "خطای سیستمی";
26+
27+
/// <summary>
28+
/// این نام کاربری قبلا ثبت شده است
29+
/// </summary>
30+
public static readonly string DuplicateUsername = "این نام کاربری قبلا ثبت شده است";
31+
32+
/// <summary>
33+
/// کلمه عبور فعلی درست نمیباشد
34+
/// </summary>
35+
public static readonly string InvalidCurrentPassword = "کلمه عبور فعلی درست نمیباشد";
36+
37+
38+
public static readonly string NewUsername = "انتخاب نام کاربری جدید";
39+
40+
public static readonly string Welcome = " خوش آمدید ";
41+
42+
/// <summary>
43+
/// برای این شخص قبلا نام کاربری ثبت شده است
44+
/// </summary>
45+
public static readonly string PersonHasUsername = "برای این شخص قبلا نام کاربری ثبت شده است";
46+
47+
public static readonly string LoginToSystem = "ورود به سیستم";
48+
49+
public static readonly string Warning = "هشدار";
50+
51+
public static readonly string Delete = "آیا از حذف رکورد جاری مطمئن هستید؟";
52+
53+
public static readonly string NoRowSelected = "! ردیفی انتخاب نشده است";
54+
55+
public static readonly string AllFormsShouldBeClosed = "تمام فرم ها بسته خواهند شد آیا مطمئن هستید؟";
56+
57+
public static readonly string SuccessBackup = "تهیه نسخه پشتیبان با موفقیت انجام گردید";
58+
59+
public static readonly string Backup = "پشتیبان";
60+
61+
public static readonly string Restore = "بازیابی";
62+
63+
public static readonly string BackupAuto = "قبل از بازیابی، از اطلاعات شما در مسیر زیر نسخه پشتیبان تهیه گردید" + "\n";
64+
65+
public static readonly string SuccessRestore = "نسخه پشتیبان با موفقیت بازیابی گردید";
66+
67+
/// <summary>
68+
/// لطفا یک مورد را انتخاب کنید
69+
/// </summary>
70+
public static readonly string PlzChoose = "لطفا یک مورد را انتخاب کنید";
71+
72+
/// <summary>
73+
/// مبلغ وارد نشده است
74+
/// </summary>
75+
public static readonly string NoAmount = "مبلغ وارد نشده است";
76+
77+
/// <summary>
78+
/// مبلغ درخواستی در رنج تعریف شده نمیباشد
79+
/// </summary>
80+
public static readonly string NotInRangeAmount = "مبلغ درخواستی در رنج تعریف شده نمیباشد";
81+
82+
83+
/// <summary>
84+
/// کلمات عبور یکسان نیستند
85+
/// </summary>
86+
public static readonly string PasswordsNotEqual = "کلمات عبور یکسان نیستند";
87+
88+
}
89+
90+
public static class Exception
91+
{
92+
/// <summary>
93+
/// عبارت مورد نظر قابل تبدیل به عدد صحیح نمیباشد
94+
/// </summary>
95+
public static readonly string ToInt = "عبارت مورد نظر قابل تبدیل به عدد صحیح نمیباشد";
96+
97+
/// <summary>
98+
/// عبارت مورد نظر قابل تبدیل به عدد اعشاری نمیباشد
99+
/// </summary>
100+
public static readonly string ToFloat = "عبارت مورد نظر قابل تبدیل به عدد اعشاری نمیباشد";
101+
102+
/// <summary>
103+
/// آبجکت مورد نظر معتبر نمیباشد
104+
/// </summary>
105+
public static readonly string InvalidObject = "آبجکت مورد نظر معتبر نمیباشد";
106+
107+
/// <summary>
108+
/// لیست مورد نظر فقط خواندنی میباشد
109+
/// </summary>
110+
public static readonly string ReadOnlyList = "لیست مورد نظر فقط خواندنی میباشد";
111+
112+
}
113+
}
114+
115+
public static class Names
116+
{
117+
public static readonly string Year = "سال";
118+
119+
public static readonly string Month = "ماه";
120+
121+
public static readonly string Day = "روز";
122+
123+
/// <summary>
124+
/// امروز
125+
/// </summary>
126+
public static readonly string Today = "امروز";
127+
128+
public static readonly string RSA_KEY = "MyInstaAccIs@iCode4dotnet";
129+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
using System.Collections.Generic;
2+
using System.Text;
3+
4+
namespace SadrTools.Extensions
5+
{
6+
public static class CollectionExt
7+
{
8+
public static string ListToStr(this List<string> items)
9+
{
10+
if (items == null || items.Count == 0)
11+
return string.Empty;
12+
13+
var res = "";
14+
foreach (var item in items)
15+
{
16+
res += item + ",";
17+
}
18+
19+
return res.RemoveLastCharacter();
20+
}
21+
22+
public static string ByteArrayToStr(this byte[] bytes)
23+
{
24+
if (bytes == null || bytes.Length == 0)
25+
return string.Empty;
26+
27+
string str = Encoding.UTF8.GetString(bytes);
28+
29+
return str;
30+
}
31+
32+
public static object[] ToObjectArray(this List<string> list)
33+
{
34+
var result = new object[list.Count];
35+
36+
for (int i = 0; i < list.Count; i++)
37+
{
38+
result[i] = list[i];
39+
}
40+
41+
return result;
42+
43+
}
44+
45+
46+
}
47+
}

0 commit comments

Comments
 (0)