protected void LinkButton5_Click(object sender, EventArgs e) { string FromDate = new PersianDateTime(TextBox8.Text).ToString(); string ToDate = new PersianDateTime(TextBox9.Text).ToString(); var lst5 = BMICustomer_DataProvider.GetLoanBill(TextBox6.Text, FromDate, ToDate, TextBox10.Text.ToInt32()); GridView1.DataSource = lst5; GridView1.DataBind(); }
protected void LinkButton1_Click(object sender, EventArgs e) { string FromDate = new PersianDateTime(TextBox2.Text).ToString(); string ToDate = new PersianDateTime(TextBox3.Text).ToString(); var acclist = BMICustomer_DataProvider.GetAccBill(TextBox1.Text, FromDate, ToDate); GridView1.DataSource = acclist; GridView1.DataBind(); }
public bool Equals(PersianDateTime other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return other.day == day && other.hour == hour && other.minute == minute && other.year == year && other.month == month && other.second == second; }
public TimeSpan Subtract(PersianDateTime InputDate) { DateTime dt = PersianToMiladi(this); DateTime Inputdt = PersianToMiladi(InputDate); return dt.Subtract(Inputdt); }
public static string AddDays(string PerDate, int Days) { int Year = Convert.ToInt32(PerDate.Substring(0, 4)); int Month = Convert.ToInt32(PerDate.Substring(4, 2)); int Day = Convert.ToInt32(PerDate.Substring(6, 2)); PersianDateTime pdate = new PersianDateTime(Year, Month, Day, 0, 0, 0); DateTime dt = PersianToMiladi(pdate); dt = dt.AddDays(Days); return MiladiToPersian(dt).ToString(); }
public static PersianDateTime MiladiToPersian(DateTime MiladiDT) { int year = pcal.GetYear(MiladiDT); int month = pcal.GetMonth(MiladiDT); int day = pcal.GetDayOfMonth(MiladiDT); int hour = pcal.GetHour(MiladiDT); int minute = pcal.GetMinute(MiladiDT); int second = pcal.GetSecond(MiladiDT); PersianDateTime pdate = new PersianDateTime(year, month, day, hour, minute, second); return pdate; }
public static DateTime PersianToMiladi(PersianDateTime persiandate) { return pcal.ToDateTime(persiandate.Year, persiandate.Month, persiandate.Day, persiandate.Hour, persiandate.Minute, persiandate.Second, 0); }
private bool IsValidBMICustomer(string MelliCode, string IdentitySerial, string FatherName, string Fname, string Lname, PersianDateTime birthDate, bool IsChild) { //if (SystemConfigs.IsInTestMode) return true; //string msg = IsChild ? "کودک" : "ولی کودک"; //var cInfo = BMICustomer_DataProvider.GetCustInfoByMelliCode(MelliCode); //if (cInfo != null && cInfo.Any()) //{ // if (cInfo.All(o=>o.SabtId != IdentitySerial)) // { // ShowMessageBox(string.Format("شماره شناسنامه {0} اشتباه است", msg), "خطا"); // return false; // } // if (IsChild && cInfo.All(o=>o.BirthDayDate != birthDate.ToString().Substring(2))) // { // ShowMessageBox("تاریخ تولد اشتباه است", "خطا"); // return false; // } // if (IsChild && cInfo.All(o=>o.cu_FatherName.Similarity(FatherName) < SystemConfigs.DefaultStringSimilarity)) // { // ShowMessageBox("نام پدر اشتباه است", "خطا"); // return false; // } // if (cInfo.All(o=>o.cu_fname.Similarity(Fname) < SystemConfigs.DefaultStringSimilarity)) // { // ShowMessageBox(string.Format("نام و نام خانوادگی {0} اشتباه است", msg), "خطا"); // return false; // } // if (cInfo.All(o=>o.cu_lname.Similarity(Lname) < SystemConfigs.DefaultStringSimilarity)) // { // ShowMessageBox(string.Format("نام و نام خانوادگی {0} اشتباه است", msg), "خطا"); // return false; // } //} //return true; }