public static DateTime PersianStringDatetoDate(String PString)
    {
        PersianLibrary.PersianDate PDate = new PersianLibrary.PersianDate(PString);

        DateTime rDate = PersianLibrary.PersianDate.ToDate(PDate.Year, PDate.Month, PDate.Day);

        return(rDate);
    }
Exemplo n.º 2
0
    void loadrecord(int ID)
    {
        if (ID > 0)
        {
            AttException record = AttendanceBLL.GetExceptionByID(ID);
            uxID.Value       = ID.ToString();
            uxEmployees.Text = record.UserID.ToString();
            uxExceptionType.SelectedValue = record.ExceptionTypID.ToString();
            PersianLibrary.PersianDate SD = PersianLibrary.PersianDate.Convert(record.StartDate);

            uxDateStart.Text = SD.DateString;;
            PersianLibrary.PersianDate ED = PersianLibrary.PersianDate.Convert(record.EndDate);
            uxDateEnd.Text   = ED.DateString;
            uxNote.InnerText = record.Note;
        }
    }
Exemplo n.º 3
0
    void loadrecord(int ID)
    {
        if (ID > 0)
        {
            UrgentTicket record = AttendanceBLL.GetEmployeeTicketByID(ID);
            uxID.Value       = ID.ToString();
            uxEmployees.Text = record.UserID.ToString();

            PersianLibrary.PersianDate SD = PersianLibrary.PersianDate.Convert(record.TicketDate);
            uxDate.Text = SD.DateString;

            String ot = (record.TicketDate + record.OutTime).ToString("hh:mm tt");
            uxOutTime.Text = ot;

            uxReturnList.Text = record.WillReturn.ToString();

            String ret = (record.TicketDate + record.ReturnTime).Value.ToShortTimeString();
            uxReturnTime.Text = ret;
            uxNote.InnerText  = record.Note;
        }
    }
Exemplo n.º 4
0
 /// <summary>
 /// Compares the value of this instance to a specified PersianDate value and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified PersianDate value.
 /// </summary>
 public int CompareTo(PersianDate persianDate)
 {
     return(DateTime.Compare(this.FormalDateTime, persianDate.FormalDateTime));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Compares two instances of PersianDate and returns an integer that indicates whether the first instance is earlier than, the same as, or later than the second instance.
 /// </summary>
 public static int Compare(PersianDate firstPersianDate, PersianDate secondPersianDate)
 {
     return(DateTime.Compare(firstPersianDate.FormalDateTime, secondPersianDate.FormalDateTime));
 }
Exemplo n.º 6
0
        /// <summary>
        /// Returnes a System.DateTime object equivalent to the Persian date
        /// </summary>
        /// <param name="Input">Persian year, month and day and times as int</param>
        public static DateTime ToDate(int year, int month, int day, int hour, int minute, int second, int millisecond)
        {
            PersianDate persianDate = new PersianDate(year, month, day, hour, minute, second, millisecond);

            return(persianDate.FormalDateTime);
        }