internal string InserMonitoringNotificationsJobSettings(MonitoringNotificationJobSettingsEntity obj) { string result = ""; try { StoredProcedureEntity sproc = new StoredProcedureEntity(); sproc.StoredProcedureName = "capp.InserMonitoringNotificationsJobSettings"; // MP-846 Admin database cleanup and code cleanup. sproc.StoredProceduresParameter.Add(GetParam("@UserId", obj.UserId.ToString(), SQLServerDatatype.IntDataType)); sproc.StoredProceduresParameter.Add(GetParam("@Format", obj.Format == null ? null : obj.Format.ToString(), SQLServerDatatype.VarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@FileName", string.IsNullOrEmpty(obj.FilePath.ToString()) ? "" : obj.FilePath.ToString(), SQLServerDatatype.VarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@ApplicationId", obj.ApplicationId.ToString(), SQLServerDatatype.VarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@MarkAsExported", obj.MarkAsExported.ToString(), SQLServerDatatype.BitDataType)); sproc.StoredProceduresParameter.Add(GetParam("@Delimiter", string.IsNullOrEmpty(obj.Delimiter) ? null : obj.Delimiter.ToString(), SQLServerDatatype.VarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@APILayer", string.IsNullOrEmpty(obj.APILayer) ? null : obj.APILayer.ToString(), SQLServerDatatype.VarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@IsMonitoringNotifications", obj.IsMonitoringNotifications.ToString(), SQLServerDatatype.BitDataType)); sproc.StoredProceduresParameter.Add(GetParam("@ExportType", obj.ExportType.ToString(), SQLServerDatatype.VarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@HasHeader", obj.HasHeader.ToString(), SQLServerDatatype.BitDataType)); sproc.StoredProceduresParameter.Add(GetParam("@HasTextQualifierToAll", obj.HasTextQualifierToAll.ToString(), SQLServerDatatype.BitDataType)); result = Convert.ToString(sql.ExecuteScalar(CommandType.StoredProcedure, sproc)); result = ""; } catch (Exception Ex) { result = Ex.Message; return(result); } return(result); }
public ActionResult ExportToMonitoring(string Parameters) { string FileName = "", FileType = "", APIName = "", Delimiter = ""; bool MarkAsExported = false; bool HasHeader = false; bool MonitoringHasTextQualifierToAll = false; if (!string.IsNullOrEmpty(Parameters)) { Parameters = StringCipher.Decrypt(Parameters.Replace(Utility.Utility.urlseparator, "+"), General.passPhrase); MarkAsExported = Convert.ToBoolean(Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 0, 1)); FileType = Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 1, 1); APIName = Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 2, 1); Delimiter = Convert.ToString(Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 3, 1)); HasHeader = Convert.ToBoolean(Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 4, 1)); MonitoringHasTextQualifierToAll = Convert.ToBoolean(Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 5, 1)); } string url = Request.Url.Scheme + "://" + Request.Url.Authority + Url.Action("Login", "Account"); string[] hostParts = new System.Uri(url).Host.Split('.'); string domain = hostParts[0]; FileName = domain + "_" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".zip"; MonitoringNotificationJobSettingsEntity objExport = new MonitoringNotificationJobSettingsEntity(); objExport.UserId = Helper.oUser.UserId; objExport.Format = FileType; objExport.FilePath = FileName; objExport.ApplicationId = this.CurrentClient.ApplicationId; objExport.APILayer = APIName; objExport.IsMonitoringNotifications = true; objExport.Delimiter = Delimiter; objExport.MarkAsExported = MarkAsExported; objExport.ExportType = ProviderType.DandB.ToString(); objExport.HasHeader = HasHeader; objExport.HasTextQualifierToAll = MonitoringHasTextQualifierToAll; ExportJobSettingsFacade efac = new ExportJobSettingsFacade(StringCipher.Decrypt(ConfigurationManager.ConnectionStrings["SolidQMasterWeb"].ConnectionString, General.passPhrase)); string message = efac.InserMonitoringNotificationsJobSettings(objExport); if (string.IsNullOrEmpty(message)) { return(new JsonResult { Data = ExportLang.msgExportDataSave }); } else { return(new JsonResult { Data = message }); } }
internal void UpdateMonitoringExportJobSettingsSentMail(MonitoringNotificationJobSettingsEntity obj, bool IsEmailSent) { try { StoredProcedureEntity sproc = new StoredProcedureEntity(); sproc.StoredProcedureName = "mapp.UpdateExportJobSettingsSentMail"; sproc.StoredProceduresParameter.Add(GetParam("@Id", obj.Id.ToString(), SQLServerDatatype.IntDataType)); sproc.StoredProceduresParameter.Add(GetParam("@IsEmailSent", IsEmailSent.ToString(), SQLServerDatatype.BitDataType)); sql.ExecuteNoReturn(CommandType.StoredProcedure, sproc); } catch (Exception) { throw; } }
internal void UpdateMonitoringExportJobSettings(MonitoringNotificationJobSettingsEntity obj, bool IsPorcessStart, bool IsRevert, int RetryCount, string ErrorMessage) { try { StoredProcedureEntity sproc = new StoredProcedureEntity(); sproc.StoredProcedureName = "mapp.UpdateExportJobSettings"; sproc.StoredProceduresParameter.Add(GetParam("@Id", obj.Id.ToString(), SQLServerDatatype.IntDataType)); sproc.StoredProceduresParameter.Add(GetParam("@IsProcessComplete", obj.IsProcessComplete.ToString(), SQLServerDatatype.BitDataType)); sproc.StoredProceduresParameter.Add(GetParam("@FilePath", obj.FilePath == null ? null : obj.FilePath.ToString(), SQLServerDatatype.VarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@IsPorcessStart", IsPorcessStart.ToString(), SQLServerDatatype.VarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@IsRevert", IsRevert.ToString(), SQLServerDatatype.BitDataType)); sproc.StoredProceduresParameter.Add(GetParam("@RetryCount ", RetryCount.ToString(), SQLServerDatatype.IntDataType)); sproc.StoredProceduresParameter.Add(GetParam("@ErrorMessage", !string.IsNullOrEmpty(Convert.ToString(ErrorMessage)) ? ErrorMessage.ToString() : null, SQLServerDatatype.VarcharDataType)); sql.ExecuteNoReturn(CommandType.StoredProcedure, sproc); //result = Convert.ToInt32(sql.ExecuteScalar(CommandType.StoredProcedure, sproc)); } catch (Exception) { throw; } }
public void UpdateMonitoringExportJobSettingsSentMail(MonitoringNotificationJobSettingsEntity obj, bool IsEmailSent) { rep.UpdateMonitoringExportJobSettingsSentMail(obj, IsEmailSent); }
public void UpdateMonitoringExportJobSettings(MonitoringNotificationJobSettingsEntity obj, bool IsPorcessStart, bool IsRevert, int RetryCount = 0, string ErrorMessage = null) { rep.UpdateMonitoringExportJobSettings(obj, IsPorcessStart, IsRevert, RetryCount, ErrorMessage); }
public string InserMonitoringNotificationsJobSettings(MonitoringNotificationJobSettingsEntity obj) { return(rep.InserMonitoringNotificationsJobSettings(obj)); }