public Boolean InsertMacroeconomicData(String countryCode, String field, int year, decimal?value, DateTime updateDate, String updateSource) { try { //ICPresentationEntities entity = new ICPresentationEntities(); //Int32? result = entity.InsertMacroeconomic_Data(countryCode, field, year, value, updateDate, updateSource); Macroeconomic_Data macroeconomic_Data = new Macroeconomic_Data(); macroeconomic_Data.COUNTRY_CODE = countryCode; macroeconomic_Data.FIELD = field; macroeconomic_Data.YEAR1 = year; macroeconomic_Data.VALUE = value; macroeconomic_Data.UPDATE_DATE = updateDate; macroeconomic_Data.UPDATE_SOURCE = updateSource; ExternalResearchEntity.Macroeconomic_Data.AddObject(macroeconomic_Data); int?result = ExternalResearchEntity.SaveChanges(); return(result == 1); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public bool InsertFairValues(EntitySelectionData entitySelectionData, string valueType, int?fvMeasure, decimal?fvbuy, decimal?fvSell, decimal?currentMeasureValue, decimal?upside, DateTime?updated) { try { ExternalResearchEntities entity = new ExternalResearchEntities(); GreenField.DAL.GF_SECURITY_BASEVIEW data = DimensionEntity.GF_SECURITY_BASEVIEW.Where(a => a.ISSUE_NAME == entitySelectionData.LongName).FirstOrDefault(); if (data == null) { return(false); } int?securityId = int.Parse(data.SECURITY_ID); if (securityId == null) { return(false); } if (valueType != null) { valueType = valueType.ToUpper(); } entity.InsertDCFFairValue(Convert.ToString(securityId), valueType, fvMeasure, fvbuy, fvSell, currentMeasureValue, upside, updated, "C", 0); return(true); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public bool DeleteFairValues(EntitySelectionData entitySelectionData) { try { ExternalResearchEntities entity = new ExternalResearchEntities(); GreenField.DAL.GF_SECURITY_BASEVIEW data = DimensionEntity.GF_SECURITY_BASEVIEW.Where(a => a.ISSUE_NAME == entitySelectionData.LongName).FirstOrDefault(); if (data == null) { return(false); } int?securityId = int.Parse(data.SECURITY_ID); if (securityId == null) { return(false); } entity.DeleteDCFFairValueData(Convert.ToString(securityId)); return(true); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public Boolean UpdateDocumentsDataForUser(Int64 fileId, String fileName, String userName, String metaTags, String companyInfo , String categoryType, String comment, Byte[] overwriteStream) { try { ICPresentationEntities entity = new ICPresentationEntities(); if (overwriteStream == null) { entity.UpdateDocumentsData(fileId, userName, metaTags, companyInfo, categoryType, comment); } else { FileMaster fileMaster = entity.FileMasters.Where(record => record.FileID == fileId).FirstOrDefault(); if (fileMaster != null) { String uploadUrl = UploadDocument(fileName, overwriteStream, fileMaster.Location); Int32? result = entity.SetUploadFileInfo(userName, fileName, uploadUrl, companyInfo, null, null , categoryType, metaTags, comment).FirstOrDefault(); if (result == 0) { entity.DeleteFileMaster(fileMaster.FileID); } } } return(true); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public List <PERIOD_FINANCIALS> RetrieveFairValue(EntitySelectionData entitySelectionData) { try { List <PERIOD_FINANCIALS> result = new List <PERIOD_FINANCIALS>(); GreenField.DAL.GF_SECURITY_BASEVIEW data = DimensionEntity.GF_SECURITY_BASEVIEW.Where(a => a.ISSUE_NAME == entitySelectionData.LongName).FirstOrDefault(); if (data == null) { return(new List <PERIOD_FINANCIALS>()); } int?securityId = int.Parse(data.SECURITY_ID); if (securityId == null) { return(new List <PERIOD_FINANCIALS>()); } ExternalResearchEntities entity = new ExternalResearchEntities(); result = entity.GetDCFFairValue(Convert.ToString(securityId)).ToList(); if (result == null) { return(new List <PERIOD_FINANCIALS>()); } return(result); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public bool?UpdateApprovalForUsers(MembershipUserInfo[] users) { try { foreach (MembershipUserInfo user in users) { MembershipUser membershipUser = Membership.GetUser(user.UserName, user.IsOnline); membershipUser.IsApproved = user.IsApproved; if (membershipUser != null) { Membership.UpdateUser(membershipUser); } else { return(false); } } return(true); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public bool?SetDashboardPreference(ObservableCollection <tblDashboardPreference> dashBoardPreference, string userName) { try { ResearchEntities entity = new ResearchEntities(); if (dashBoardPreference.Count > 0) { foreach (tblDashboardPreference item in dashBoardPreference) { entity.SetDashBoardPreference(item.UserName, item.GadgetViewClassName, item.GadgetViewModelClassName, item.GadgetName, item.GadgetState, item.PreferenceGroupID, item.GadgetPosition); } } else { entity.SetDashBoardPreference(userName, "null", "null", "null", "null", "null", 0); } return(true); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public Boolean SendAlert(List <String> messageTo, List <String> messageCc, String messageBody, String messageSubject) { Boolean result = false; try { String networkWebmasterEmail = ConfigurationManager.AppSettings.Get("NetworkWebmasterEmail"); String networkCredentialPassword = ConfigurationManager.AppSettings.Get("NetworkCredentialPassword"); String networkCredentialUsername = ConfigurationManager.AppSettings.Get("NetworkCredentialUsername"); String networkCredentialDomain = Convert.ToString(ConfigurationManager.AppSettings.Get("NetworkCredentialDomain")); Int32 networkConnectionPort = Convert.ToInt32(ConfigurationManager.AppSettings.Get("NetworkConnectionPort")); String networkConnectionHost = Convert.ToString(ConfigurationManager.AppSettings.Get("NetworkConnectionHost")); MailMessage mm = new MailMessage(); mm.From = new MailAddress(networkWebmasterEmail); foreach (String email in messageTo) { mm.To.Add(new MailAddress(email)); } foreach (String email in messageCc) { mm.CC.Add(new MailAddress(email)); } mm.Subject = messageSubject; mm.Body = messageBody; mm.IsBodyHtml = false; SmtpClient smtpClient = new SmtpClient(); smtpClient.Host = networkConnectionHost; smtpClient.Port = networkConnectionPort; smtpClient.UseDefaultCredentials = true; smtpClient.EnableSsl = true; NetworkCredential NetworkCred = new NetworkCredential(); NetworkCred.UserName = networkCredentialUsername; NetworkCred.Domain = networkCredentialDomain; NetworkCred.Password = networkCredentialPassword; smtpClient.Credentials = NetworkCred; ServicePointManager.ServerCertificateValidationCallback = delegate(object s , X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return(true); }; smtpClient.Send(mm); result = true; } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } return(result); }
public string CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved) { try { MembershipCreateStatus status = new MembershipCreateStatus(); Membership.CreateUser(username, password, email, passwordQuestion, passwordAnswer, isApproved, out status); switch (status) { case MembershipCreateStatus.DuplicateEmail: return("DuplicateEmail"); case MembershipCreateStatus.DuplicateProviderUserKey: return("DuplicateProviderUserKey"); case MembershipCreateStatus.DuplicateUserName: return("DuplicateUserName"); case MembershipCreateStatus.InvalidAnswer: return("InvalidAnswer"); case MembershipCreateStatus.InvalidEmail: return("InvalidEmail"); case MembershipCreateStatus.InvalidPassword: return("InvalidPassword"); case MembershipCreateStatus.InvalidProviderUserKey: return("InvalidProviderUserKey"); case MembershipCreateStatus.InvalidQuestion: return("InvalidQuestion"); case MembershipCreateStatus.InvalidUserName: return("InvalidUserName"); case MembershipCreateStatus.ProviderError: return("ProviderError"); case MembershipCreateStatus.Success: return("Success"); case MembershipCreateStatus.UserRejected: return("UserRejected"); default: break; } return(null); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public List <DCFTerminalValueCalculationsData> RetrieveTerminalValueCalculationsData(EntitySelectionData entitySelectionData) { try { List <DCFTerminalValueCalculationsData> result = new List <DCFTerminalValueCalculationsData>(); Dictionary <string, decimal?> dataROIC_SDPR = new Dictionary <string, decimal?>(); List <DCFCashFlowData> cashFlowResult = new List <DCFCashFlowData>(); string issuerId; ExternalResearchEntities entity = new ExternalResearchEntities(); if (entitySelectionData == null) { return(new List <DCFTerminalValueCalculationsData>()); } /*#region ServiceAvailabilityChecker * * bool isServiceUp; * isServiceUp = CheckServiceAvailability.ServiceAvailability(); * if (!isServiceUp) * { * throw new Exception("Services are not available"); * } #endregion*/ GreenField.DAL.GF_SECURITY_BASEVIEW securityDetails = DimensionEntity.GF_SECURITY_BASEVIEW .Where(record => record.ASEC_SEC_SHORT_NAME == entitySelectionData.InstrumentID && record.ISSUE_NAME == entitySelectionData.LongName && record.TICKER == entitySelectionData.ShortName).FirstOrDefault(); issuerId = securityDetails.ISSUER_ID; if (issuerId == null) { return(new List <DCFTerminalValueCalculationsData>()); } decimal longTermGDPGrowth = Convert.ToDecimal(entity.GetDCFGDP(Convert.ToString(securityDetails.ISO_COUNTRY_CODE)).FirstOrDefault()); DCFTerminalValueCalculationsData data = new DCFTerminalValueCalculationsData(); dataROIC_SDPR = GetROIC(issuerId); if (dataROIC_SDPR.ContainsKey("ROIC")) { data.SustainableROIC = dataROIC_SDPR.Where(a => a.Key == "ROIC").Select(a => a.Value).FirstOrDefault(); } if (dataROIC_SDPR.ContainsKey("SDPR")) { data.SustainableDividendPayoutRatio = Convert.ToDecimal(dataROIC_SDPR.Where(a => a.Key == "SDPR").Select(a => a.Value).FirstOrDefault()); } data.LongTermNominalGDPGrowth = longTermGDPGrowth; result.Add(data); return(result); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public List <DocumentCategoricalData> RetrieveDocumentsDataForUser(String userName) { try { List <DocumentCategoricalData> result = new List <DocumentCategoricalData>(); ICPresentationEntities entity = new ICPresentationEntities(); List <FileMaster> data = entity.FileMasters.Where(record => record.CreatedBy == userName).ToList(); if (data == null) { return(result); } foreach (FileMaster fileMasterRecord in data) { DocumentCatalogData documentCatalogData = new DocumentCatalogData() { FileId = fileMasterRecord.FileID, FileMetaTags = fileMasterRecord.MetaTags, FileName = fileMasterRecord.Name, FilePath = fileMasterRecord.Location, FileUploadedBy = fileMasterRecord.CreatedBy, FileUploadedOn = Convert.ToDateTime(fileMasterRecord.CreatedOn) }; List <CommentInfo> commentInfo = fileMasterRecord.CommentInfoes.ToList(); List <CommentDetails> commentDetails = new List <CommentDetails>(); foreach (CommentInfo info in commentInfo) { commentDetails.Add(new CommentDetails() { Comment = info.Comment, CommentBy = info.CommentBy, CommentOn = Convert.ToDateTime(info.CommentOn) }); } result.Add(new DocumentCategoricalData() { CommentDetails = commentDetails, DocumentCatalogData = documentCatalogData, DocumentCategoryType = (DocumentCategoryType)EnumUtils.ToEnum(fileMasterRecord.Type, typeof(DocumentCategoryType)), DocumentCompanyName = fileMasterRecord.IssuerName, DocumentSecurityName = fileMasterRecord.SecurityName, DocumentSecurityTicker = fileMasterRecord.SecurityTicker }); } return(result); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public List <FreeCashFlowsData> RetrieveFreeCashFlowsData(EntitySelectionData entitySelectionData) { try { List <FreeCashFlowsData> result = new List <FreeCashFlowsData>(); List <GetFreeCashFlows_Result> resultDB = new List <GetFreeCashFlows_Result>(); ExternalResearchEntities dcf_FreeCashFlows = new ExternalResearchEntities(); if (entitySelectionData == null) { return(null); } DimensionEntities entity = DimensionEntity; /* bool isServiceUp; * isServiceUp = CheckServiceAvailability.ServiceAvailability(); * * if (!isServiceUp) * throw new Exception("Services are not available");*/ //Retrieving data from security view GreenField.DAL.GF_SECURITY_BASEVIEW data = entity.GF_SECURITY_BASEVIEW .Where(record => record.TICKER == entitySelectionData.ShortName && record.ISSUE_NAME == entitySelectionData.LongName && record.ASEC_SEC_SHORT_NAME == entitySelectionData.InstrumentID && record.SECURITY_TYPE == entitySelectionData.SecurityType) .FirstOrDefault(); if (data == null) { return(null); } ////Retrieving data from Period Financials table resultDB = dcf_FreeCashFlows.ExecuteStoreQuery <GetFreeCashFlows_Result>("exec GetFreeCashFlows @IssuerID={0}", data.ISSUER_ID).ToList(); foreach (GetFreeCashFlows_Result record in resultDB) { FreeCashFlowsData item = new FreeCashFlowsData(); item.FieldName = record.FIELD_NAME; item.PeriodYear = record.PERIOD_YEAR; item.Amount = record.AMOUNT; result.Add(item); } return(result); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public List <DCFSummaryData> RetrieveSummaryData(EntitySelectionData entitySelectionData) { try { List <DCFSummaryData> result = new List <DCFSummaryData>(); List <DCFSummaryDBData> dbResult = new List <DCFSummaryDBData>(); List <DCFSummaryDBData> dbResultShares = new List <DCFSummaryDBData>(); ExternalResearchEntities entity = new ExternalResearchEntities(); if (entitySelectionData == null) { return(new List <DCFSummaryData>()); } /* #region ServiceAvailabilityChecker * * bool isServiceUp; * isServiceUp = CheckServiceAvailability.ServiceAvailability(); * * if (!isServiceUp) * { * throw new Exception("Services are not available"); * } #endregion*/ GreenField.DAL.GF_SECURITY_BASEVIEW securityDetails = DimensionEntity.GF_SECURITY_BASEVIEW .Where(record => record.ASEC_SEC_SHORT_NAME == entitySelectionData.InstrumentID && record.ISSUE_NAME == entitySelectionData.LongName && record.TICKER == entitySelectionData.ShortName).FirstOrDefault(); string issuerId = securityDetails.ISSUER_ID; if (issuerId == null) { return(new List <DCFSummaryData>()); } dbResult = entity.GetDCFSummaryData(issuerId).ToList(); dbResultShares = entity.GetDCF_NumberOfShares(Convert.ToString(securityDetails.SECURITY_ID)).ToList(); DCFSummaryData data = new DCFSummaryData(); data.Cash = dbResult.Where(a => a.DATA_ID == 255).Select(a => a.AMOUNT).FirstOrDefault(); data.FVInvestments = dbResult.Where(a => a.DATA_ID == 258).Select(a => a.AMOUNT).FirstOrDefault(); data.GrossDebt = dbResult.Where(a => a.DATA_ID == 256).Select(a => a.AMOUNT).FirstOrDefault(); data.FVMinorities = dbResult.Where(a => a.DATA_ID == 257).Select(a => a.AMOUNT).FirstOrDefault(); data.NumberOfShares = dbResultShares.Select(a => a.AMOUNT).FirstOrDefault(); result.Add(data); return(result); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public bool?ChangePassword(string username, string oldPassword, string newPassword) { try { return(Membership.Provider.ChangePassword(username, oldPassword, newPassword)); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public string ResetPassword(string username, string answer) { try { return(Membership.Provider.ResetPassword(username, answer)); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public bool?ValidateUser(string username, string password) { try { return(Membership.ValidateUser(username, password)); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public Session GetSession() { try { return(System.Web.HttpContext.Current.Session["Session"] as Session); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public bool?DeleteRole(string username, bool throwOnPopulatedRole) { try { return(Roles.DeleteRole(username, throwOnPopulatedRole)); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public string[] GetRolesForUser(string username) { try { return(Roles.GetRolesForUser(username)); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public bool?UnlockUser(string userName) { try { return(Membership.Provider.UnlockUser(userName)); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public bool?AddUsersToRoles(string[] usernames, string[] roleNames) { try { Roles.AddUsersToRoles(usernames, roleNames); return(true); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public bool?CreateRole(string roleName) { try { Roles.CreateRole(roleName); return(true); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public MembershipUserInfo GetUser(string username, bool userIsOnline) { try { MembershipUser user = Membership.GetUser(username, userIsOnline); return(user != null?ConvertMembershipUser(user) : null); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public List <string> GetDocumentsMetaTags(Boolean OnlyTags) { try { ICPresentationEntities entity = new ICPresentationEntities(); List <string> metaTagsInfo = new List <string>(); List <String> metaTags = entity.FileMasters.Select(a => a.MetaTags).Distinct().ToList(); for (int i = 0; i < metaTags.Count; i++) { if (metaTags[i] != null) { if (metaTags[i].Contains(";")) { List <String> subTags = metaTags[i].Split(';').ToList(); metaTagsInfo.AddRange(subTags); } else { metaTagsInfo.Add(metaTags[i]); } } } if (!OnlyTags) { metaTagsInfo.AddRange(entity.FileMasters.Select(a => a.IssuerName).Distinct().ToList()); metaTagsInfo.AddRange(entity.FileMasters.Select(a => a.SecurityName).Distinct().ToList()); metaTagsInfo.AddRange(entity.FileMasters.Select(a => a.SecurityTicker).Distinct().ToList()); } for (int i = 0; i < metaTagsInfo.Count; i++) { if (metaTagsInfo[i] != null) { metaTagsInfo[i] = metaTagsInfo[i].ToUpper(); } } metaTagsInfo = metaTagsInfo.Where(record => record != null && record != String.Empty).ToList(); metaTagsInfo = metaTagsInfo.Distinct().ToList(); return(metaTagsInfo); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public bool DeleteFileMasterRecord(Int64 fileId) { try { ICPresentationEntities entity = new ICPresentationEntities(); entity.DeleteFileMaster(fileId); return(true); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public bool ClearSession() { try { // HttpContext.Current.Session["Session"] = null; HttpContext.Current.Session.RemoveAll(); return(true); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public Boolean SetDocumentComment(String userName, Int64 fileId, String comment) { try { ICPresentationEntities entity = new ICPresentationEntities(); Int32?result = entity.SetFileCommentInfo(userName, fileId, comment).FirstOrDefault(); return(result == 0); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }
public string UploadExcelModel(byte[] excelFile, string userName) { try { string result = ""; ReadOpenXMLModel model = new ReadOpenXMLModel(); result = model.ReadExcelData(excelFile, userName); return(result); } catch (Exception ex) { ExceptionTrace.LogException(ex); return(ex.Message); } }
/// <summary> /// Retrieve List of DataPoints for Model-Upload worksheet /// </summary> /// <param name="issuerId">Issuer Id of the Selected Security</param> /// <returns>List of DataPointsModelUploadData</returns> private List <DataPointsModelUploadData> RetrieveModelUploadDataPoints(string issuerId) { try { ExternalResearchEntities entity = new ExternalResearchEntities(); List <DataPointsModelUploadData> result = new List <DataPointsModelUploadData>(); result = entity.RetrieveDataPointsModelUpload(issuerId).ToList(); return(result); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); return(null); } }
public Boolean SetUploadFileInfo(String userName, String Name, String Location, String CompanyName, String SecurityName , String SecurityTicker, String Type, String MetaTags, String Comments) { try { ICPresentationEntities entity = new ICPresentationEntities(); Int32?result = entity.SetUploadFileInfo(userName, Name, Location, CompanyName, SecurityName , SecurityTicker, Type, MetaTags, Comments).FirstOrDefault(); return(result == 0); } catch (Exception ex) { ExceptionTrace.LogException(ex); string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString(); throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message)); } }