protected void uiGridViewAdsLocations_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditLocation") { AdsLocations objData = new AdsLocations(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); uiTextBoxEnName.Text = objData.EnTitle; uiTextBoxArName.Text = objData.ArTitle; try { uiTextBoxTimeOut.Text = objData.AdsTimeout.ToString(); } catch (Exception ex) { uiTextBoxTimeOut.Text = ""; } uiTextBoxDesc.Text = objData.Description; try { uiTextBoxWidth.Text = objData.Width.ToString(); } catch (Exception ex) { uiTextBoxWidth.Text = ""; } try { uiTextBoxHeight.Text = objData.Height.ToString(); } catch (Exception ex) { uiTextBoxHeight.Text = ""; } CurrentAdsLocation = objData; uiPanelViewAdsLocations.Visible = false; uiPanelEdit.Visible = true; } else if (e.CommandName == "DeleteLocation") { AdsLocations objData = new AdsLocations(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); objData.MarkAsDeleted(); objData.Save(); } }
private void LoadLocationDefaults() { AdsLocations location1 = new AdsLocations(); location1.LoadByPrimaryKey(4); uiLiteralScript.Text = "<script type=\"text/javascript\">$(document).ready(function () {$('#Ad4').cycle({ fx: 'fade' , timeout: " + location1.AdsTimeout.ToString() + " }); }); </script>"; }
protected void uiGridViewAds_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataRowView objData = (DataRowView)e.Row.DataItem; AdsLocations adlocation = new AdsLocations(); adlocation.LoadByPrimaryKey(Convert.ToInt32(objData["AdsLocationID"].ToString())); Label temp = (Label)e.Row.FindControl("uiLabelAdLocation"); temp.Text = adlocation.ArTitle; } }