private void CalculateAll() { string fromdate = ""; string todate = endtimeTB.Text; calObjectList.Clear(); for (int i = 0; i < cfpCount; i++) { string barcode = cfpTable.Rows[i]["CFP_Barcode"].ToString(); string date = PersianDateTime.MiladiToShamsi(cfpTable.Rows[i]["CFP_Date"].ToString()); //انتقال به جدول موقت برای مقایسه و فقط یکبار if (fromdate.Length == 0) { fromdate = date; helper.TransferPTableToTempTable(helper.GetPtableFromDate(fromdate)); helper.TransferPTableToTempTable(helper.GetPtableFromDate(todate)); } CalcObject calcObj = new CalcObject(); calcObj.barcode = barcode; calcObj.fromDate = date; calcObj.toDate = endtimeTB.Text; calObjectList.Add(calcObj); } if (fromdate.Length > 0) { helper.DeletePTable(helper.GetPtableFromDate(fromdate)); helper.DeletePTable(helper.GetPtableFromDate(todate)); helper.GTSCalculateAll(todate); timer1.Start(); } }
private void button2_Click(object sender, EventArgs e) { try { sunDateTB2.Text = PersianDateTime.MiladiToShamsi(miladiTB2.Text); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void Insert_UIFromDateTest() { //assign_testObject.UIFromDate = "2/5/1390";//Utility.ToPersianDate(DateTime.Now.Date); assign_testObject.UIFromDate = PersianDateTime.MiladiToShamsi(DateTime.Now.ToShortDateString()); assign_testObject.Person = ADOPerson1; assign_testObject.WorkGroup = ADOworkGroup1; bussAssign.SaveChanges(assign_testObject, UIActionType.ADD); ClearSession(); assign_testObject = bussAssign.GetByID(assign_testObject.ID); Assert.AreEqual(assign_testObject.FromDate.Date.ToShortDateString(), DateTime.Now.ToShortDateString()); }
public string MiladiToShamsi(DateTime Date) { return(PersianDateTime.MiladiToShamsi(Date.ToShortDateString())); }
public string ShamsiGetNow() { return(PersianDateTime.MiladiToShamsi(DateTime.Today.ToShortDateString())); }
public string ShamsiGetNow() { return(PersianDateTime.MiladiToShamsi(DateTime.Now.ToShortDateString()) + " " + DateTime.Now.ToShortTimeString()); }