Ejemplo n.º 1
0
    private void BindOffer(int offerId)
    {
        ICollisionDetectionService           collisionService;
        AMSResult <CMS.AMS.Models.OCD.Offer> lst = new AMSResult <CMS.AMS.Models.OCD.Offer>();

        collisionService = CurrentRequest.Resolver.Resolve <ICollisionDetectionService>();
        lst = collisionService.GetOfferDetail(offerId);
        if (lst.ResultType == AMSResultType.Success)
        {
            obj = new CMS.AMS.Models.OCD.Offer();
            obj = (CMS.AMS.Models.OCD.Offer)lst.Result;
            if (obj != null)
            {
                lblOfferName.Text = MyCommon.TruncateString(obj.IncentiveName, 37);
                if (!string.IsNullOrEmpty(obj.BuyerID))
                {
                    lblBID.Text = obj.BuyerID.ToString();
                }
                lblDescription.Text = obj.OfferDescription;
                lblEndDate.Text     = obj.EndDate.ToString("MM/dd/yy");
                lblExtID.Text       = obj.ClientOfferID;
                lblName.Text        = obj.IncentiveName;
                lblStartDate.Text   = obj.StartDate.ToString("MM/dd/yy");
                lblID.Text          = obj.IncentiveID.ToString();
                lblReportDate.Text  = obj.CollisionRanOn.ToString();
            }
            else
            {
                Response.Redirect("CollidingOffers-list.aspx");
            }
        }
    }
Ejemplo n.º 2
0
 protected void gvData_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         List <CMS.AMS.Models.OCD.Report.Offer> obj = new List <CMS.AMS.Models.OCD.Report.Offer>();
         obj = ((CMS.AMS.Models.OCD.Product)(e.Row.DataItem)).Offers;
         if (obj.Count > 0)
         {
             GridView gvOffers = (GridView)(e.Row.FindControl("gvOffers"));
             gvOffers.DataSource = obj;
             gvOffers.DataBind();
             Int64 count = ((CMS.AMS.Models.OCD.Product)(e.Row.DataItem)).OfferCount;
             if (count > 100)
             {
                 Label lblOfferCount = (Label)(e.Row.FindControl("lblOfferCount"));
                 count = count - 100;
                 lblOfferCount.Text    = "+" + count.ToString() + " " + PhraseLib.Lookup("term.more", LanguageID);
                 lblOfferCount.Visible = true;
             }
         }
     }
 }