protected void grdViewItems_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { //Add a JavaScript confirmation message to Remove button Button Button2 = (Button)e.Row.FindControl("Button2"); Button2.Attributes.Add("onclick", "return fnAskBeforeRemoval(" + "'" + Button2.ClientID + "')"); Product p = (Product)e.Row.DataItem; HyperLink lnkItem = (HyperLink)e.Row.FindControl("lnkItem"); Label lblItem = (Label)e.Row.FindControl("lblItem"); Label lblQty = (Label)e.Row.FindControl("lblQty"); Label lblQtyText = (Label)e.Row.FindControl("lblQtyText"); TextBox txtQty = (TextBox)e.Row.FindControl("txtQty"); HiddenField hdnPubID = (HiddenField)e.Row.FindControl("hdnPubID"); Panel pnlNerdo = (Panel)e.Row.FindControl("pnlNerdo"); HyperLink NerdoContentlink = (HyperLink)e.Row.FindControl("NerdoContentlink"); Label lblCoverOnly = (Label)e.Row.FindControl("lblCoverOnly"); lnkItem.Text = p.LongTitle; lnkItem.NavigateUrl = "detail.aspx?prodid=" + p.ProductId; string Explanation = ""; //Right now only for NERDO pubs if (kvpaircoll == null) { kvpaircoll = SQLDataAccess.GetKVPair("sp_NCIPL_getNerdoPubIdsURLS"); } foreach (KVPair kvpair in kvpaircoll) { if (string.Compare(kvpair.Key, p.PubId.ToString()) == 0) { Explanation = ": Pack of 25 covers"; pnlNerdo.Style["display"] = ""; NerdoContentlink.NavigateUrl = kvpair.Val; NerdoContentlink.Text = "Print separate contents"; lblCoverOnly.Visible = true; lnkItem.NavigateUrl = p.Url; lnkItem.Target = "_blank"; break; } } if (lblCoverOnly.Visible == false) { pnlNerdo.Visible = false; } lblItem.Text = p.ProductId + Explanation; lblQtyText.Text = "Limit "; lblQty.Text = p.NumQtyLimit.ToString(); txtQty.Text = p.NumQtyOrdered.ToString(); hdnPubID.Value = p.PubId.ToString(); Button2.CommandArgument = e.Row.RowIndex.ToString(); } lblTot.Text = this.shoppingcart.TotalQty.ToString(); //lblCost.Text = this.shoppingcart.Cost.ToString("c"); }
protected void Page_Load(object sender, EventArgs e) { //Check GUAM UserId, Role for NCIPL_CC if (GlobalUtils.UserRoles.getLoggedInUserId().Length == 0 || GlobalUtils.UserRoles.getLoggedInUserRole() < 1) { string currASPXfilename = System.IO.Path.GetFileName(Request.Path).ToString(); Session["NCIPL_REGISTERREFERRER"] = currASPXfilename; Response.Redirect("~/login.aspx?msg=invaliduser&redir=" + currASPXfilename); } //Hide label error message lblErrorMsg.Visible = false; //Reset Session SEARCHORDER_CURRPAGE Session["SEARCHORDER_CURRPAGE"] = null; //destroy if (!Page.IsPostBack) { //Display the master page tabs GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils(); if (Session["NCIPL_Pubs"] != null) { Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), ""); } else { Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", ""); } UtilMethod = null; #region Bind the form here! //NCIPL_CC - Populate Customer Type Dropdown KVPairCollection kvpairColl = KVPair.GetKVPair("sp_NCIPLCC_getAllTypeOfCustomers"); foreach (KVPair kvpair in kvpairColl) { ListItem li = new ListItem(); li.Value = kvpair.Key; li.Text = kvpair.Val; drpCustomerType.Items.Add(li); } kvpairColl = null; #endregion //Reset Sessions for Search Order Look up Session["SEARCHORDER_CUSTOMERTYPE"] = null; //destroy Session["SEARCHORDER_CUSTOMERTYPEDESC"] = null; //destroy Session["SEARCHORDER_KEYWORD"] = null; //destroy Session["SEARCHORDER_SDATE"] = null; //destroy Session["SEARCHORDER_EDATE"] = null; //destroy Session["VIEW_CUSTID"] = null; Session["VIEW_ORDERNUM"] = null; Session["VIEW_PREVPAGE"] = null; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region NERDO_Related //arrlstNerdoPubIds = DAL.DAL.GetNerdoPubIds(); kvpaircoll = DAL.DAL.GetKVPair("sp_NCIPL_getNerdoPubIdsURLS"); #endregion #region dummydata--remove before going live //Session["NCIPL_Pubs"] = "1043,117"; //Session["NCIPL_Qtys"] = "20,20"; //Session["NCIPL_User"] = "******"; //Session["NCIPL_Role"] = "NCIPL_PUBLIC"; #endregion steps1.Activate("cell1"); this.shoppingcart = null; //destroy cart if it exists this.shoppingcart = new ProductCollection(); //***EAC Give FEDEX,FEDEX_GROUND estimates by default //shoppingcart.ShipVendor = "FEDEX"; shoppingcart.ShipMethod = ""; //***EAC Parse the NCIPL_Pubs and NCIPL_qtys..assume they have same dimensions string[] pubs = Session["NCIPL_Pubs"].ToString().Split(new Char[] { ',' }); string[] qtys = Session["NCIPL_Qtys"].ToString().Split(new Char[] { ',' }); for (var i = 0; i < pubs.Length; i++) { if (pubs[i].Trim() != "") { int pubid = Int32.Parse(pubs[i]); Product p = Product.GetCartPubByPubID(pubid); p.NumQtyOrdered = Int32.Parse(qtys[i]); this.shoppingcart.Add(p); //BLL will know what to do w/ dupes and 0 quantities } } grdViewItems.DataSource = this.shoppingcart; grdViewItems.DataBind(); BindTotals(); } //Check for cart object here if (this.shoppingcart == null) { Response.Redirect("default.aspx?redirect=cart1", true); } }
//********************************************************************* // // Generate Collection Methods // // The following methods are used to generate collections of objects //[] //********************************************************************* public static KVPairCollection GetKVPair(string s) { Database db = DatabaseFactory.CreateDatabase(); DbCommand cw = db.GetStoredProcCommand(s); using (System.Data.IDataReader dr = db.ExecuteReader(cw)) { KVPairCollection coll = new KVPairCollection(); while (dr.Read()) { KVPair k = new KVPair(dr.GetInt32(0).ToString(), (string)dr.GetString(1)); coll.Add(k); } return(coll); } }
public static KVPairCollection GetAllShippingMethods() { Database db = DatabaseFactory.CreateDatabase(); DbCommand cw = db.GetStoredProcCommand("sp_NCIPL_GetAllShippingMethods"); using (System.Data.IDataReader dr = db.ExecuteReader(cw)) { KVPairCollection coll = new KVPairCollection(); while (dr.Read()) { KVPair k = new KVPair((string)dr.GetString(0), (string)dr.GetString(1)); coll.Add(k); } return(coll); } }
public static KVPairCollection GetOrderMedia(string role) { Database db = DatabaseFactory.CreateDatabase(); DbCommand cw = db.GetStoredProcCommand("sp_NCIPLCC_getOrderMedia"); db.AddInParameter(cw, "role", DbType.String, role); using (System.Data.IDataReader dr = db.ExecuteReader(cw)) { KVPairCollection coll = new KVPairCollection(); while (dr.Read()) { KVPair k = new KVPair(dr.GetInt32(0).ToString(), (string)dr.GetString(1)); coll.Add(k); } return(coll); } }
//END HITT 8329 ############################################# //BEGIN CR - 23 -- Canned Search public static KVPairCollection GetCannedSearchIdText(string procname, string param) { Database db = DatabaseFactory.CreateDatabase(); DbCommand cw = db.GetStoredProcCommand(procname); db.AddInParameter(cw, "recordid", DbType.String, param); using (System.Data.IDataReader dr = db.ExecuteReader(cw)) { KVPairCollection coll = new KVPairCollection(); while (dr.Read()) { KVPair k = new KVPair( dr.GetInt32(0).ToString(), (dr[1] == DBNull.Value) ? "" : dr[1].ToString() ); coll.Add(k); } return(coll); } }
//Get the Product Ids for the provided PubIds private static ArrayList GetProductIds(ArrayList arrlstPubId) { ArrayList arrlstProductIds = new ArrayList(); //Get the Pubs Arraylist into a comma separated string value //arrlstPubId.ToString(); //string PubIdList = string.Join(",", (string[])arrlstPubId.ToArray(Type.GetType("System.Int32"))); string PubIdList = ""; int Counter = 0; int MaxCount = arrlstPubId.Count; for (Counter = 0; Counter < MaxCount; Counter++) { if (Counter == MaxCount - 1) { PubIdList += arrlstPubId[Counter].ToString(); } else { PubIdList += arrlstPubId[Counter].ToString() + ","; } } //string PubIdList = string.Join(",", (string[])arrlstPubId.ToArray()); KVPairCollection kvPairColl = GetKVPair2("sp_getAllProductIds", PubIdList); for (Counter = 0; Counter < MaxCount; Counter++) { foreach (KVPair kvPair in kvPairColl) { if (string.Compare(arrlstPubId[Counter].ToString(), kvPair.Key) == 0) { arrlstProductIds.Add(kvPair.Val); break; } } } return(arrlstProductIds); }
//Get Key, Value, Selected information for the lists public static KVPairCollection GetKVPair(string procname, int mode, int cannid) { Database db = DatabaseFactory.CreateDatabase(); DbCommand cw = db.GetStoredProcCommand(procname); db.AddInParameter(cw, "mode", DbType.Int32, mode); db.AddInParameter(cw, "cannid", DbType.Int32, cannid); using (System.Data.IDataReader dr = db.ExecuteReader(cw)) { KVPairCollection coll = new KVPairCollection(); while (dr.Read()) { KVPair k = new KVPair( dr.GetInt32(0).ToString(), (dr[1] == DBNull.Value) ? "" : dr[1].ToString(), dr.GetInt32(2).ToString() ); coll.Add(k); } return(coll); } }
public static KVPairCollection GetCities(int z) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("sp_NCIPL_GetCities"); db.AddInParameter(dbCommand, "zip", DbType.String, z.ToString().PadLeft(5, '0'));//***EAC HOTFIX for hitt8245...better to change here than in the calling procedures. using (IDataReader dr = db.ExecuteReader(dbCommand)) { // Processing code KVPairCollection c = new KVPairCollection(); while (dr.Read()) { KVPair k = new KVPair( dr["cityname"].ToString(), dr["state"].ToString() ); c.Add(k); } return(c); } }
protected void Page_Load(object sender, EventArgs e) { if (Session.IsNewSession) { Response.Redirect("~/Home.aspx"); } System.Web.UI.UserControl userControl = (System.Web.UI.UserControl) this.LoadControl("~/UserControl/AdminMenu.ascx"); this.plcHldMenu.Controls.Add(userControl); if (!IsPostBack) { if (Request.QueryString["userid"] != null) { _userid = Int32.Parse(Request.QueryString["userid"]); CISUser c = PubEntAdmin.BLL.CISUser.GetGuamUserById(_userid); lblUsername.Text = c.Email; kvpaircoll = DAL.PE_DAL.GetGuamRoles(); drpRoles.DataSource = kvpaircoll; drpRoles.DataTextField = "Val"; drpRoles.DataValueField = "Val"; drpRoles.DataBind(); drpRoles.SelectedValue = c.Role; //foreach (KVPair kvpair in kvpaircoll) //{ // ListItem lstItem = new ListItem(); // lstItem.Text = kvpair.Val; // lstItem.Value = kvpair.Key; // if (kvpair.IsSelected == "1") // lstItem.Selected = true; // else // lstItem.Selected = false; // drpRoles.Items.Add(lstItem); //} } } }
protected void DisplayModalPopUpCover(object sender, CommandEventArgs e) { if (e.CommandArgument.ToString().Length == 0) { Response.Redirect("cart.aspx", true); return; } if (string.Compare(Session["JSTurnedOn"].ToString(), "False") == 0) { //Add a default quantity of one to the shopping cart if JavaScript is not enabled if (!IsItemInCart(e.CommandArgument.ToString())) //Check for browser re-load { Session["NCIPL_Pubs"] += e.CommandArgument.ToString() + ","; Session["NCIPL_Qtys"] += "1" + ","; } ImageButton OrderedCover = (ImageButton)sender; OrderedCover.CommandArgument = ""; OrderedCover.ImageUrl = "images/CoverOnlyInYourCart_off.gif"; OrderedCover.AlternateText = "Covers Only - In Your Cart"; //Display the master page tabs GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils(); if (Session["NCIPL_Pubs"] != null) { Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), ""); } else { Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", ""); } UtilMethod = null; } else { this.PubCoverOrderOK.CommandArgument = e.CommandArgument.ToString(); Product p = DAL.DAL.GetProductbyPubID(Convert.ToInt32(e.CommandArgument)); labelCoverPubTitle.Text = p.LongTitle; CoverQtyLimit.Text = p.NumQtyLimit.ToString(); //p.NumQtyAvailable.ToString(); CoverLimitLabel.Text = "Pack of 25 covers" + " " + "Limit " + CoverQtyLimit.Text; //Get the content URL - TO DO, can be optimized later to use a stored procedure //that returns only one value. KVPairCollection kvpaircoll = DAL.DAL.GetKVPair("sp_NCIPL_getNerdoPubIdsURLS");; foreach (KVPair kvpair in kvpaircoll) { if (string.Compare(kvpair.Key, p.PubId.ToString()) == 0) { linkCoverPubUrl.NavigateUrl = kvpair.Val; break; } } //Need to call update panel update to populate the values UpdatePanelOrderCover.UpdateMode = UpdatePanelUpdateMode.Conditional; UpdatePanelOrderCover.Update(); //Show the Modal Popup this.PubCoverOrderModalPopup.Show(); //BackToSearchResultsLink.NavigateUrl = "javascript:history.go(-2);"; //Do not show once modal pop-up is displayed } }
protected void btnNew_Click(object sender, EventArgs e) { dvAdd.Visible = true; dvEdit.Visible = false; //Cancer Type List ucCancerTypeAdd.ClearValues(); kvpaircoll = DAL.cs_dal.GetKVPair("sp_CANNED_getCancerTypes", 1, 0); foreach (KVPair kvpair in kvpaircoll) { ListItem lstItem = new ListItem(); lstItem.Text = kvpair.Val; lstItem.Value = kvpair.Key; //if (kvpair.IsSelected == "1") // lstItem.Selected = true; //else lstItem.Selected = false; ucCancerTypeAdd.listBoxCtrl.Items.Add(lstItem); lstItem = null; } kvpaircoll = null; //Subject List ucSubjectAdd.ClearValues(); kvpaircoll = DAL.cs_dal.GetKVPair("sp_CANNED_getSubjects", 1, 0); foreach (KVPair kvpair in kvpaircoll) { ListItem lstItem = new ListItem(); lstItem.Text = kvpair.Val; lstItem.Value = kvpair.Key; //if (kvpair.IsSelected == "1") // lstItem.Selected = true; //else lstItem.Selected = false; ucSubjectAdd.listBoxCtrl.Items.Add(lstItem); lstItem = null; } kvpaircoll = null; //Publication Format List ucPubFormatAdd.ClearValues(); kvpaircoll = DAL.cs_dal.GetKVPair("sp_CANNED_getProductFormats", 1, 0); foreach (KVPair kvpair in kvpaircoll) { ListItem lstItem = new ListItem(); lstItem.Text = kvpair.Val; lstItem.Value = kvpair.Key; //if (kvpair.IsSelected == "1") // lstItem.Selected = true; //else lstItem.Selected = false; ucPubFormatAdd.listBoxCtrl.Items.Add(lstItem); lstItem = null; } kvpaircoll = null; //Race List ucRaceAdd.ClearValues(); kvpaircoll = DAL.cs_dal.GetKVPair("sp_CANNED_getRace", 1, 0); foreach (KVPair kvpair in kvpaircoll) { ListItem lstItem = new ListItem(); lstItem.Text = kvpair.Val; lstItem.Value = kvpair.Key; //if (kvpair.IsSelected == "1") // lstItem.Selected = true; //else lstItem.Selected = false; ucRaceAdd.listBoxCtrl.Items.Add(lstItem); lstItem = null; } kvpaircoll = null; //Audience List ucAudienceAdd.ClearValues(); kvpaircoll = DAL.cs_dal.GetKVPair("sp_CANNED_getAudience", 1, 0); foreach (KVPair kvpair in kvpaircoll) { ListItem lstItem = new ListItem(); lstItem.Text = kvpair.Val; lstItem.Value = kvpair.Key; //if (kvpair.IsSelected == "1") // lstItem.Selected = true; //else lstItem.Selected = false; ucAudienceAdd.listBoxCtrl.Items.Add(lstItem); lstItem = null; } kvpaircoll = null; //Language List ucLanguageAdd.ClearValues(); kvpaircoll = DAL.cs_dal.GetKVPair("sp_CANNED_getLanguages", 1, 0); foreach (KVPair kvpair in kvpaircoll) { ListItem lstItem = new ListItem(); lstItem.Text = kvpair.Val; lstItem.Value = kvpair.Key; //if (kvpair.IsSelected == "1") // lstItem.Selected = true; //else lstItem.Selected = false; ucLanguageAdd.listBoxCtrl.Items.Add(lstItem); lstItem = null; } kvpaircoll = null; //Collections List ucCollectionsAdd.ClearValues(); kvpaircoll = DAL.cs_dal.GetKVPair("sp_CANNED_getCollections", 1, 0); foreach (KVPair kvpair in kvpaircoll) { ListItem lstItem = new ListItem(); lstItem.Text = kvpair.Val; lstItem.Value = kvpair.Key; //if (kvpair.IsSelected == "1") // lstItem.Selected = true; //else lstItem.Selected = false; ucCollectionsAdd.listBoxCtrl.Items.Add(lstItem); lstItem = null; } kvpaircoll = null; }
protected void DoSearch() { string strResult = ""; string strOrder = ""; string strOrderDate = ""; string currShipToEmail = ""; if (Session["SEARCHORDER_CUSTOMERTYPEDESC"] != null) { if (Session["SEARCHORDER_CUSTOMERTYPEDESC"].ToString() != "") { lblTypeofCustomer.Text = Session["SEARCHORDER_CUSTOMERTYPEDESC"].ToString(); divTypeofCustomer.Visible = true; } else { lblTypeofCustomer.Text = ""; divTypeofCustomer.Visible = false; } } if (Session["SEARCHORDER_CUSTOMERTYPE"] != null) { if (Session["SEARCHORDER_CUSTOMERTYPE"].ToString() != "" && Session["SEARCHORDER_CUSTOMERTYPE"].ToString() != "All") { strCustomerType = Convert.ToInt32(Session["SEARCHORDER_CUSTOMERTYPE"].ToString()); } else { strCustomerType = 0; } } else { strCustomerType = 0; } if (Session["SEARCHORDER_KEYWORD"] != null) { strKeyWord = Session["SEARCHORDER_KEYWORD"].ToString().Replace("'", "''"); if (Session["SEARCHORDER_KEYWORD"].ToString() != "") { lblSearchPhase.Text = Session["SEARCHORDER_KEYWORD"].ToString(); divSearchPhase.Visible = true; } else { lblSearchPhase.Text = ""; divSearchPhase.Visible = false; } } else { lblSearchPhase.Text = ""; divSearchPhase.Visible = false; } if (Session["SEARCHORDER_SDATE"] != null) { strSDate = Session["SEARCHORDER_SDATE"].ToString(); if (Session["SEARCHORDER_SDATE"].ToString() != "") { lblStartDate.Text = Session["SEARCHORDER_SDATE"].ToString(); divStartDate.Visible = true; } else { lblStartDate.Text = ""; divStartDate.Visible = false; } } else { lblStartDate.Text = ""; divStartDate.Visible = false; } if (Session["SEARCHORDER_EDATE"] != null) { strEDate = Session["SEARCHORDER_EDATE"].ToString(); if (Session["SEARCHORDER_EDATE"].ToString() != "") { lblEndDate.Text = Session["SEARCHORDER_EDATE"].ToString(); divEndDate.Visible = true; } else { lblEndDate.Text = ""; divEndDate.Visible = false; } } else { lblEndDate.Text = ""; divEndDate.Visible = false; } if (Session["SEARCHORDER_CURRPAGE"] != null) { if (Session["SEARCHORDER_CURRPAGE"].ToString() != "") { iCurrPage = Convert.ToInt32(Session["SEARCHORDER_CURRPAGE"].ToString()); } } iToRec = iCurrPage * iRecPerPage; iFromRec = iToRec - iRecPerPage + 1; iSearchOrderCount = DAL.DAL.GetSearchOrderCount(strCustomerType, strKeyWord, strSDate, strEDate); iTotalPage = 0; if (iSearchOrderCount > 0) { this.divSearchOrderResult.Style["display"] = ""; this.divNoRecord.Style["display"] = "none"; //--- Calculate Total number of pages for search result if ((iSearchOrderCount % iRecPerPage) == 0) { iTotalPage = iSearchOrderCount / iRecPerPage; } else { iTotalPage = (iSearchOrderCount / iRecPerPage) + 1; } //--- Search Result count this.lblRecordCount.Text = iSearchOrderCount.ToString(); this.divRecNavigation.Visible = true; this.divRecNavigationBtm.Visible = true; //--- Get navigation on right Display_RecNavigation(); //--- Get navigation dropdown if (bTotalPage) { Navigation_AssignPages(iSearchOrderCount, iRecPerPage, iTotalPage); } CustomerCollection CustColl = DAL.DAL.GetSearchOrderResult(strCustomerType, strKeyWord, strSearchSort, strSDate, strEDate, iFromRec, iToRec); foreach (Customer o in CustColl) { if (currShipToEmail == o.ShipToEmail) { //strResult = strResult + "<tr>" + // "<td colspan=\"5\">" + // " " + // "</td>" + // "</tr>"; } else { //strResult = strResult + "<tr>" + // "<td colspan=\"5\">" + // "<div style=\"height:1px; border-top:solid 1px #bbb\"></div>" + // "</td>" + // "</tr>"; } currShipToEmail = o.ShipToEmail; strOrder = ""; strOrderDate = ""; //StringCollection OrderColl = DAL.DAL.GetOrderByCustomer(o.CustID); //foreach (string orderinvoice in OrderColl) KVPairCollection kvpairColl = KVPair.GetKVPair_Order_Date(o.CustID); foreach (KVPair kvpair in kvpairColl) { //strOrder = strOrder + "<a href=\"OrderDetail.aspx?CustID=" + o.CustID + "&OrderNum=" + orderinvoice + "&PrevPage=SearchOrder\">" + orderinvoice + "</a>"; strOrder = strOrder + "<a href=\"javascript:ViewOrderDetail('" + drpQJumpsN.ClientID + "'"; strOrder = strOrder + ", '" + hidCustID.ClientID + "'"; strOrder = strOrder + ", '" + hidOrderNum.ClientID + "'"; strOrder = strOrder + ", '" + hidPrevPage.ClientID + "'"; //strOrder = strOrder + ", '" + o.CustID + "', '" + orderinvoice + "', 'SearchOrder');\">" + orderinvoice + "</a>"; strOrder = strOrder + ", '" + o.CustID + "', '" + kvpair.Key + "', 'SearchOrder');\">" + kvpair.Key + "</a>"; strOrder = strOrder + "<br />"; strOrderDate = strOrderDate + kvpair.Val; strOrderDate = strOrderDate + "<br />"; } strResult = strResult + "<tr>" + "<td>" + o.ShipToName + "<br />"; //"<a href=\"CustomerDetail.aspx?CustID=" + o.CustID + "\">" + o.ShipToName + "</a>" + "<br />"; if (o.ShipToAddr1 != "") { strResult = strResult + o.ShipToAddr1 + "<br />"; } if (o.ShipToAddr2 != "") { strResult = strResult + o.ShipToAddr2 + "<br />"; } if (o.ShipToCity != "" || o.ShipToState != "" || o.ShipToZip5 != "") { strResult = strResult + o.ShipToCity + ", " + o.ShipToState + " " + o.ShipToZip5; } strResult = strResult + "</td>" + "<td>" + o.ShipToOrg + "</td>" + "<td>" + o.ShipToEmail + "</td>" + "<td>" + strOrder + "</td>" + "<td>" + strOrderDate + "</td>" + "</tr>"; } ltrlSearchOrderResult.Text = strResult; } else { this.lblRecordCount.Text = ""; this.divRecNavigation.Visible = false; this.divRecNavigationBtm.Visible = false; this.divSearchOrderResult.Style["display"] = "none"; this.divNoRecord.Style["display"] = ""; } }
private void Page_Load(object sender, System.EventArgs e) { ////For the canned search page -- allow users to come in directly //if (Session["JSTurnedOn"] == null) //{ // Session["JSTurnedOn"] = "True"; //Assuming JavaScript is enabled, by default. // if (Session["NCIPL_Pubs"] == null) // Session["NCIPL_Pubs"] = ""; // if (Session["NCIPL_Qtys"] == null) // Session["NCIPL_Qtys"] = ""; // if (Session["PUBENT_SearchKeyword"] == null) // Session["PUBENT_SearchKeyword"] = ""; // if (Session["PUBENT_TypeOfCancer"] == null) // Session["PUBENT_TypeOfCancer"] = ""; // if (Session["PUBENT_Subject"] == null) // Session["PUBENT_Subject"] = ""; // if (Session["PUBENT_Audience"] == null) // Session["PUBENT_Audience"] = ""; // if (Session["PUBENT_ProductFormat"] == null) // Session["PUBENT_ProductFormat"] = ""; // if (Session["PUBENT_Language"] == null) // Session["PUBENT_Language"] = ""; // if (Session["PUBENT_StartsWith"] == null) // Session["PUBENT_StartsWith"] = ""; // if (Session["PUBENT_Series"] == null) // Session["PUBENT_Series"] = ""; //Or collection // if (Session["PUBENT_NewOrUpdated"] == null) // Session["PUBENT_NewOrUpdated"] = ""; // if (Session["PUBENT_Race"] == null) // Session["PUBENT_Race"] = ""; //} ////End of code //if (!Page.IsPostBack) //{ // Session["PUBENT_SearchKeyword"] = ""; // Session["PUBENT_TypeOfCancer"] = ""; // Session["PUBENT_Subject"] = ""; // Session["PUBENT_Audience"] = ""; // Session["PUBENT_Language"] = ""; // Session["PUBENT_ProductFormat"] = ""; // Session["PUBENT_StartsWith"] = ""; // Session["PUBENT_Series"] = ""; // Session["PUBENT_NewOrUpdated"] = ""; // Session["PUBENT_Race"] = ""; // if (Request.UrlReferrer != null) //Added if condition to avoid resetting session variables if coming from detail page // { // if (Session["PUBENT_CannedSearch"] != null && Request.UrlReferrer.ToString().Contains("detail.aspx")) // Response.Redirect("cannedsearchres.aspx", true); // } // Session["PUBENT_CannedSearch"] = ""; // Session["PUBENT_Criteria"] = ""; //} if (Request.QueryString["rid"] != null) { rid = Request.QueryString["rid"].Trim(); //Some checks if (string.Compare(rid, "") == 0) { Response.Redirect("default.aspx?redirect=cannedsearch1", true); } if (rid.Length > 6) { Response.Redirect("default.aspx?redirect=cannedsearch2", true); } ///Expecting only one entry in the KVPair Collection, but the collecion ///is used in order to make use of the KVPair class. ///If multiple cannid values are present (unlikely) then the last cannid will be used. KVPairCollection collCann = DAL.DAL.GetCannedSearchIdText("sp_NCIPL_CannedSearchIdText", rid); foreach (KVPair kvItem in collCann) { CannId = kvItem.Key; SearchCriteria = kvItem.Val; } if (CannId.Length == 0) { Response.Redirect("default.aspx?redirect=cannedsearch3", true); } } else { Response.Redirect("default.aspx?redirect=cannedsearch4", true); } //At this point everything is good Session["PUBENT_CannedSearch"] = CannId; Session["PUBENT_Criteria"] = SearchCriteria; //Response.Redirect("cannedsearchres.aspx", true); //yma change it to directly goto searchres.aspx Response.Redirect("searchres.aspx?canned=1", true); }
protected void Page_Load(object sender, EventArgs e) { if (!GlobalUtils.Utils.isLoggedin()) { //***EAC I need a logged in user at this point GlobalUtils.Utils.ClearAllSessions(); Response.Redirect("~/login.aspx", true); } string role = GlobalUtils.Utils.LoggedinRole(); if (role != "NCIPL_LM" && role != "NCIPL_CC" && role != "NCIPL_POS") { throw (new ArgumentException("Your role is not allowed at this point.")); } if (!IsPostBack) { #region NERDO_Related //arrlstNerdoPubIds = DAL.DAL.GetNerdoPubIds(); kvpaircoll = DAL.DAL.GetKVPair("sp_NCIPL_getNerdoPubIdsURLS"); #endregion #region dummydata--remove before going live + enable checks above //Session["NCIPL_Pubs"] = "4446"; //Session["NCIPL_Qtys"] = "21"; //Session["NCIPL_User"] = "******"; //Session["NCIPL_Role"] = "NCIPL_CC"; #endregion steps1.Activate("cell1"); this.shoppingcart = null; //destroy cart if it exists this.shoppingcart = new ProductCollection(); //***EAC Give FEDEX,FEDEX_GROUND estimates by default //shoppingcart.ShipVendor = "FEDEX"; shoppingcart.ShipMethod = ""; //***EAC Parse the NCIPL_Pubs and NCIPL_qtys..assume they have same dimensions string[] pubs = Session["NCIPL_Pubs"].ToString().Split(new Char[] { ',' }); string[] qtys = Session["NCIPL_Qtys"].ToString().Split(new Char[] { ',' }); for (var i = 0; i < pubs.Length; i++) { if (pubs[i].Trim() != "") { int pubid = Int32.Parse(pubs[i]); Product p = Product.GetCartPubByPubID(pubid); p.NumQtyOrdered = Int32.Parse(qtys[i]); this.shoppingcart.Add(p); //BLL will know what to do w/ dupes and 0 quantities } } grdViewItems.DataSource = this.shoppingcart; grdViewItems.DataBind(); BindTotals(); } //Check for cart object here if (this.shoppingcart == null) { Response.Redirect("default.aspx?redirect=cart1", true); } }
private void Page_Load(object sender, System.EventArgs e) { if (Utils.ValidateRedirect().Length > 0) //Important check { Response.Redirect(Utils.ValidateRedirect(), true); } if (!Page.IsPostBack) { Session["NCIPLEX_SearchKeyword"] = ""; Session["NCIPLEX_TypeOfCancer"] = ""; Session["NCIPLEX_Subject"] = ""; Session["NCIPLEX_Audience"] = ""; Session["NCIPLEX_Language"] = ""; Session["NCIPLEX_ProductFormat"] = ""; Session["NCIPLEX_StartsWith"] = ""; Session["NCIPLEX_Series"] = ""; Session["NCIPLEX_NewOrUpdated"] = ""; Session["NCIPLEX_Race"] = ""; if (Request.QueryString["cantype"] != null) { Session["NCIPLEX_TypeOfCancer"] = Request.QueryString["cantype"]; } else if (Request.QueryString["subj"] != null) { Session["NCIPLEX_Subject"] = Request.QueryString["subj"]; } else if (Request.QueryString["aud"] != null) { Session["NCIPLEX_Audience"] = Request.QueryString["aud"]; } else if (Request.QueryString["lang"] != null) { Session["NCIPLEX_Language"] = Request.QueryString["lang"]; } else if (Request.QueryString["form"] != null) { Session["NCIPLEX_ProductFormat"] = Request.QueryString["form"]; } else if (Request.QueryString["starts"] != null) { Session["NCIPLEX_StartsWith"] = Request.QueryString["starts"]; } else if (Request.QueryString["coll"] != null) { Session["NCIPLEX_Series"] = Request.QueryString["coll"]; } else if (Request.QueryString["newupt"] != null) { Session["NCIPLEX_NewOrUpdated"] = Request.QueryString["newupt"]; } else if (Request.QueryString["race"] != null) { Session["NCIPLEX_Race"] = Request.QueryString["race"]; } //Begin - Code to show search criteria on search results Session["NCIPLEX_Criteria"] = ""; string SearchCriteria = ""; GlobalUtils.Utils.InitializeCriteriaTextSessionVariables(); //CR-31 HITT 7074 if (Session["NCIPLEX_TypeOfCancer"].ToString().Length > 0) { KVPairCollection collCancerTypes = KVPair.GetKVPair("sp_NCIPLex_getCancerTypes"); foreach (KVPair kvItem in collCancerTypes) { if (string.Compare(kvItem.Key, Session["NCIPLEX_TypeOfCancer"].ToString(), true) == 0) { if (SearchCriteria.Length == 0) { SearchCriteria = kvItem.Val; } else { SearchCriteria = SearchCriteria + ", " + kvItem.Val; } GlobalUtils.Utils.SetCriteriaText("TypeOfCancer", kvItem.Val); //HITT 7074 CR-31 } } } if (Session["NCIPLEX_Subject"].ToString().Length > 0) { KVPairCollection collSubjects = KVPair.GetKVPair("sp_NCIPLex_getSubjects"); foreach (KVPair kvItem in collSubjects) { if (string.Compare(kvItem.Key, Session["NCIPLEX_Subject"].ToString(), true) == 0) { if (SearchCriteria.Length == 0) { SearchCriteria = kvItem.Val; } else { SearchCriteria = SearchCriteria + ", " + kvItem.Val; } GlobalUtils.Utils.SetCriteriaText("Subject", kvItem.Val); //HITT 7074 CR-31 } } } if (Session["NCIPLEX_ProductFormat"].ToString().Length > 0) { KVPairCollection collProdFormats = KVPair.GetKVPair("sp_NCIPLex_getProductFormats"); foreach (KVPair kvItem in collProdFormats) { if (string.Compare(kvItem.Key, Session["NCIPLEX_ProductFormat"].ToString(), true) == 0) { if (SearchCriteria.Length == 0) { SearchCriteria = kvItem.Val; } else { SearchCriteria = SearchCriteria + ", " + kvItem.Val; } GlobalUtils.Utils.SetCriteriaText("ProductFormat", kvItem.Val); //HITT 7074 CR-31 } } } if (Session["NCIPLEX_Series"].ToString().Length > 0) { KVPairCollection collSeries = KVPair.GetKVPair("sp_NCIPLex_getCollections"); foreach (KVPair kvItem in collSeries) { if (string.Compare(kvItem.Key, Session["NCIPLEX_Series"].ToString(), true) == 0) { if (SearchCriteria.Length == 0) { SearchCriteria = kvItem.Val; } else { SearchCriteria = SearchCriteria + ", " + kvItem.Val; } GlobalUtils.Utils.SetCriteriaText("Series", kvItem.Val); //HITT 7074 CR-31 } } } if (Session["NCIPLEX_NewOrUpdated"].ToString().Length > 0) { KVPairCollection collProdUpdates = KVPair.GetKVPair("sp_NCIPLex_getProductUpdates"); foreach (KVPair kvItem in collProdUpdates) { if (string.Compare(kvItem.Key, Session["NCIPLEX_NewOrUpdated"].ToString(), true) == 0) { if (SearchCriteria.Length == 0) { SearchCriteria = kvItem.Val; } else { SearchCriteria = SearchCriteria + ", " + kvItem.Val; } GlobalUtils.Utils.SetCriteriaText("NewOrUpdated", kvItem.Val); //HITT 7074 CR-31 } } } if (Session["NCIPLEX_Language"].ToString().Length > 0) { KVPairCollection collLanguages = KVPair.GetKVPair("sp_NCIPLex_getLanguages"); foreach (KVPair kvItem in collLanguages) { if (string.Compare(kvItem.Key, Session["NCIPLEX_Language"].ToString(), true) == 0) { if (SearchCriteria.Length == 0) { SearchCriteria = kvItem.Val; } else { SearchCriteria = SearchCriteria + ", " + kvItem.Val; } GlobalUtils.Utils.SetCriteriaText("Language", kvItem.Val); //HITT 7074 CR-31 } } } if (Session["NCIPLEX_Audience"].ToString().Length > 0) { KVPairCollection collAudience = KVPair.GetKVPair("sp_NCIPLex_getAudience"); foreach (KVPair kvItem in collAudience) { if (string.Compare(kvItem.Key, Session["NCIPLEX_Audience"].ToString(), true) == 0) { if (SearchCriteria.Length == 0) { SearchCriteria = kvItem.Val; } else { SearchCriteria = SearchCriteria + ", " + kvItem.Val; } GlobalUtils.Utils.SetCriteriaText("Audience", kvItem.Val); //HITT 7074 CR-31 } } } if (Session["NCIPLEX_StartsWith"].ToString().Length > 0) { if (SearchCriteria.Length == 0) { SearchCriteria = Session["NCIPLEX_StartsWith"].ToString(); } else { SearchCriteria = SearchCriteria + ", " + Session["NCIPLEX_StartsWith"].ToString(); } GlobalUtils.Utils.SetCriteriaText("StartsWith", Session["NCIPLEX_StartsWith"].ToString()); //HITT 7074 CR-31 } if (Session["NCIPLEX_Race"].ToString().Length > 0) { KVPairCollection collRace = KVPair.GetKVPair("sp_NCIPLex_getRace"); foreach (KVPair kvItem in collRace) { if (string.Compare(kvItem.Key, Session["NCIPLEX_Race"].ToString(), true) == 0) { if (SearchCriteria.Length == 0) { SearchCriteria = kvItem.Val; } else { SearchCriteria = SearchCriteria + ", " + kvItem.Val; } GlobalUtils.Utils.SetCriteriaText("Race", kvItem.Val); //HITT 7074 CR-31 } } } Session["NCIPLEX_Criteria"] = SearchCriteria; //End Code /*Begin CR-31 - HITT 9815 */ GlobalUtils.Utils objUtils = new GlobalUtils.Utils(); string QueryParams = objUtils.GetQueryStringParams(); objUtils = null; /*End CR-31 - HITT 9815 */ if (Session["NCIPLEX_NewOrUpdated"].ToString().Length > 0) //HITT 8300 - New & Updated now has its own page { Response.Redirect("newupdated.aspx"); } else { //CR-31 HITT 9815 Response.Redirect("searchres.aspx"); Response.Redirect("searchres.aspx" + "?sid=" + QueryParams); } } }
protected void Page_Load(object sender, EventArgs e) { if (Utils.ValidateRedirect().Length > 0) //Important check { Response.Redirect(Utils.ValidateRedirect(), true); } if (!IsPostBack) { #region NERDO_Related //arrlstNerdoPubIds = DAL.DAL.GetNerdoPubIds(); kvpaircoll = SQLDataAccess.GetKVPair("sp_NCIPL_getNerdoPubIdsURLS"); #endregion #region dummydata--remove before going live //Session["NCIPL_Pubs"] = "31,31"; //Session["NCIPL_Qtys"] = "123,1"; #endregion steps1.Activate("cell1"); this.shoppingcart = null; //destroy cart if it exists this.shoppingcart = new ProductCollection(); //***EAC Parse the NCIPL_Pubs and NCIPL_qtys..assume they have same dimensions string[] pubs = Session["NCIPLEX_Pubs"].ToString().Split(new Char[] { ',' }); string[] qtys = Session["NCIPLEX_Qtys"].ToString().Split(new Char[] { ',' }); for (var i = 0; i < pubs.Length; i++) { if (pubs[i].Trim() != "") { int pubid = Int32.Parse(pubs[i]); Product p = Product.GetPubByPubID(pubid); p.NumQtyOrdered = Int32.Parse(qtys[i]); this.shoppingcart.Add(p); //BLL will know what to do w/ dupes and 0 quantities } } grdViewItems.DataSource = this.shoppingcart; grdViewItems.DataBind(); } //Check for cart object here if (this.shoppingcart == null) { Response.Redirect("default.aspx?redirect=cart1", true); } if (this.shoppingcart.Count > 0) { //***EAC at this point we have a usable cart lblTot.Text = this.shoppingcart.TotalQty.ToString(); //lblCost.Text = this.shoppingcart.Cost.ToString("c"); /*Begin HITT 8716*/ if (this.shoppingcart.Cost > 0.0) { CostRecoveryInd = "1"; } else { CostRecoveryInd = ""; } this.ToggleCostDivs(CostRecoveryInd); /*End HITT 8716*/ Panel1.Visible = true; Panel2.Visible = false; } else//shopping cart is empty { Panel1.Visible = false; Panel2.Visible = true; } //Set the appropriate tab int intTotalQty = 0; if (Session["NCIPLEX_Qtys"] != null) { string[] qtys = Session["NCIPLEX_Qtys"].ToString().Split(new Char[] { ',' }); for (int i = 0; i < qtys.Length; i++) { if (qtys[i].Length > 0) { intTotalQty += Int32.Parse(qtys[i].ToString()); } } } //Display the master page tabs GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils(); if (Session["NCIPLEX_Pubs"] != null) { Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPLEX_Qtys"].ToString(), "cart"); } else { Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "cart"); } UtilMethod = null; }
protected void Page_Load(object sender, EventArgs e) { if (shoppingcartV2 == null || shoppingcartV2.Count < 1) { //***EAC I need a shopping cart at this point GlobalUtils.Utils.ClearAllSessions(); Response.Redirect("~/login.aspx", true); } if (!GlobalUtils.Utils.isLoggedin()) { //***EAC I need a logged in user at this point GlobalUtils.Utils.ClearAllSessions(); Response.Redirect("~/login.aspx", true); } string role = GlobalUtils.Utils.LoggedinRole(); if (role != "NCIPL_LM") { throw (new ArgumentException("Your role is not allowed at this point.")); } if (!IsPostBack) { Session["NCIPLCC_PrinterSplitOrder"] = null; //NCIPL_CC steps1.Activate("cell3"); //NCIPL_CC - Populate Customer Type Dropdown KVPairCollection kvpairColl = KVPair.GetKVPair("sp_NCIPLLM_getTypeOfCustomer"); foreach (KVPair kvpair in kvpairColl) { ListItem li = new ListItem(); li.Value = kvpair.Key; li.Text = kvpair.Val; drpCustomerType.Items.Add(li); } kvpairColl = null; //NCIPL_CC - Populate Order Media Dropdown KVPairCollection kvpairColl2 = KVPair.GetKVPair("sp_NCIPLLM_getOrderMedia"); foreach (KVPair kvpair in kvpairColl2) { ListItem li = new ListItem(); //li.Value = kvpair.Key; li.Value = kvpair.Val; //Non-critical data. Just use description to make the data retrieval from tbl_orderheader easy. li.Text = kvpair.Val; drpOrderMedia.Items.Add(li); } kvpairColl2 = null; drpDelivery.DataSource = DAL2.DAL.GetAllShippingMethods(); drpDelivery.DataTextField = "Val"; drpDelivery.DataValueField = "Key"; drpDelivery.DataBind(); drpDelivery.Items.Insert(0, new ListItem("USPS", "S1")); drpDelivery.Items.Insert(0, new ListItem("Courier", "C1")); drpDelivery.Items.Insert(0, new ListItem("[Select a Shipping Method]", "")); drpCountry.DataSource = drp2Country.DataSource = DAL2.DAL.GetCountries(); drpCountry.DataTextField = drp2Country.DataTextField = "Val"; drpCountry.DataValueField = drp2Country.DataValueField = "Key"; drpCountry.DataBind(); drp2Country.DataBind(); drpCountry.Items.Insert(0, new ListItem("UNITED STATES", "US")); drp2Country.Items.Insert(0, new ListItem("UNITED STATES", "US")); BindShippingInfo(); //Restore ship vals BindBillingInfo(); BindExtraInfo(); BindTotals(shipto != null ? shipto.State : ""); } }
protected void lstviewCannedRecords_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem item = (ListViewDataItem)e.Item; cs_record currRecord = (cs_record)item.DataItem; //Get the Current Record Item in the collection #region ReadOnlyMode //Get the Controls HiddenField CannId = (HiddenField)e.Item.FindControl("CannId"); Label lblRecordId = (Label)e.Item.FindControl("lblRecordId"); Label lblHeaderText = (Label)e.Item.FindControl("lblHeaderText"); Label lblUrl = (Label)e.Item.FindControl("lblUrl"); Label lblCancerType = (Label)e.Item.FindControl("lblCancerType"); Label lblSubject = (Label)e.Item.FindControl("lblSubject"); Label lblPubFormat = (Label)e.Item.FindControl("lblPubFormat"); Label lblRace = (Label)e.Item.FindControl("lblRace"); Label lblAudience = (Label)e.Item.FindControl("lblAudience"); Label lblLanguage = (Label)e.Item.FindControl("lblLanguage"); Label lblCollections = (Label)e.Item.FindControl("lblCollections"); Label lblActive = (Label)e.Item.FindControl("lblActive"); //Assign Values if (CannId != null) { CannId.Value = currRecord.CannId.ToString(); } if (lblRecordId != null) { lblRecordId.Text = currRecord.RecId; } if (lblHeaderText != null) { lblHeaderText.Text = currRecord.HeaderText; } if (lblUrl != null) { lblUrl.Text = ConfigurationManager.AppSettings["NCIPLCannedSearchURL"] + currRecord.RecId; } if (lblCancerType != null) { lblCancerType.Text = currRecord.CancerType; } if (lblSubject != null) { lblSubject.Text = currRecord.Subject; } if (lblPubFormat != null) { lblPubFormat.Text = currRecord.PubFormat; } if (lblRace != null) { lblRace.Text = currRecord.Race; } if (lblAudience != null) { lblAudience.Text = currRecord.Audience; } if (lblLanguage != null) { lblLanguage.Text = currRecord.Language; } if (lblCollections != null) { lblCollections.Text = currRecord.Collections; } if (lblActive != null) { if (currRecord.Active == 1) { lblActive.Text = "Yes"; } else { lblActive.Text = "No"; } } #region SecurityCheck1 if (CannId != null) { this.SecurityCheck(1, CannId); } #endregion #endregion #region EditMode //Get the Controls HiddenField CannIdEdit = (HiddenField)e.Item.FindControl("CannIdEdit"); if (CannIdEdit != null) { CannIdEdit.Value = currRecord.CannId.ToString(); } Label lblRecordIdEdit = (Label)e.Item.FindControl("lblRecordIdEdit"); if (lblRecordIdEdit != null) { lblRecordIdEdit.Text = currRecord.RecId; } TextBox txtHeaderTextEdit = (TextBox)e.Item.FindControl("txtHeaderTextEdit"); if (txtHeaderTextEdit != null) { txtHeaderTextEdit.Text = currRecord.HeaderText; } //Type of Cancer PubEntAdmin.UserControl.cslistbox ucCancerTypeEdit = (PubEntAdmin.UserControl.cslistbox)e.Item.FindControl("ucCancerTypeEdit"); if (ucCancerTypeEdit != null) { kvpaircoll = DAL.cs_dal.GetKVPair("sp_CANNED_getCancerTypes", 0, currRecord.CannId); foreach (KVPair kvpair in kvpaircoll) { ListItem lstItem = new ListItem(); lstItem.Text = kvpair.Val; lstItem.Value = kvpair.Key; if (kvpair.IsSelected == "1") { lstItem.Selected = true; } else { lstItem.Selected = false; } ucCancerTypeEdit.listBoxCtrl.Items.Add(lstItem); lstItem = null; } kvpaircoll = null; } //Subject List PubEntAdmin.UserControl.cslistbox ucSubjectEdit = (PubEntAdmin.UserControl.cslistbox)e.Item.FindControl("ucSubjectEdit"); if (ucSubjectEdit != null) { kvpaircoll = DAL.cs_dal.GetKVPair("sp_CANNED_getSubjects", 0, currRecord.CannId); foreach (KVPair kvpair in kvpaircoll) { ListItem lstItem = new ListItem(); lstItem.Text = kvpair.Val; lstItem.Value = kvpair.Key; if (kvpair.IsSelected == "1") { lstItem.Selected = true; } else { lstItem.Selected = false; } ucSubjectEdit.listBoxCtrl.Items.Add(lstItem); lstItem = null; } kvpaircoll = null; } //Publication Format List PubEntAdmin.UserControl.cslistbox ucPubFormatEdit = (PubEntAdmin.UserControl.cslistbox)e.Item.FindControl("ucPubFormatEdit"); if (ucPubFormatEdit != null) { kvpaircoll = DAL.cs_dal.GetKVPair("sp_CANNED_getProductFormats", 0, currRecord.CannId); foreach (KVPair kvpair in kvpaircoll) { ListItem lstItem = new ListItem(); lstItem.Text = kvpair.Val; lstItem.Value = kvpair.Key; if (kvpair.IsSelected == "1") { lstItem.Selected = true; } else { lstItem.Selected = false; } ucPubFormatEdit.listBoxCtrl.Items.Add(lstItem); lstItem = null; } kvpaircoll = null; } //Race List PubEntAdmin.UserControl.cslistbox ucRaceEdit = (PubEntAdmin.UserControl.cslistbox)e.Item.FindControl("ucRaceEdit"); if (ucRaceEdit != null) { kvpaircoll = DAL.cs_dal.GetKVPair("sp_CANNED_getRace", 0, currRecord.CannId); foreach (KVPair kvpair in kvpaircoll) { ListItem lstItem = new ListItem(); lstItem.Text = kvpair.Val; lstItem.Value = kvpair.Key; if (kvpair.IsSelected == "1") { lstItem.Selected = true; } else { lstItem.Selected = false; } ucRaceEdit.listBoxCtrl.Items.Add(lstItem); lstItem = null; } kvpaircoll = null; } //Audience List PubEntAdmin.UserControl.cslistbox ucAudienceEdit = (PubEntAdmin.UserControl.cslistbox)e.Item.FindControl("ucAudienceEdit"); if (ucAudienceEdit != null) { kvpaircoll = DAL.cs_dal.GetKVPair("sp_CANNED_getAudience", 0, currRecord.CannId); foreach (KVPair kvpair in kvpaircoll) { ListItem lstItem = new ListItem(); lstItem.Text = kvpair.Val; lstItem.Value = kvpair.Key; if (kvpair.IsSelected == "1") { lstItem.Selected = true; } else { lstItem.Selected = false; } ucAudienceEdit.listBoxCtrl.Items.Add(lstItem); lstItem = null; } kvpaircoll = null; } //Language List PubEntAdmin.UserControl.cslistbox ucLanguageEdit = (PubEntAdmin.UserControl.cslistbox)e.Item.FindControl("ucLanguageEdit"); if (ucLanguageEdit != null) { kvpaircoll = DAL.cs_dal.GetKVPair("sp_CANNED_getLanguages", 0, currRecord.CannId); foreach (KVPair kvpair in kvpaircoll) { ListItem lstItem = new ListItem(); lstItem.Text = kvpair.Val; lstItem.Value = kvpair.Key; if (kvpair.IsSelected == "1") { lstItem.Selected = true; } else { lstItem.Selected = false; } ucLanguageEdit.listBoxCtrl.Items.Add(lstItem); lstItem = null; } kvpaircoll = null; } //Collections List PubEntAdmin.UserControl.cslistbox ucCollectionsEdit = (PubEntAdmin.UserControl.cslistbox)e.Item.FindControl("ucCollectionsEdit"); if (ucCollectionsEdit != null) { kvpaircoll = DAL.cs_dal.GetKVPair("sp_CANNED_getCollections", 0, currRecord.CannId); foreach (KVPair kvpair in kvpaircoll) { ListItem lstItem = new ListItem(); lstItem.Text = kvpair.Val; lstItem.Value = kvpair.Key; if (kvpair.IsSelected == "1") { lstItem.Selected = true; } else { lstItem.Selected = false; } ucCollectionsEdit.listBoxCtrl.Items.Add(lstItem); lstItem = null; } kvpaircoll = null; } DropDownList ddlActiveEdit = (DropDownList)e.Item.FindControl("ddlActiveEdit"); if (ddlActiveEdit != null) { if (currRecord.Active == 1) { ddlActiveEdit.SelectedIndex = 0; } else { ddlActiveEdit.SelectedIndex = 1; } } #region SecurityCheck2 if (CannIdEdit != null) { this.SecurityCheck(1, CannIdEdit); } if (txtHeaderTextEdit != null) { this.SecurityCheck(3, txtHeaderTextEdit); } if (ucCancerTypeEdit != null) { ucCancerTypeEdit.SecurityCheck(); } if (ucSubjectEdit != null) { ucSubjectEdit.SecurityCheck(); } if (ucPubFormatEdit != null) { ucPubFormatEdit.SecurityCheck(); } if (ucRaceEdit != null) { ucRaceEdit.SecurityCheck(); } if (ucAudienceEdit != null) { ucAudienceEdit.SecurityCheck(); } if (ucLanguageEdit != null) { ucLanguageEdit.SecurityCheck(); } if (ucCollectionsEdit != null) { ucCollectionsEdit.SecurityCheck(); } if (ddlActiveEdit != null) { this.SecurityCheck(2, ddlActiveEdit); } #endregion #endregion } }