public static void Save(Guid? idUpsideoDocument, Guid? idCustomerProspect, string idDTPTransaction, string idDTPUserAccess, string dtpStatusCode, string documentType)
        {
            try
            {
                using (Upsilab.Data.Model.UpsilabEntities db = new Data.Model.UpsilabEntities())
                {
                    var signatureLog = new Upsilab.Data.Model.SignatureLog()
                    {
                        //idUser = (SessionManager.GetUserSession() != null) ? SessionManager.GetUserSession().idUser : (Guid?)null,
                        DocumentType = documentType,
                        DTPStatusCode = dtpStatusCode,
                        idCustomerProspect = idCustomerProspect,
                        idDTPTransaction = idDTPTransaction,
                        idDTPUserAccess = idDTPUserAccess,
                        idUpsideoDocument = idUpsideoDocument,

                        ExtranetType = ConfigurationManager.ExtranetType.ToString(),
                        Host = Upsilab.Business.Utility.UrlHelper.GetHost2(),
                        DateCreated = DateTime.Now
                    };

                    db.AddToSignatureLog(signatureLog);
                    db.SaveChanges();
                }
            }
            catch { }

        }
 public static List<Data.Model.CustomerProspect> GetCustomersForTarificationByIdFirmInstitution(Guid idFirmInstitution)
 {
     List<Data.Model.CustomerProspect> retVal = new List<Data.Model.CustomerProspect>();
     using (UpsilabEntities retrieveContext = new Data.Model.UpsilabEntities())
     {
         var data = ((ObjectQuery<Data.Model.CustomerProspect>)retrieveContext.CustomerProspect.Where(cp => cp.IsCustomer == true && cp.idFirmInstitution == idFirmInstitution)).Include("User");
         if (data != null) retVal = data.ToList();
     }
     return retVal;
 }       
Ejemplo n.º 3
0
        /// <summary>
        /// Ajoute un texte dans le fichier log
        /// </summary>
        public static void AppendException(Exception ex)
        {
            try
            {
                //string source = "www.upsideo.fr";//Upsilab.Business.Utility.UrlHelper.GetHost(); //like "www.upsideo.fr"
                /*string source = Upsilab.Business.Utility.UrlHelper.GetHost2(); //like "www.upsideo.fr"
                
                if (!EventLog.SourceExists(source))
                {
                    EventLog.CreateEventSource(source, "Upsideo Log");
                }
                
                EventLog myLog = new EventLog();
                myLog.Source = source;
                
                string textToAdd = string.Format("{0} : {1}\r\n{2}\r\n{3}\r\n\r\n", DateTime.Now.ToString(), ex.Message, ex.InnerException, ex.StackTrace);
                myLog.WriteEntry(textToAdd);
                */

                //New
                //Ajout dans la table ErrorLog
                using (Upsilab.Data.Model.UpsilabEntities db = new Data.Model.UpsilabEntities())
                {
                    var errorLog = new Upsilab.Data.Model.ErrorLog()
                    {
                        idUser = (SessionManager.GetUserSession() != null) ? SessionManager.GetUserSession().idUser : (Guid?)null,
                        ExtranetType = ConfigurationManager.ExtranetType.ToString(),
                        Message = string.Format("{0} : {1}\r\n{2}\r\n{3}\r\n\r\n", DateTime.Now.ToString(), ex.Message, ex.InnerException, ex.StackTrace),
                        Host = Upsilab.Business.Utility.UrlHelper.GetHost2(),
                        UserAgent = (HttpContext.Current != null) ? HttpContext.Current.Request.UserAgent : null,
                        DateCreated = DateTime.Now
                    };

                    db.AddToErrorLog(errorLog);
                    db.SaveChanges();
                }

            }
            catch { }
        }
Ejemplo n.º 4
0
        public static void LogOnDB(string msg)
        {
            try
            {
                using (Upsilab.Data.Model.UpsilabEntities db = new Data.Model.UpsilabEntities())
                {
                    var errorLog = new Upsilab.Data.Model.ErrorLog()
                    {
                        idUser = (SessionManager.GetUserSession() != null) ? SessionManager.GetUserSession().idUser : (Guid?)null,
                        ExtranetType = ConfigurationManager.ExtranetType.ToString(),
                        Message = msg,
                        Host = Upsilab.Business.Utility.UrlHelper.GetHost2(),
                        UserAgent = (HttpContext.Current != null) ? HttpContext.Current.Request.UserAgent : null,
                        DateCreated = DateTime.Now
                    };

                    db.AddToErrorLog(errorLog);
                    db.SaveChanges();
                }

            }
            catch { }
        }