private void CreateMonthData(DataTable table, DateTime day, int numDay)
    {
        DateTime newDay;

        for (int i = 0; i < numDay; i++)
        {
            bool existDay = false;
            if (table.Rows.Count != 0)
            {
                for (int j = 0; j < table.Rows.Count; j++)
                {
                    DateTime orderDay = ConvertUtilities.ToDateTime(table.Rows[j]["RegisterPeriod"]);
                    newDay = day;
                    if (orderDay.Day == newDay.AddDays(i).Day&& orderDay.Month == newDay.AddDays(i).Month)
                    {
                        _data1.Add(ConvertUtilities.ToDouble(table.Rows[j][_value]));
                        existDay = true;
                        break;
                    }
                }
            }
            if (existDay == false)
            {
                _data1.Add(0);
            }
            newDay = new DateTime(day.Year, day.Month, day.Day).AddDays(i);
            _label1.Add(newDay.ToString("MMM d, yy"));
        }
        _xLegend = "Date";
    }
    private void CreateDayData(DataTable table, DateTime day)
    {
        DateTime newDay;

        for (int i = 0; i < 24; i++)
        {
            bool existHour = false;
            if (table.Rows.Count != 0)
            {
                for (int j = 0; j < table.Rows.Count; j++)
                {
                    newDay = new DateTime(day.Year, day.Month, day.Day, day.Hour, day.Minute, day.Second).AddHours(i);
                    int      orderHour = ConvertUtilities.ToInt32(table.Rows[j]["RegisterPeriod"]);
                    DateTime orderDate = ConvertUtilities.ToDateTime(table.Rows[j]["RegisterDate"]);
                    if (orderHour == newDay.Hour && orderDate.Day == newDay.Day)
                    {
                        _data1.Add(ConvertUtilities.ToDouble(table.Rows[j][_value]));
                        existHour = true;
                        break;
                    }
                }
            }
            if (existHour == false)
            {
                _data1.Add(0);
            }
            newDay = day.AddHours(i);
            _label1.Add(newDay.Hour.ToString());
        }
        _xLegend = "Hours";
    }
Esempio n. 3
0
    private void RestoreControls()
    {
        uxFilterDrop.SelectedValue = FieldValue;

        switch (SearchType)
        {
        case SearchFilterType.Text:
            uxValueText.Text = Value1;
            DisplayTextSearchMessage(FieldName, Value1);
            break;

        case SearchFilterType.Boolean:
            uxBooleanDrop.SelectedValue = ConvertUtilities.ToBoolean(Value1).ToString();
            DisplayBooleanSearchMessage(FieldName, Value1);
            break;

        case SearchFilterType.ValueRange:
            uxLowerText.Text = Value1;
            uxUpperText.Text = Value2;
            DisplayValueRangeMessage(FieldName, Value1, Value2);
            break;

        case SearchFilterType.Date:
            Value1 = ConvertUtilities.ToDateTime(Value1).ToString("MMMM d,yyyy");
            Value2 = ConvertUtilities.ToDateTime(Value2).ToString("MMMM d,yyyy");
            uxStartDateText.Text = Value1;
            uxEndDateText.Text   = Value2;
            DisplayValueRangeMessage(FieldName, Value1, Value2);
            break;
        }
    }
Esempio n. 4
0
    private void PopulateByState()
    {
        uxNext.Visible    = true;
        uxListing.Visible = false;

        try
        {
            if (CurrentState == ListingState.SelectTemplate)
            {
                uxListingTemplate.PopulateControls();
            }
            else if (CurrentState == ListingState.CheckCondition)
            {
                uxHiddenSelectedTemplateID.Value = uxListingTemplate.GetSelectedEBayTemplateID();

                if (!uxHiddenSelectedTemplateID.Value.Equals("-1"))
                {
                    Boolean isFixDateValid = false;
                    Boolean isScheduleDate = false;
                    uxHiddenScheduleDateTime.Value = uxListingTemplate.GetListingSchedule(out isFixDateValid, out isScheduleDate).ToString();
                    uxHiddenIsSchedule.Value       = isScheduleDate.ToString();

                    if (isFixDateValid)
                    {
                        if (!uxCheckCondition.PopulateControls(uxHiddenSelectedTemplateID.Value, ProductIDList))
                        {
                            uxNext.Visible = false;
                        }
                    }
                    else
                    {
                        CurrentState = ListingState.SelectTemplate;
                        uxMessage.DisplayError("Error : Please select schedule date.");
                    }
                }
                else
                {
                    CurrentState = ListingState.SelectTemplate;
                    uxMessage.DisplayError("Error : Please select listing template.");
                }
            }
            else if (CurrentState == ListingState.ShowFee)
            {
                uxShowFee.PopulateControls(
                    uxHiddenSelectedTemplateID.Value,
                    ProductIDList,
                    ConvertUtilities.ToBoolean(uxHiddenIsSchedule.Value),
                    ConvertUtilities.ToDateTime(uxHiddenScheduleDateTime.Value));

                uxNext.Visible    = false;
                uxListing.Visible = true;
            }
        }
        catch (Exception ex)
        {
            uxMessage.DisplayError("Error : " + ex.Message);
        }
    }
Esempio n. 5
0
 private DateTime GetNewsDate()
 {
     if (AdminConfig.CurrentTestMode == AdminConfig.TestMode.Normal)
     {
         return(uxNewDateCalendarPopup.SelectedDate);
     }
     else
     {
         return(ConvertUtilities.ToDateTime(uxDateText.Text));
     }
 }
 public string GetEndDateText()
 {
     try
     {
         ConvertUtilities.ToDateTime(uxEndDateText.Text);
         return(uxEndDateText.Text);
     }
     catch
     {
         return("");
     }
 }
Esempio n. 7
0
    private void CreateList()
    {
        EBayTemplate template = GetEBayTemplateByID(uxHiddenSelectedTemplateID.Value);

        foreach (string productID in ProductIDList)
        {
            if (!string.IsNullOrEmpty(productID))
            {
                string eBayItemID = ListProductToEBay(
                    GetProductByProductID(productID),
                    template, GetEBayCategoryByTemplate(template),
                    ConvertUtilities.ToBoolean(uxHiddenIsSchedule.Value),
                    ConvertUtilities.ToDateTime(uxHiddenScheduleDateTime.Value));

                if (String.IsNullOrEmpty(eBayItemID))
                {
                    return;
                }

                SaveListing(eBayItemID, template);
            }
        }
        MainContext.RedirectMainControl("EBayListing.ascx");
    }
Esempio n. 8
0
 protected string GetShortDate(object createDate)
 {
     return(ConvertUtilities.ToDateTime(createDate).ToShortDateString());
 }
 public void RestoreControls(SearchFilter searchFilterObj)
 {
     uxStartDateText.Text = ConvertUtilities.ToDateTime(searchFilterObj.Value1).ToString("MMMM d,yyyy");
     uxEndDateText.Text   = ConvertUtilities.ToDateTime(searchFilterObj.Value2).ToString("MMMM d,yyyy");
 }