Exemplo n.º 1
0
        protected string GetName(object dataItem)
        {
            ProductInventoryDetail detail = (ProductInventoryDetail)dataItem;

            if (string.IsNullOrEmpty(detail.VariantName))
            {
                return(detail.Name);
            }
            return(string.Format("{0} ({1})", detail.Name, detail.VariantName));
        }
Exemplo n.º 2
0
        protected int GetNotificationsCount(object dataItem)
        {
            ProductInventoryDetail detail = (ProductInventoryDetail)dataItem;

            if (detail.ProductVariantId > 0)
            {
                return(RestockNotifyDataSource.CountForProductVariant(detail.ProductVariantId));
            }
            else
            {
                return(RestockNotifyDataSource.CountForProduct(detail.ProductId));
            }
        }
Exemplo n.º 3
0
        protected string GetLastSent(object dataItem)
        {
            ProductInventoryDetail detail = (ProductInventoryDetail)dataItem;
            IList <RestockNotify>  list   = RestockNotifyDataSource.LoadForProduct(detail.ProductId);

            if (list != null)
            {
                DateTime lastDate = DateTime.MinValue;
                foreach (RestockNotify notify in list)
                {
                    if (notify.LastSentDate > DateTime.MinValue && notify.LastSentDate > lastDate)
                    {
                        lastDate = notify.LastSentDate;
                    }
                }

                if (lastDate > DateTime.MinValue)
                {
                    return(lastDate.ToShortDateString());
                }
            }

            return(string.Empty);
        }
Exemplo n.º 4
0
        protected string GetSendEmailLink(object dataItem)
        {
            ProductInventoryDetail detail = (ProductInventoryDetail)dataItem;

            return(string.Format("~/Admin/Reports/SendRestockAlert.aspx?ProductId={0}&ProductVariantId={1}&ReturnUrl={2}", detail.ProductId, detail.ProductVariantId, Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes("~/Admin/Reports/LowInventory.aspx"))));
        }