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"); } } }
public static String createTextBox(Int64 UDFPK, DataTable options, Boolean AllowEditing, String stringValue) { String htmlString = ""; Copient.CommonInc MyCommon = new Copient.CommonInc(); String initialValue; stringValue = stringValue.Replace(System.Convert.ToChar(34).ToString(), """); initialValue = MyCommon.TruncateString(stringValue, 10); htmlString += "<input type=\"text\" class=\"short\" id=\"udfVal-" + Convert.ToString(UDFPK) + "\" name=\"udfVal-" + Convert.ToString(UDFPK) + "\" disabled=\"disabled\" value =\"" + initialValue + "\" title=\"" + stringValue + "\" />"; htmlString += "<input type=\"button\" class=\"regular\" name=\"udfVal-" + Convert.ToString(UDFPK) + "\" id=\"udfVal-" + Convert.ToString(UDFPK) + "\" " + (AllowEditing ? " " : " disabled=\"disabled\" ") + " value=\"...\" title=\"Click here to edit the text\" style=\"FONT-SIZE: 8pt; WIDTH: 20px; HEIGHT: 24px\" onclick=\"javascript:assigntextboxcontrol(this, 'foldercreate', true);\" />"; return(htmlString); }
/* * * Horizontal radio * <table> * <tr><td/><td/><td/>...</tr> * <tr><td/><td/><td/>...</tr> * </table> * * * Vertical radio * <table> * <tr><td/><td/></tr> * <tr><td/><td/></tr> * ... * ... * ... * </table> */ public static String createRadioButtons(Int64 UDFPK, DataTable options, Boolean isHorizontal, Int64 selectedValue, Boolean AllowEditing) { String htmlString = ""; Copient.CommonInc MyCommon = new Copient.CommonInc(); if (isHorizontal) { String labelRow = ""; String radioRow = ""; foreach (DataRow row in options.Rows) { String isSelected = " "; if (Convert.ToBoolean(row["IsDefault"]) && selectedValue == -1) { isSelected = " checked "; } else if (Convert.ToInt64(row["UDFVPK"]) == selectedValue) { isSelected = " checked "; } labelRow += "<td style=\"text-align:center\">"; labelRow += "<label title=\"" + HttpUtility.HtmlEncode(Convert.ToString(row["Value"])) + "\" for=\"udfvalidValue-" + Convert.ToString(row["UDFVPK"]) + "\">" + HttpUtility.HtmlEncode(MyCommon.TruncateString(Convert.ToString(row["Value"]).Trim(), (27 / options.Rows.Count))) + "</label>"; labelRow += "</td>"; radioRow += "<td style=\"text-align:center\">"; radioRow += "<input type=\"radio\" id=\"udfvalidValue-" + Convert.ToString(row["UDFVPK"]) + "\" name=\"udfvalidValue-" + Convert.ToString(UDFPK) + "\" value=\"" + Convert.ToString(row["UDFVPK"]) + "\" " + isSelected + " " + (AllowEditing ? " " : " disabled=\"disabled\" ") + " />";; radioRow += "</td>"; } //htmlString = "<table style=\"overflow: hidden; text-overflow: ellipsis;table-layout: fixed\" nowrap><tr>" + labelRow + " </tr><tr>" + radioRow + "</tr></table>"; htmlString = "<table style=\"overflow: hidden; table-layout: fixed\" ><tr class=\"td-udfvalue\">" + labelRow + " </tr><tr class=\"td-udfvalue\">" + radioRow + "</tr></table>"; } else { htmlString = "<table>"; foreach (DataRow row in options.Rows) { String isSelected = " "; if (Convert.ToBoolean(row["IsDefault"]) && selectedValue == -1) { isSelected = " checked "; } else if (Convert.ToInt64(row["UDFVPK"]) == selectedValue) { isSelected = " checked "; } htmlString += "<tr class=\"td-udfvalue\" >"; htmlString += "<td style=\"text-align:left\"><input style=\"padding-left:0;padding-right:0\"type=\"radio\" id=\"udfvalidValue-" + Convert.ToString(row["UDFVPK"]) + "\" name=\"udfvalidValue-" + Convert.ToString(UDFPK) + "\" value=\"" + Convert.ToString(row["UDFVPK"]) + "\" " + isSelected + " " + (AllowEditing ? " " : " disabled=\"disabled\" ") + " /></td>"; htmlString += "<td style=\"text-align:left\"><label title=\"" + HttpUtility.HtmlEncode(Convert.ToString(row["Value"])) + "\" for=\"udfvalidValue-" + Convert.ToString(row["UDFVPK"]) + "\">" + HttpUtility.HtmlEncode(MyCommon.TruncateString(Convert.ToString(row["Value"]).Trim(), 22)) + "</label></td>"; htmlString += "</tr>"; } htmlString += "</table>"; } return(htmlString); }