Esempio n. 1
0
        public static void ADD(string message, PortalModuleBase MODULE)
        {
            DotNetNuke.Services.Log.EventLog.EventLogController ELC = new DotNetNuke.Services.Log.EventLog.EventLogController();

            if (MODULE != null)
            {
                ELC.AddLog(MODULE.UserInfo.DisplayName + " - " + MODULE.ModuleConfiguration.DesktopModule.FriendlyName, message, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT);
            }
            else
            {
                ELC.AddLog("Alerta Sistem:", message, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT);
            }
        }
        public void LogError(string Message)
        {
            System.Diagnostics.StackTrace stackTrace = new System.Diagnostics.StackTrace();
            string MethodName = string.Format("{0}-{1}:", stackTrace.GetFrame(1).GetMethod().ReflectedType.ToString(), stackTrace.GetFrame(1).GetMethod().Name);

            EventLog.AddLog(MethodName, Message, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT);
        }
Esempio n. 3
0
        public static void AddLog(string Message, string stack, DotNetNuke.Entities.Modules.PortalModuleBase Module, System.Web.SessionState.HttpSessionState SS)
        {
            ELP = new DotNetNuke.Services.Log.EventLog.EventLogController();
            DotNetNuke.Services.Log.EventLog.LogTypeInfo LT = new DotNetNuke.Services.Log.EventLog.LogTypeInfo();
            LT.LogTypeDescription  = "Error en sistema...";
            LT.LogTypeFriendlyName = "Error en sistema...";
            LT.LogTypeKey          = "Dispensario";
            LT.LogTypeOwner        = "Administrador";

            DotNetNuke.Services.Log.EventLog.LogInfo LI = new DotNetNuke.Services.Log.EventLog.LogInfo();
            if (Module != null)
            {
                LI.LogPortalID = Module.PortalId;
                LI.LogUserID   = Module.UserId;
                LI.AddProperty("Usuario:", Module.UserInfo.Username);
            }
            else
            {
                LI.LogPortalID = 0;
                LI.LogUserID   = 1;
                LI.AddProperty("FromWebservice", "0000");
            }
            LI.LogTypeKey = "Dispensario";

            LI.AddProperty("Error", Message);
            LI.AddProperty("Stack", stack);

            if (SS != null)
            {
                for (int a = 0; a < SS.Count; a++)
                {
                    System.Web.Script.Serialization.JavaScriptSerializer JSC = new System.Web.Script.Serialization.JavaScriptSerializer();
                    string serializationtype = SS[a].GetType().Name;

                    string serialization = "";
                    //MAPA DE SERIALIZACIONES Y CASTEOS

                    if (serializationtype == "Paciente")
                    {
                        serialization = JSC.Serialize(SS[a] as Modelos.Paciente);
                    }
                    if (serializationtype == "String")
                    {
                        serialization = JSC.Serialize(SS[a] as String);
                    }

                    if (serialization == "")
                    {
                        serialization = "No se pudo serializar";
                    }



                    LI.AddProperty("From session Nro. " + a.ToString() + " and key " + SS.Keys[a] + " type [" + serializationtype + "] ", serialization);
                }
            }
            LI.BypassBuffering = true;

            ELP.AddLog(LI);
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _startDate = FirstDayOfMonthFromDateTime(DateTime.Today.AddMonths(-12));
            _endDate   = LastDayOfMonthFromDateTime(DateTime.Today);
            if (!Page.IsPostBack)
            {
                //First Load Countries From Thads Search

                DSPortalsService.DSPortalsSoapClient dsw = new DSPortalsService.DSPortalsSoapClient();
                var ssoGUID      = UserInfo.Profile.GetPropertyValue("ssoGUID");
                var resp         = dsw.GetPortalsForUserJson(ssoGUID).Distinct();
                var thisInstance = StaffBrokerFunctions.GetSetting("DataserverURL", PortalId);
                if (String.IsNullOrEmpty(thisInstance))
                {
                    thisInstance = "-unknownLocation";
                }


                //    MyCountries.Items.Add(new ListItem("South Africa", "https://tntdataserver.com/dataserver/rsa/dataquery/dataqueryservice.asmx"));


                foreach (DSPortalsService.DataserverPortal p in resp.OrderByDescending(x => x.InstanceUri.Contains(thisInstance)).ThenBy(y => y.InstanceName))
                {
                    MyCountries.Items.Add(new ListItem(p.InstanceName, p.InstanceUri));
                }


                //MyCountries.Items.Add(new ListItem("devtest","https://tntdataserver.eu/dataserver/devtest/dataquery/dataqueryservice.asmx"));
                //MyCountries.Items.Add(new ListItem("AgapeAOA","https://tntdataserver.eu/dataserver/AgapeAOA/dataquery/dataqueryservice.asmx"));



                ////

                if (MyCountries.Items.Count > 0)
                {
                    MyCountries_SelectedIndexChanged(this, null);
                    lblMessage.Visible = false;
                }
                else
                {
                    lblMessage.Text = "We cannot find an tntDataserver account for you in any country. Please contact the countries in which you receive donations, as ask them to add your TheKey account to their dataserver.";
                    string Message = "No DataServer accounts for: " + UserInfo.DisplayName + "(" + UserId.ToString() + ") " + ssoGUID + "CountryCount:" + MyCountries.Items.Count.ToString() + ";" + (resp.Count()).ToString();
                    DotNetNuke.Services.Log.EventLog.EventLogController objEventLog = new DotNetNuke.Services.Log.EventLog.EventLogController();

                    objEventLog.AddLog("Accounts", Message, PortalSettings, UserId, Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT);

                    lblMessage.Visible = true;
                }
            }



            //   InitializeValues();
        }
Esempio n. 5
0
 private void logEvent(string logText)
 {
     if (!doLogging)
     {
         return;
     }
     //evLog.WriteEntry(logText);
     DotNetNuke.Services.Log.EventLog.EventLogController eCont = new DotNetNuke.Services.Log.EventLog.EventLogController();
     eCont.AddLog("QB Connector Message", logText, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.HOST_ALERT);
     return;
 }
        public string AddMasterItem(string token, int PortalId, int ClientType, int ClientId, string Title, string Filename, string Length, string Format)
        {
            //client type: -1:don't know, 0:Advertiser, 1:Agency
            //Format should be "HD" or "SD"
            AdminController aCont    = new AdminController();
            string          MasterId = "";
            string          Secret   = "fEE3txVQkUSXiAC16vPeqdTTUwOYh99w";

            if (token == Secret)
            {
                try
                {
                    MasterItemInfo master = new MasterItemInfo();
                    master.PortalId = PortalId;
                    if (ClientType == 0 && ClientId > -1)
                    {
                        master.AdvertiserId = ClientId;
                    }
                    master.Title      = Title;
                    master.Filename   = Filename;
                    master.Length     = Length;
                    master.PMTMediaId = aCont.GetNextMediaId(PortalId);
                    if (Format == "HD")
                    {
                        master.PMTMediaId += "H";
                    }
                    master.Id = aCont.Add_MasterItem(master);
                    if (ClientType == 1 && ClientId > -1)
                    {
                        aCont.Add_MasterItemAgency(master.Id, ClientId);
                    }
                    MasterId = master.PMTMediaId;
                }
                catch (Exception ex)
                {
                    DotNetNuke.Services.Log.EventLog.EventLogController eCont = new DotNetNuke.Services.Log.EventLog.EventLogController();
                    eCont.AddLog("Add MasterItem Failed", "Error: " + ex.Message, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.HOST_ALERT);
                    Exceptions.LogException(ex);
                    MasterId = ex.Message;
                }
            }
            else
            {
                MasterId = "Failed.";
            }
            return(MasterId);
        }
Esempio n. 7
0
        /// <summary>
        /// Handles the RowDeleting event of the gvCategorySettings control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="DevExpress.Web.Data.ASPxDataDeletingEventArgs"/> instance containing the event data.</param>
        protected void gvCategorySettings_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            try
            {
                if (UserId == AnonymousUserId && !AllowAnonymousEdits)
                {
                    ShowError("Login required to delete categories.");
                    e.Cancel = true;
                    return;
                }
                else
                {
                    CategoryController objCategories = new CategoryController();
                    int categoryId = (int)e.Keys["CategoryId"];

                    if (categoryId == NoCategoryId)
                    {
                        e.Cancel = true;
                        ShowError("No Category can't be deleted.");
                        return;
                    }
                    else
                    {
                        objCategories.DeleteCategory(UserId, categoryId);
                        ShowInfo(string.Format("Deleted: {0}", e.Values["Name"]));
                    }

                    ASPxGridView gv = (ASPxGridView)sender;

                    gv.DataSource = GetCategories(UserId, NoCategoryId, null);
                    gv.DataBind();
                    gv.CancelEdit();
                    e.Cancel = true;
                }
            }
            catch (Exception ex)
            {
                EventLogger.AddLog("flowmark_Events", string.Format("gvCategorySettings_RowDeleting: {0}", ex.ToString()), PortalSettings, UserId, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.HOST_ALERT);
                ShowError("Couldn't delete category. Error: " + ex.Message);
            }
        }
Esempio n. 8
0
        /// <summary>
        /// WebMethod - authenticate()
        /// To verify username and password for the web connector that is trying to connect
        /// Signature: public string[] authenticate(string strUserName, string strPassword)
        ///
        /// IN:
        /// string strUserName
        /// string strPassword
        ///
        /// OUT:
        /// string[] authReturn
        /// Possible values:
        /// string[0] = ticket
        /// string[1]
        /// - "" = use current company file
        /// - "none" = no further request/no further action required
        /// - "nvu" = not valid user
        /// - "use this string as the company file path" = use this company file
        /// string[2] - (optional) contains the number of seconds to wait before
        /// the next update.
        /// string[3] - (optional) contains the number of seconds to be used as the
        /// MinimumRunEveryNSeconds time.
        ///
        /// The third and fourth elements allow you to to reduce QBWC updates during
        /// peak activity, basically telling QBWC clients not to update so frequently
        /// (the third element) or permanently resetting the minimum update time at the
        /// QBWC client (the fourth element).
        /// </summary>
        public string[] authenticate(string strUserName, string strPassword)
        {
            string evLogTxt = "WebMethod: authenticate() has been called by QBWebconnector";

            evLogTxt = evLogTxt + "Parameters received:";
            evLogTxt = evLogTxt + "string strUserName = "******"string strPassword = "******"QBPassword"];

            evLogTxt = evLogTxt + "Password locally stored = " + pwd;
            if (strUserName.ToUpper().Trim().Equals(ConfigurationManager.AppSettings["QBUserName"]) &&
                strPassword.ToUpper().Trim().Equals(pwd.ToUpper()))
            {
                // An empty string for authReturn[1] means asking QBWebConnector
                // to connect to the company file that is currently openned in QB
                authReturn[1] = "";
            }
            else
            {
                authReturn[1] = "nvu";
            }
            // You could also return "none" to indicate there is no work to do
            // or a company filename in the format C:\full\path o\company.qbw
            // based on your program logic and requirements.
            evLogTxt = evLogTxt + "Return values: ";
            evLogTxt = evLogTxt + "string[] authReturn[0] = " + authReturn[0].ToString();
            evLogTxt = evLogTxt + "string[] authReturn[1] = " + authReturn[1].ToString();
            DotNetNuke.Services.Log.EventLog.EventLogController eCont = new DotNetNuke.Services.Log.EventLog.EventLogController();
            eCont.AddLog("QB Connector Message", evLogTxt, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.HOST_ALERT);
            return(authReturn);
        }
        public async void RunReportsAsync(int PortalId, string baseUrl)
        {
            AdminController   aCont   = new AdminController();
            List <ReportInfo> reports = aCont.Get_ReportsByPortalId(PortalId);
            string            summary = "";

            foreach (ReportInfo report in reports)
            {
                summary += "Report ID: " + report.Id.ToString() + ", title: " + report.ReportName + ", Email to: " + report.EmailTo;
                if (report.isActive)
                {
                    List <TaskInfo> tasks = new List <TaskInfo>();
                    if (report.ReportType == 3)
                    {
                        tasks = getReportTasks(PortalId, report);
                    }
                    if ((report.ReportType == 3 && tasks.Count > 0) || report.ReportType == 1 || report.ReportType == 2)
                    {
                        bool sent = false;
                        if (report.Frequency == "daily" && DateTime.Now.DayOfWeek != DayOfWeek.Saturday && DateTime.Now.DayOfWeek != DayOfWeek.Sunday)
                        {
                            aCont.SendReport(report, baseUrl, true);
                            sent = true;
                        }
                        else if (report.Frequency == "weekly")
                        {
                            DateTime today = DateTime.Now;
                            TimeSpan t     = today - report.FirstReportDate;
                            if (t.TotalDays % 7 == 0)
                            {
                                aCont.SendReport(report, baseUrl, true);
                                sent = true;
                            }
                        }
                        else if (report.Frequency == "monthly")
                        {
                            DateTime today = DateTime.Now;
                            if (today.Day == report.FirstReportDate.Day)
                            {
                                aCont.SendReport(report, baseUrl, true);
                                sent = true;
                            }
                        }
                        if (sent)
                        {
                            summary += " sent. ";
                        }
                        else
                        {
                            summary += " not sent. ";
                        }
                    }
                    else
                    {
                        summary += " not sent. ";
                    }
                }
                else
                {
                    summary += " not sent. ";
                }
            }
            DotNetNuke.Services.Log.EventLog.EventLogController eCont = new DotNetNuke.Services.Log.EventLog.EventLogController();
            eCont.AddLog("Reports Summary", summary, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.HOST_ALERT);
        }
Esempio n. 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _startDate = FirstDayOfMonthFromDateTime(DateTime.Today.AddMonths(-12));
             _endDate = LastDayOfMonthFromDateTime(DateTime.Today);
             if (!Page.IsPostBack)
             {
                //First Load Countries From Thads Search

                 DSPortalsService.DSPortalsSoapClient dsw = new DSPortalsService.DSPortalsSoapClient();
                 var ssoGUID = UserInfo.Profile.GetPropertyValue("ssoGUID");
                 var resp = dsw.GetPortalsForUserJson(ssoGUID ).Distinct();
               var thisInstance = StaffBrokerFunctions.GetSetting("DataserverURL", PortalId);
               if (String.IsNullOrEmpty(thisInstance)) thisInstance = "-unknownLocation";

               //    MyCountries.Items.Add(new ListItem("South Africa", "https://tntdataserver.com/dataserver/rsa/dataquery/dataqueryservice.asmx"));

                 foreach (DSPortalsService.DataserverPortal  p in resp.OrderByDescending(x => x.InstanceUri.Contains(thisInstance)).ThenBy(y => y.InstanceName ))
                 {
                      MyCountries.Items.Add(new ListItem(p.InstanceName , p.InstanceUri ));

                 }

                //MyCountries.Items.Add(new ListItem("devtest","https://tntdataserver.eu/dataserver/devtest/dataquery/dataqueryservice.asmx"));
                //MyCountries.Items.Add(new ListItem("AgapeAOA","https://tntdataserver.eu/dataserver/AgapeAOA/dataquery/dataqueryservice.asmx"));

                 ////

                 if (MyCountries.Items.Count > 0)
                 {
                     MyCountries_SelectedIndexChanged(this, null);
                     lblMessage.Visible = false;
                 }
                 else
                 {
                     lblMessage.Text = "We cannot find an tntDataserver account for you in any country. Please contact the countries in which you receive donations, as ask them to add your TheKey account to their dataserver.";
                     string Message="No DataServer accounts for: " + UserInfo.DisplayName + "(" + UserId.ToString() + ") " + ssoGUID + "CountryCount:" + MyCountries.Items.Count.ToString() + ";" + (resp.Count()).ToString();
                     DotNetNuke.Services.Log.EventLog.EventLogController objEventLog = new DotNetNuke.Services.Log.EventLog.EventLogController();

                     objEventLog.AddLog("Accounts", Message, PortalSettings, UserId, Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT);

                     lblMessage.Visible = true;
                 }

             }

              //   InitializeValues();
        }
Esempio n. 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            openAddCountry.ToolTip = Translate("btnAddCountryTooltip");
            lblNew.Text = Translate("lblNew");
            _startDate = FirstDayOfMonthFromDateTime(DateTime.Today.AddMonths(-12));
            _endDate = LastDayOfMonthFromDateTime(DateTime.Today);

            if (!Page.IsPostBack)
            {
                //First Load Countries From Thads Search

               DSPU.DSPortalUsers dspus = new DSPU.DSPortalUsers();
                ssoGUID = UserInfo.Profile.GetPropertyValue("ssoGUID");
                var resp =  dspus.GetPortalsForUser("CASAUTH", "thecatsaysmeow3", ssoGUID);

                //DSPortalsService.DSPortalsSoapClient dsw = new DSPortalsService.DSPortalsSoapClient();

                //var resp = dsw.GetPortalsForUserJson(ssoGUID).Distinct();
                var thisInstance = StaffBrokerFunctions.GetSetting("DataserverURL", PortalId);
                if (String.IsNullOrEmpty(thisInstance)) thisInstance = "-unknownLocation";

                //    MyCountries.Items.Add(new ListItem("South Africa", "https://tntdataserver.com/dataserver/rsa/dataquery/dataqueryservice.asmx"));

                ////MyCountries.Items.Add(new ListItem("Bulgaria Test", "https://tntdataserver.eu/dataserver/bgr/dataquery/dataqueryservice.asmx"));

                foreach (var p in resp.OrderByDescending(x => x.PortalUri.Contains(thisInstance)).ThenBy(y => y.PortalName))
                {
                    MyCountries.Items.Add(new ListItem(p.PortalName, p.PortalUri));

                }

                MinistryView.MinistryViewDataContext dm = new MinistryView.MinistryViewDataContext();

                var addCountries = from c in dm.MinistryView_UserCountryProfiles where c.GUID == ssoGUID select new { c.UserCountryProfileId, c.MinistryView_AdditionalCountry.CountryName };
                foreach (var row in addCountries)
                {
                    MyCountries.Items.Add(new ListItem(row.CountryName, "ADD" + row.UserCountryProfileId));
                }

                //MyCountries.Items.Add(new ListItem("devtest","https://tntdataserver.eu/dataserver/devtest/dataquery/dataqueryservice.asmx"));
                //MyCountries.Items.Add(new ListItem("AgapeAOA","https://tntdataserver.eu/dataserver/AgapeAOA/dataquery/dataqueryservice.asmx"));

                ////

                if (MyCountries.Items.Count > 0)
                {
                    MyCountries_SelectedIndexChanged(this, null);
                    lblMessage.Visible = false;
                }
                else
                {
                    lblMessage.Text = Translate("lblMessage");
                    string Message = "No DataServer accounts for: " + UserInfo.DisplayName + "(" + UserId.ToString() + ") " + ssoGUID + "CountryCount:" + MyCountries.Items.Count.ToString() + ";" + (resp.Count()).ToString();
                    DotNetNuke.Services.Log.EventLog.EventLogController objEventLog = new DotNetNuke.Services.Log.EventLog.EventLogController();

                    objEventLog.AddLog("Accounts", Message, PortalSettings, UserId, Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT);

                    lblMessage.Visible = true;
                    accordion.Visible = false;
                    divBalance.Visible = false;
                    IncExpGraph.Visible = false;
                }

            }

            //   InitializeValues();
        }
Esempio n. 12
0
 public void logEvent(string evLogTxt)
 {
     DotNetNuke.Services.Log.EventLog.EventLogController eCont = new DotNetNuke.Services.Log.EventLog.EventLogController();
     eCont.AddLog("QB Log Event", "QB Event Log: " + evLogTxt, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.HOST_ALERT);
 }
Esempio n. 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            openAddCountry.ToolTip = Translate("btnAddCountryTooltip");
            lblNew.Text            = Translate("lblNew");
            _startDate             = FirstDayOfMonthFromDateTime(DateTime.Today.AddMonths(-12));
            _endDate = LastDayOfMonthFromDateTime(DateTime.Today);


            if (!Page.IsPostBack)
            {
                //First Load Countries From Thads Search

                DSPU.DSPortalUsers dspus = new DSPU.DSPortalUsers();
                ssoGUID = UserInfo.Profile.GetPropertyValue("ssoGUID");
                var resp = dspus.GetPortalsForUser("CASAUTH", "thecatsaysmeow3", ssoGUID);



                //DSPortalsService.DSPortalsSoapClient dsw = new DSPortalsService.DSPortalsSoapClient();

                //var resp = dsw.GetPortalsForUserJson(ssoGUID).Distinct();
                var thisInstance = StaffBrokerFunctions.GetSetting("DataserverURL", PortalId);
                if (String.IsNullOrEmpty(thisInstance))
                {
                    thisInstance = "-unknownLocation";
                }


                //    MyCountries.Items.Add(new ListItem("South Africa", "https://tntdataserver.com/dataserver/rsa/dataquery/dataqueryservice.asmx"));

                ////MyCountries.Items.Add(new ListItem("Bulgaria Test", "https://tntdataserver.eu/dataserver/bgr/dataquery/dataqueryservice.asmx"));

                foreach (var p in resp.OrderByDescending(x => x.PortalUri.Contains(thisInstance)).ThenBy(y => y.PortalName))
                {
                    MyCountries.Items.Add(new ListItem(p.PortalName, p.PortalUri));
                }

                MinistryView.MinistryViewDataContext dm = new MinistryView.MinistryViewDataContext();

                var addCountries = from c in dm.MinistryView_UserCountryProfiles where c.GUID == ssoGUID select new { c.UserCountryProfileId, c.MinistryView_AdditionalCountry.CountryName };
                foreach (var row in addCountries)
                {
                    MyCountries.Items.Add(new ListItem(row.CountryName, "ADD" + row.UserCountryProfileId));
                }



                //MyCountries.Items.Add(new ListItem("devtest","https://tntdataserver.eu/dataserver/devtest/dataquery/dataqueryservice.asmx"));
                //MyCountries.Items.Add(new ListItem("AgapeAOA","https://tntdataserver.eu/dataserver/AgapeAOA/dataquery/dataqueryservice.asmx"));



                ////

                if (MyCountries.Items.Count > 0)
                {
                    MyCountries_SelectedIndexChanged(this, null);
                    lblMessage.Visible = false;
                }
                else
                {
                    lblMessage.Text = Translate("lblMessage");
                    string Message = "No DataServer accounts for: " + UserInfo.DisplayName + "(" + UserId.ToString() + ") " + ssoGUID + "CountryCount:" + MyCountries.Items.Count.ToString() + ";" + (resp.Count()).ToString();
                    DotNetNuke.Services.Log.EventLog.EventLogController objEventLog = new DotNetNuke.Services.Log.EventLog.EventLogController();

                    objEventLog.AddLog("Accounts", Message, PortalSettings, UserId, Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT);

                    lblMessage.Visible  = true;
                    accordion.Visible   = false;
                    divBalance.Visible  = false;
                    IncExpGraph.Visible = false;
                }
            }



            //   InitializeValues();
        }