Ejemplo n.º 1
0
 public int Save()
 {
     try
     {
         return(mifnexsoEntities.SaveChanges());
     }
     catch (Exception)
     {
         return(-1);
     }
 }
Ejemplo n.º 2
0
 public int Save()
 {
     try
     {
         if (message.MessageId == Guid.Empty)
         {
             message.MessageId = Guid.NewGuid();
         }
         return(mifnexsoEntities.SaveChanges());
     }
     catch (Exception)
     {
         return(-1);
     }
 }
Ejemplo n.º 3
0
 public int Save()
 {
     try
     {
         if (organization.OrganizationID == Guid.Empty)
         {
             organization.OrganizationID = Guid.NewGuid();
         }
         return(mifnexsoEntities.SaveChanges());
     }
     catch (Exception)
     {
         return(-1);
     }
 }
Ejemplo n.º 4
0
 public int Save()
 {
     try
     {
         if (mailTrackerLog.MailTrackerLogId == Guid.Empty)
         {
             mailTrackerLog.MailTrackerLogId = Guid.NewGuid();
         }
         return(mifnexsoEntities.SaveChanges());
     }
     catch (Exception)
     {
         return(-1);
     }
 }
Ejemplo n.º 5
0
 public int Save()
 {
     try
     {
         if (potentialUser.PotentialUserId == Guid.Empty)
         {
             potentialUser.PotentialUserId = Guid.NewGuid();
         }
         return(mifnexsoEntities.SaveChanges());
     }
     catch (Exception)
     {
         return(-1);
     }
 }
Ejemplo n.º 6
0
 public int Save()
 {
     try
     {
         if (challengeJudge.ChallengeJudgeId == Guid.Empty)
         {
             challengeJudge.ChallengeJudgeId = Guid.NewGuid();
         }
         return(mifnexsoEntities.SaveChanges());
     }
     catch (Exception)
     {
         return(-1);
     }
 }
 public int Save()
 {
     try
     {
         if (userNotificationConnection.UserNotificationConnection1 == Guid.Empty)
         {
             userNotificationConnection.UserNotificationConnection1 = Guid.NewGuid();
         }
         return(mifnexsoEntities.SaveChanges());
     }
     catch (Exception)
     {
         return(-1);
     }
 }
Ejemplo n.º 8
0
 public int Save()
 {
     try
     {
         if (notification.NotificationId == Guid.Empty)
         {
             notification.NotificationId = Guid.NewGuid();
         }
         return(mifnexsoEntities.SaveChanges());
     }
     catch (Exception)
     {
         return(-1);
     }
 }
Ejemplo n.º 9
0
 public int Save()
 {
     try
     {
         if (socialMediaIndicator.SocialMediaIndicatorId == Guid.Empty)
         {
             socialMediaIndicator.SocialMediaIndicatorId = Guid.NewGuid();
         }
         return(mifnexsoEntities.SaveChanges());
     }
     catch (Exception)
     {
         return(-1);
     }
 }
Ejemplo n.º 10
0
 public int Save()
 {
     try
     {
         if (campaignLog.CampaignLogId == Guid.Empty)
         {
             campaignLog.CampaignLogId = Guid.NewGuid();
         }
         return(mifnexsoEntities.SaveChanges());
     }
     catch (Exception)
     {
         return(-1);
     }
 }
Ejemplo n.º 11
0
 public int Save()
 {
     try
     {
         if (solutionComment.Comment_Id == Guid.Empty)
         {
             solutionComment.Comment_Id = Guid.NewGuid();
         }
         return(mifnexsoEntities.SaveChanges());
     }
     catch (Exception)
     {
         return(-1);
     }
 }
Ejemplo n.º 12
0
        public HttpResponseMessage MarkAllAsRead()
        {
            try
            {
                var currentUser = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo();

                if (!currentUser.IsInRole("Registered Users"))
                {
                    throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Unauthorized));
                }
                var read = DateTime.Now;
                MIFNEXSOEntities entity = new MIFNEXSOEntities();
                var listNotification    = entity.Notifications.Where(a => a.UserId == currentUser.UserID && a.Read == null);
                foreach (var item in listNotification)
                {
                    item.Read = read;
                }
                if (entity.SaveChanges() >= 0)
                {
                    return(Request.CreateResponse(HttpStatusCode.OK, "Successful Operation"));
                }
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError));
            }
            catch (HttpResponseException e)
            {
                throw e;
            }
            catch (Exception ee)
            {
                DotNetNuke.Services.Exceptions.Exceptions.LogException(ee);
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError));
            }
        }
Ejemplo n.º 13
0
 public int Save()
 {
     try
     {
         if (challengeFile.ChallengeObjectId == Guid.Empty)
         {
             challengeFile.ChallengeObjectId = Guid.NewGuid();
         }
         return(mifnexsoEntities.SaveChanges());
     }
     catch (Exception)
     {
         throw;
         //return -1;
     }
 }
Ejemplo n.º 14
0
 public int Save()
 {
     try
     {
         if (document.DocumentId == Guid.Empty)
         {
             document.DocumentId = Guid.NewGuid();
         }
         return(mifnexsoEntities.SaveChanges());
     }
     catch (Exception)
     {
         throw;
         //return -1;
     }
 }
Ejemplo n.º 15
0
 /// <summary>
 /// This method Update States indexed in the table AnalysisData
 /// </summary>
 /// <returns></returns>
 public void UpdateIndexingStates(List <Guid> listRequestUpdateState)
 {
     mifnexsoEntities = new MIFNEXSOEntities();
     // Massive upgrade registration status of indexing documents
     mifnexsoEntities.AnalysisDatas.Where(x => listRequestUpdateState.Contains(x.ObjectId)).ToList().ForEach(a => a.Indexed = true);
     mifnexsoEntities.SaveChanges();
 }
Ejemplo n.º 16
0
 /// <summary>
 /// This method Delete record in the table AnalysisData
 /// </summary>
 /// <param name="objectId"></param>
 public void DeleteDataAnalysis(Guid objectId)
 {
     using (mifnexsoEntities = new MIFNEXSOEntities())
     {
         // Massive Delete documents of entity AnalysisData
         mifnexsoEntities.AnalysisDatas.Where(p => p.ObjectId == objectId).ToList().ForEach(p => mifnexsoEntities.AnalysisDatas.DeleteObject(p));
         mifnexsoEntities.SaveChanges();
     }
 }
Ejemplo n.º 17
0
    /// <summary>
    /// Update current user. Only available for administrators
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnUpdateBatch_Click(object sender, EventArgs e)
    {
        MIFNEXSOEntities nx = new MIFNEXSOEntities();

        foreach (var user in nx.UserProperties)
        {
            var userDNN = UserController.GetUserById(PortalId, user.UserId);
            if (userDNN != null)
            {
                user.email = userDNN.Email;
            }
        }
        nx.SaveChanges();
    }
Ejemplo n.º 18
0
        /// <summary>
        /// This method saves the information of the analysis by the web Api
        /// </summary>
        /// <param name="listForAnalysisData"></param>
        /// <returns></returns>
        public void SaveAnalisysData(List <AnalysisDataDto> listForAnalysisData)
        {
            using (mifnexsoEntities = new MIFNEXSOEntities())
            {
                foreach (AnalysisDataDto item in listForAnalysisData)
                {
                    var objInsert = new AnalysisData();

                    objInsert.AnalysisDataId = Guid.NewGuid();
                    objInsert.ObjectId       = item.objectId;
                    objInsert.ObjectType     = item.objectType;
                    objInsert.TypeKey        = item.typeKey;
                    objInsert.Value          = item.value;
                    objInsert.DateCreated    = System.DateTime.Now;
                    objInsert.DateUpdated    = System.DateTime.Now;

                    mifnexsoEntities.AnalysisDatas.AddObject(objInsert);
                }
                mifnexsoEntities.SaveChanges();
            }
        }