Exemplo n.º 1
0
 /// <summary>
 /// Returns object of GoogleAnalyticsInfo class based on PortalID.
 /// </summary>
 /// <param name="PortalID">PortalID</param>
 /// <returns>Object of GoogleAnalyticsInfo class</returns>
 public GoogleAnalyticsInfo GetGoogleAnalyticsByPortalID(int PortalID)
 {
     try
     {
         List <KeyValuePair <string, object> > ParaMeterCollection = new List <KeyValuePair <string, object> >();
         ParaMeterCollection.Add(new KeyValuePair <string, object>("@PortalID", PortalID));
         SQLHandler          sqlH        = new SQLHandler();
         GoogleAnalyticsInfo defaultList = sqlH.ExecuteAsObject <GoogleAnalyticsInfo>("dbo.sp_GoogleAnalyticsListByPortalID", ParaMeterCollection);
         return(defaultList);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
    private void BindData()
    {
        try
        {
            txtvalue.Text = "";
            SettingProvider sp = new SettingProvider();
            GoogleAnalyticsInfo objGA = new GoogleAnalyticsInfo();
            objGA = sp.GetGoogleAnalyticsByPortalID(GetPortalID);
            if (objGA != null && objGA.GoogleJSCode != null)
            {
                txtvalue.Text = objGA.GoogleJSCode;
                chkIsActive.Checked = objGA.IsActive;
            }
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }

    }