示例#1
0
    private Dictionary <string, object> ConvertCalculationRangesList_CalculationRange(Dictionary <string, object> paramBatch)
    {
        Dictionary <string, object> paramDic = new Dictionary <string, object>();
        int operationYear = 0;

        if (!(bool)paramBatch["IsNavigate"])
        {
            switch (this.LangProv.GetCurrentSysLanguage())
            {
            case "fa-IR":
                PersianCalendar pCal = new PersianCalendar();
                operationYear = pCal.GetYear(new DateTime(this.OperationYear, 1, 1));
                break;

            case "en-US":
                operationYear = this.OperationYear;
                break;
            }
        }
        else
        {
            operationYear = this.OperationYear;
        }
        paramDic.Add("M", paramBatch["M"].ToString());
        int    Fm          = 0;
        int    Fd          = 0;
        int    Tm          = 0;
        int    Td          = 0;
        string strFromDate = operationYear.ToString() + "/" + paramBatch["Fm"].ToString() + "/" + paramBatch["Fd"].ToString();
        string strToDate   = operationYear.ToString() + "/" + paramBatch["Tm"].ToString() + "/" + paramBatch["Td"].ToString();

        if (!(bool)paramBatch["IsNavigate"])
        {
            DateTime fromDate = this.LangProv.GetSysDateTime(strFromDate);
            Fm = fromDate.Month;
            Fd = fromDate.Day;
            DateTime toDate = this.LangProv.GetSysDateTime(strToDate);
            Tm = toDate.Month;
            Td = toDate.Day;
        }
        else
        {
            GTS.Clock.Business.AppSettings.DateObj fromDateObj = this.LangProv.GetDBDateTime(strFromDate);
            Fm = fromDateObj.Month;
            Fd = fromDateObj.Day;
            GTS.Clock.Business.AppSettings.DateObj toDateObj = this.LangProv.GetDBDateTime(strToDate);
            Tm = toDateObj.Month;
            Td = toDateObj.Day;
        }
        paramDic.Add("Fm", Fm);
        paramDic.Add("Fd", Fd);
        paramDic.Add("Tm", Tm);
        paramDic.Add("Td", Td);
        return(paramDic);
    }
示例#2
0
        public DateObj GetDBDateTime(string strDBDateTime)
        {
            DateObj  dateObj    = new DateObj();
            DateTime dbDateTime = DateTime.Parse(strDBDateTime);

            switch (this.GetCurrentSysLanguage())
            {
            case "fa-IR":
                PersianCalendar pCal = new PersianCalendar();
                dateObj.Month = pCal.GetMonth(dbDateTime);
                dateObj.Day   = pCal.GetDayOfMonth(dbDateTime);
                break;

            case "en-US":
                dateObj.Month = dbDateTime.Month;
                dateObj.Day   = dbDateTime.Day;
                break;
            }
            return(dateObj);
        }