Ejemplo n.º 1
0
        protected override void LoadForm()
        {
            try
            {
                if (Request.QueryString["dd"] != null && !string.IsNullOrEmpty(Request.QueryString["dd"]))
                {
                    DateTime _delDate         = DateTime.ParseExact(Request.QueryString["dd"].ToString(), "M/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                    hccProductionCalendar cal = hccProductionCalendar.GetBy(_delDate);
                    //hccProductionCalendar cal = hccProductionCalendar.GetBy(DateTime.Parse(Request.QueryString["dd"].ToString()));

                    if (cal != null)
                    {
                        CurrentCalendarId = cal.CalendarID;

                        if (cal.DeliveryDate < DateTime.Now)
                        {
                            //chkIsCancelled.Enabled = false;
                            btnSave.Enabled = false;
                        }
                    }

                    lkbBack.PostBackUrl += "?cal=" + cal.CalendarID.ToString();
                }

                if (CurrentCartItem != null)
                {
                    // load user profile data
                    hccUserProfile profile = CurrentCartItem.UserProfile;

                    if (profile != null)
                    {
                        hccUserProfile parent = hccUserProfile.GetParentProfileBy(profile.MembershipID);
                        if (parent != null)
                        {
                            lblCustomerName.Text = parent.FirstName + " " + parent.LastName;
                        }

                        lblProfileName.Text           = profile.ProfileName;
                        lblOrderNumber.Text           = CurrentCartItem.OrderNumber;
                        lblDeliveryDate.Text          = CurrentCartItem.DeliveryDate.ToShortDateString();
                        chkIsCancelledDisplay.Checked = CurrentCartItem.IsCancelled;
                        chkIsComplete.Checked         = CurrentCartItem.IsCompleted;

                        lvwAllrgs.DataSource = profile.GetAllergens();
                        lvwAllrgs.DataBind();
                        ProfileNotesEdit_AllergenNote.CurrentUserProfileId = profile.UserProfileID;
                        ProfileNotesEdit_AllergenNote.Bind();

                        lvwPrefs.DataSource = profile.GetPreferences();
                        lvwPrefs.DataBind();
                        ProfileNotesEdit_PreferenceNote.CurrentUserProfileId = profile.UserProfileID;
                        ProfileNotesEdit_PreferenceNote.Bind();
                    }

                    BindgvwALCItems();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        protected override void LoadForm()
        {
            try
            {
                hccProductionCalendar cal = null;

                if (Request.QueryString["dd"] != null && !string.IsNullOrEmpty(Request.QueryString["dd"]))
                {
                    DateTime _delDate = DateTime.ParseExact(Request.QueryString["dd"].ToString(), "M/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                    cal = hccProductionCalendar.GetBy(_delDate);
                    //cal = hccProductionCalendar.GetBy(DateTime.Parse(Request.QueryString["dd"].ToString()));

                    if (cal != null)
                    {
                        CurrentCalendarId = cal.CalendarID;
                    }

                    lkbBack.PostBackUrl += "?cal=" + cal.CalendarID.ToString();
                }

                hccProgramPlan plan    = hccProgramPlan.GetById(CurrentCartItem.Plan_PlanID.Value);
                hccProgram     program = hccProgram.GetById(plan.ProgramID);
                if (plan != null && program != null)
                {
                    CurrentProgramId = program.ProgramID;
                    CurrentNumOfDays = plan.NumDaysPerWeek;

                    // load user profile data
                    hccUserProfile profile = CurrentCartItem.UserProfile;
                    hccUserProfile parent  = hccUserProfile.GetParentProfileBy(profile.MembershipID);

                    lblCustomerName.Text = parent.FirstName + " " + parent.LastName;
                    lblProfileName.Text  = profile.ProfileName;
                    lblProgram.Text      = program.Name;
                    lblPlan.Text         = plan.Name;
                    lblPlanOption.Text   = hccProgramOption.GetById(CurrentCartItem.Plan_ProgramOptionID.Value).OptionText;
                    lblOrderNumber.Text  = CurrentCartItem.OrderNumber;
                    lblQuantity.Text     = CurrentCartItem.Quantity.ToString();
                    lblDeliveryDate.Text = cal.DeliveryDate.ToShortDateString();

                    hccCartItemCalendar cartCal = hccCartItemCalendar.GetBy(CurrentCartItem.CartItemID, cal.CalendarID);

                    if (cartCal != null)
                    {
                        chkIsComplete.Checked = cartCal.IsFulfilled;
                    }

                    chkIsCancelledDisplay.Checked = CurrentCartItem.IsCancelled;

                    lvwAllrgs.DataSource = profile.GetAllergens();
                    lvwAllrgs.DataBind();
                    ProfileNotesEdit_AllergenNote.CurrentUserProfileId = profile.UserProfileID;
                    ProfileNotesEdit_AllergenNote.Bind();

                    lvwPrefs.DataSource = profile.GetPreferences();
                    lvwPrefs.DataBind();
                    ProfileNotesEdit_PreferenceNote.CurrentUserProfileId = profile.UserProfileID;
                    ProfileNotesEdit_PreferenceNote.Bind();

                    defaultMenuSelections = hccProgramDefaultMenu.GetBy(CurrentCalendarId, CurrentProgramId);

                    days = BindWeeklyGlance(defaultMenuSelections, CurrentNumOfDays);

                    BindDdlDays(days);

                    BindForm();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 3
0
        protected override void LoadForm()
        {
            try
            {
                if (Request.QueryString["dd"] != null && !string.IsNullOrEmpty(Request.QueryString["dd"]))
                {
                    DateTime _delDate         = DateTime.ParseExact(Request.QueryString["dd"].ToString(), "M/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                    hccProductionCalendar cal = hccProductionCalendar.GetBy(_delDate);
                    //hccProductionCalendar cal = hccProductionCalendar.GetBy(DateTime.Parse(Request.QueryString["dd"].ToString()));

                    if (cal != null)
                    {
                        CurrentCalendarId = cal.CalendarID;

                        if (cal.DeliveryDate < DateTime.Now)
                        {
                            //chkIsCancelled.Enabled = false;
                            btnSave.Enabled = false;
                        }
                    }

                    lkbBack.PostBackUrl += "?cal=" + cal.CalendarID.ToString();
                }

                if (CurrentCartItem != null)
                {
                    // load user profile data
                    hccUserProfile profile = CurrentCartItem.UserProfile;

                    if (profile != null)
                    {
                        hccUserProfile parent = hccUserProfile.GetParentProfileBy(profile.MembershipID);
                        if (parent != null)
                        {
                            lblCustomerName.Text = parent.FirstName + " " + parent.LastName;
                        }

                        lblProfileName.Text  = profile.ProfileName;
                        lblOrderNumber.Text  = CurrentCartItem.OrderNumber;
                        lblDeliveryDate.Text = CurrentCartItem.DeliveryDate.ToShortDateString();

                        lvwAllrgs.DataSource = profile.GetAllergens();
                        lvwAllrgs.DataBind();
                        ProfileNotesEdit_AllergenNote.CurrentUserProfileId = profile.UserProfileID;
                        ProfileNotesEdit_AllergenNote.Bind();

                        lvwPrefs.DataSource = profile.GetPreferences();
                        lvwPrefs.DataBind();
                        ProfileNotesEdit_PreferenceNote.CurrentUserProfileId = profile.UserProfileID;
                        ProfileNotesEdit_PreferenceNote.Bind();

                        lblItemName.Text              = CurrentCartItem.ItemName;
                        lblPrice.Text                 = CurrentCartItem.ItemPrice.ToString("c");
                        chkIsComplete.Checked         = CurrentCartItem.IsCompleted;
                        chkIsCancelledDisplay.Checked = CurrentCartItem.IsCancelled;
                        //chkIsCancelled.Attributes.Add("onclick", "javascript: return confirm('Are you sure that you want to change this order item's Cancellation status?')");
                    }

                    lblQuantity.Text = CurrentCartItem.Quantity.ToString();

                    if (CurrentCartItem.Gift_IssuedTo.HasValue)
                    {
                        lblIssuedTo.Text = hccUserProfile.GetParentProfileBy(CurrentCartItem.Gift_IssuedTo.Value).FullName;
                    }

                    if (CurrentCartItem.Gift_IssuedDate.HasValue)
                    {
                        lblIssuedDate.Text = CurrentCartItem.Gift_IssuedDate.Value.ToShortDateString();
                    }

                    lblRecipientEmail.Text = CurrentCartItem.Gift_RecipientEmail;

                    if (CurrentCartItem.Gift_RecipientAddressId.HasValue)
                    {
                        lblRecipientAddress.Text = hccAddress.GetById(CurrentCartItem.Gift_RecipientAddressId.Value).ToHtml();
                    }

                    lblRecipientMessage.Text = CurrentCartItem.Gift_RecipientMessage;

                    if (CurrentCartItem.Gift_RedeemedBy.HasValue)
                    {
                        lblRedeemedBy.Text = hccUserProfile.GetParentProfileBy(CurrentCartItem.Gift_RedeemedBy.Value).FullName;
                    }

                    if (CurrentCartItem.Gift_RedeemedDate.HasValue)
                    {
                        lblRedeemedDate.Text = CurrentCartItem.Gift_RedeemedDate.Value.ToShortDateString();
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }