public int Save() { try { return(mifnexsoEntities.SaveChanges()); } catch (Exception) { return(-1); } }
public int Save() { try { if (message.MessageId == Guid.Empty) { message.MessageId = Guid.NewGuid(); } return(mifnexsoEntities.SaveChanges()); } catch (Exception) { return(-1); } }
public int Save() { try { if (organization.OrganizationID == Guid.Empty) { organization.OrganizationID = Guid.NewGuid(); } return(mifnexsoEntities.SaveChanges()); } catch (Exception) { return(-1); } }
public int Save() { try { if (mailTrackerLog.MailTrackerLogId == Guid.Empty) { mailTrackerLog.MailTrackerLogId = Guid.NewGuid(); } return(mifnexsoEntities.SaveChanges()); } catch (Exception) { return(-1); } }
public int Save() { try { if (potentialUser.PotentialUserId == Guid.Empty) { potentialUser.PotentialUserId = Guid.NewGuid(); } return(mifnexsoEntities.SaveChanges()); } catch (Exception) { return(-1); } }
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); } }
public int Save() { try { if (notification.NotificationId == Guid.Empty) { notification.NotificationId = Guid.NewGuid(); } return(mifnexsoEntities.SaveChanges()); } catch (Exception) { return(-1); } }
public int Save() { try { if (socialMediaIndicator.SocialMediaIndicatorId == Guid.Empty) { socialMediaIndicator.SocialMediaIndicatorId = Guid.NewGuid(); } return(mifnexsoEntities.SaveChanges()); } catch (Exception) { return(-1); } }
public int Save() { try { if (campaignLog.CampaignLogId == Guid.Empty) { campaignLog.CampaignLogId = Guid.NewGuid(); } return(mifnexsoEntities.SaveChanges()); } catch (Exception) { return(-1); } }
public int Save() { try { if (solutionComment.Comment_Id == Guid.Empty) { solutionComment.Comment_Id = Guid.NewGuid(); } return(mifnexsoEntities.SaveChanges()); } catch (Exception) { return(-1); } }
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)); } }
public int Save() { try { if (challengeFile.ChallengeObjectId == Guid.Empty) { challengeFile.ChallengeObjectId = Guid.NewGuid(); } return(mifnexsoEntities.SaveChanges()); } catch (Exception) { throw; //return -1; } }
public int Save() { try { if (document.DocumentId == Guid.Empty) { document.DocumentId = Guid.NewGuid(); } return(mifnexsoEntities.SaveChanges()); } catch (Exception) { throw; //return -1; } }
/// <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(); }
/// <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(); } }
/// <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(); }
/// <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(); } }