protected void btnOk_Click(object sender, EventArgs e) { try { BLCatalogos oblCatalogos = new BLCatalogos(); BLArticulo blArtivculo = new BLArticulo(); BLUsuario blUsuario = new BLUsuario(); Usuario usuario = new Usuario(); ddlUsuarioAsignado.SelectedValue = ddlpopUser.SelectedValue; txtResponsiva.Enabled = false; ddlUsuarioAsignado.Enabled = false; usuario = blUsuario.ObtenUsuario(Convert.ToInt32(ddlUsuarioAsignado.SelectedItem.Value)); txtResponsiva.Text = objectResponsiva.GeneraNoResponsiva(); txtPuesto.Text = oblCatalogos.ObtienePuesto(usuario.idUsuario); List <Articulo> responsivasAnterioresList = blArtivculo.getResponsivasAnteriores(usuario.idUsuario); if (responsivasAnterioresList.Count > 0) { hdnResponsivaAnterior.Value = responsivasAnterioresList[0].ResponsivaAnterior; } gvResponsivasAnteriores.DataSource = responsivasAnterioresList; gvResponsivasAnteriores.DataBind(); mpeAlert.Hide(); } catch (Exception ex) { CambiaEstadoNotificacion("Info", false, string.Empty); CambiaEstadoNotificacion("Warning", true, "Error: " + ex.Message); LabelError.Focus(); mpeAlert.Hide(); } }
//private List<Articulo> ObtieneOrigenGridResponsivaAnterior(string responsi) //{ // bloArticulo = new BLArticulo(); // return bloArticulo.getResponsivaAnterior(responsi, Convert.ToInt32(ddlUsuarioAsignado.SelectedItem.Value)); //} protected void gwvArticuloAsignado_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowIndex > -1) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[0].Attributes.Add("onmousemove", "this.style.cursor='hand';"); e.Row.Cells[0].Attributes.Add("onmouseleave", "this.style.cursor='default';"); e.Row.Cells[0].ToolTip = "Quitar Articulo"; if (hdnNuevaResponsiva.Value.Equals("1")) { e.Row.Cells[0].Attributes.Add("OnClick", "javascript:__doPostBack('gwvArticuloAsignado','Eliminar$" + (e.Row.RowIndex).ToString().Trim() + "')"); } } } } catch (Exception ex) { CambiaEstadoNotificacion("Info", false, string.Empty); CambiaEstadoNotificacion("Warning", true, "Error: " + ex.Message); LabelError.Focus(); } }
/// <summary> /// <Description>Used to Assign data to the controls on the page</Description> /// <Author>Pradeep</Author> /// <CreatedOn>29 Oct 2009</CreatedOn> /// </summary> public override void Activate() { try { Session["DataSetClientMedicationsHistory"] = null; this.TextBoxConsentStartDate.Attributes.Add("onblur", "SetDateFormat(this)"); this.TextBoxConsentEndDate.Attributes.Add("onblur", "SetDateFormat(this)"); base.Activate(); //Code added by Loveena in ref to Task#3234 2.3 Show Client Demographics on All Client Pages if (Session["DataSetClientSummary"] != null) { DataSet _DataSetClientSummary = (DataSet)Session["DataSetClientSummary"]; //Modified by Loveena in ref to Task#3265 LabelClientName.Text = _DataSetClientSummary.Tables["ClientInformation"].Rows[0]["ClientInformationLabel"].ToString(); } // TextBoxConsentStartDate.Text = DateTime.Now.AddYears(-1).ToString("MM/dd/yyyy"); //commented By Priya and Add After Display Medication List //As per task no:2979 GetClientConsentHistory(((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientId); string currentDate = DateTime.Now.ToString("MM/dd/yyyy"); FillMedication(); HiddenFieldMedication.Value = DropDownConsentMedication.SelectedValue; TextBoxConsentStartDate.Text = DateTime.Now.AddYears(-1).ToString("MM/dd/yyyy"); string sFilter = SetFilter(); if (sFilter.Length > 0) { DisplayMedicationData(sFilter); } else { // strErrorMessage = "End Date should be Greater than Start Date"; // #region "error message colors" // Streamline.BaseLayer.CommonFunctions.SetErrorMegssageBackColor(LabelError); // Streamline.BaseLayer.CommonFunctions.SetErrorMegssageForeColor(LabelError); // #endregion // // ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "ShowError('" + strErrorMessage + "', true);", true); } } catch (Exception ex) { if (ex.Data["CustomExceptionInformation"] == null) { ex.Data["CustomExceptionInformation"] = "###Source Function Name - ViewMedicationHistory--Page_Load(), ParameterCount -0 ###"; } else { ex.Data["CustomExceptionInformation"] = ""; } if (ex.Data["DatasetInfo"] == null) { ex.Data["DatasetInfo"] = null; } Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this); if (ex.Message == "Session Expired") { ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), " HideViewHistory('" + ex.Message + "');", true); } } }
/// <summary> /// <Description>Used to handles the ButtonApplyFilter click event</Description> /// <Author>Pradeep</Author> /// <CreatedOn>29 Oct 2009</CreatedOn> /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ButtonApplyFilter_Click(object sender, EventArgs e) { try { // FillMedication(); // DropDownConsentMedication.SelectedValue = HiddenFieldMedication.Value; HiddenFieldMedication.Value = DropDownConsentMedication.SelectedValue; string sFilter = SetFilter(); if (sFilter.Length > 0) { DisplayMedicationData(sFilter); } else { DisplayMedicationData(sFilter); strErrorMessage = "End Date should be Greater than Start Date"; #region "error message color" Streamline.BaseLayer.CommonFunctions.SetErrorMegssageBackColor(LabelError); Streamline.BaseLayer.CommonFunctions.SetErrorMegssageForeColor(LabelError); #endregion ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "ShowError('" + strErrorMessage + "', true);", true); } } catch (Exception ex) { Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this); } finally { ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "fnHideParentDiv1();", true); } }
protected override void Page_Load(object sender, EventArgs e) { try { CommonFunctions.Event_Trap(this); //Added by Loveena in ref to task#2378 - CopyrightInfo if (Session["UserContext"] != null) { LabelCopyrightInfo.Text = ((Streamline.BaseLayer.StreamlineIdentity)Context.User.Identity).CopyrightInfo; } #region "error message color added by rohit ref. #121" Streamline.BaseLayer.CommonFunctions.SetErrorMegssageBackColor(LabelError); Streamline.BaseLayer.CommonFunctions.SetErrorMegssageForeColor(LabelError); #endregion if (!Page.IsPostBack) { this.RadioButtonFaxToPharmacy.Attributes.Add("onclick", "return EnablesDisable('" + ButtonOk.ClientID + "','" + RadioButtonFaxToPharmacy.ClientID + "','" + RadioButtonPrintScript.ClientID + "')"); this.RadioButtonPrintScript.Attributes.Add("onclick", "return EnablesDisable('" + ButtonOk.ClientID + "','" + RadioButtonFaxToPharmacy.ClientID + "','" + RadioButtonPrintScript.ClientID + "')"); this.ButtonOk.Attributes.Add("onclick", "javascript:return ValidateInputsPrint('" + DropDownListPharmacies.ClientID + "','" + RadioButtonFaxToPharmacy.ClientID + "','" + RadioButtonPrintScript.ClientID + "','" + DropDownListScriptReason.ClientID + "');"); FillPharmaciesCombo(); FillScriptReasonCombo(); HiddenFieldLatestClientMedicationScriptId.Value = Request.QueryString["ClientMedicationScriptId"].ToString(); HiddenFieldOrderMethod.Value = Request.QueryString["OrderingMethod"].ToString(); } } catch (Exception ex) { if (ex.Data["CustomExceptionInformation"] == null) { ex.Data["CustomExceptionInformation"] = "###Source Function Name - MedicationPrintOrderDialog--Page_Load(), ParameterCount -0 ###"; } else { ex.Data["CustomExceptionInformation"] = ""; } if (ex.Data["DatasetInfo"] == null) { ex.Data["DatasetInfo"] = null; } Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this); string strErrorMessage = ""; ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "closeDiv();", true); } finally { } }
protected void ddlUbicacion_SelectedIndexChanged(object sender, EventArgs e) { try { BLCatalogos oblCatalogos = new BLCatalogos(); txtRegion.Text = oblCatalogos.ObtieneRegion(Convert.ToInt32(ddlUbicacion.SelectedValue)); } catch (Exception ex) { CambiaEstadoNotificacion("Info", false, string.Empty); CambiaEstadoNotificacion("Warning", true, "Error: " + ex.Message); LabelError.Focus(); } }
private void ButtonSubmit_Click(object sender, EventArgs e) { if (DatabaseTools.IsInDatabase("Employee", "Employee Code", BoxID.Text)) { LabelError.Hide(); userID = BoxID.Text; Main main = new Main(userID); main.Show(); this.Hide(); BoxID.Clear(); } else { LabelError.Show(); } }
protected override void Page_Load(object sender, EventArgs e) { try { CommonFunctions.Event_Trap(this); //Added in ref to Task#2895 if (System.Configuration.ConfigurationSettings.AppSettings["OpenFromSmartCare"].ToString().ToUpper() == "FALSE") { LinkButtonLogout.Style["display"] = "block"; LinkButtonStartPage.Style["display"] = "block"; } this.ButtonApplyFilter.Attributes.Add("onclick", "javascript:return CheckDates('" + this.TextBoxConsentStartDate.ClientID + "'" + ",'" + this.TextBoxConsentEndDate.ClientID + "','" + LabelError.ClientID + "')"); DropDownConsentMedication.Attributes.Add("onchange", "SetMedicationFilterValue()"); #region --Error Message color Streamline.BaseLayer.CommonFunctions.SetErrorMegssageBackColor(LabelError); Streamline.BaseLayer.CommonFunctions.SetErrorMegssageForeColor(LabelError); #endregion } catch (Exception ex) { if (ex.Data["CustomExceptionInformation"] == null) { ex.Data["CustomExceptionInformation"] = "###Source Function Name - ViewMedicationHistory--Page_Load(), ParameterCount -0 ###"; } else { ex.Data["CustomExceptionInformation"] = ""; } if (ex.Data["DatasetInfo"] == null) { ex.Data["DatasetInfo"] = null; } Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this); if (ex.Message == "Session Expired") { ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), " HideViewHistory('" + ex.Message + "');", true); } } }
protected void gvResponsivasAnteriores_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowIndex > -1) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[0].Attributes.Add("onmousemove", "this.style.cursor='hand';"); e.Row.Cells[0].Attributes.Add("onmouseleave", "this.style.cursor='default';"); e.Row.Cells[0].ToolTip = "Responsiva"; e.Row.Cells[0].Attributes.Add("OnClick", "javascript:__doPostBack('gvResponsivasAnteriores','Select$" + (e.Row.RowIndex).ToString().Trim() + "')"); } } } catch (Exception ex) { CambiaEstadoNotificacion("Info", false, string.Empty); CambiaEstadoNotificacion("Warning", true, "Error: " + ex.Message); LabelError.Focus(); } }
protected void imgAgregar_Click(object sender, ImageClickEventArgs e) { try { Articulo oFindArticulo = new Articulo(); BLArticulo oblArticulo = new BLArticulo(); oFindArticulo = oblArticulo.BuscarArticuloPorSerie(txtNoSerie.Text); List <Articulo> oFindArticuloHeader = new List <Articulo>(); Articulo objectArticulo = new Articulo(); Validacion objValidate = new Validacion(); BLValidaciones objValidaciones = new BLValidaciones(); objValidate = BLValidaciones.ValidaAsignacion(oFindArticulo); if (objValidate.validate) { lstAgregar = (List <Articulo>)Session["GridAdd"]; oFindArticuloHeader = ObtieneElementoGridSerie(); lstAgregar.Add(oFindArticuloHeader[0]); lstAgregar.Add(oblArticulo.BuscarArticuloPorSerie(oFindArticuloHeader[0].noSerie)); Session["GridAdd"] = lstAgregar; ActualizaGrid(); txtNoSerie.Text = string.Empty; fnLimpiaControlDetalle(); } else { CambiaEstadoNotificacion("Info", true, objValidate.message); CambiaEstadoNotificacion("Warning", false, string.Empty); } } catch (Exception ex) { CambiaEstadoNotificacion("Info", false, string.Empty); CambiaEstadoNotificacion("Warning", true, "Error: " + ex.Message); LabelError.Focus(); } }
protected void btnGuardar_Click(object sender, EventArgs e) { string sMensaje = string.Empty; CargaValores(); try { BLArticulo oblArticulo = new BLArticulo(Params); if (radioCon.Checked) { Articulo arti = oblArticulo.BuscarArticuloPorSerie(Params.noSerie); if (arti.idItem != 0) { sMensaje = "Ya Existe un articulo con este No. de serie"; } } if (string.IsNullOrEmpty(sMensaje)) { sMensaje = oblArticulo.insertaArticuloNuevo(chkIgnorarSerie.Checked); } if (Params.idTipoEquipo == (int)TipoEquipo.SERVIDOR || Params.idTipoEquipo == (int)TipoEquipo.CONTROLADORA || Params.idTipoEquipo == (int)TipoEquipo.STORAGE) { string cpacidadeDiscos = string.Empty; string pibe = string.Empty; //for (int i = 3; i < (Convert.ToInt32(ddlDiscosDuros.SelectedItem.Value) + 3) ; i++) //{ // TextBox textKey = (TextBox)tblDetalleServidor.FindControl("txtTamDisco" + i); // if (textKey != null) // { // cpacidadeDiscos += pibe + textKey.Text; // } // pibe = "|"; //} //BLDetalleServidor blDetalle = new BLDetalleServidor(); //blDetalle.InsertaDetalleServidor(oblArticulo.id_Item, // Convert.ToInt32(ddlProcesadores.SelectedItem.Value), // txtTipoProcesadores.Text, // Convert.ToInt32(ddlDiscosDuros.SelectedItem.Value), // cpacidadeDiscos, // txtNombreServidor.Text, // txtDireccionIP.Text); } CambiaEstadoNotificacion("Info", true, sMensaje); CambiaEstadoNotificacion("Warning", false, string.Empty); LimpiarCampos(false); LabelInfo.Focus(); } catch (Exception ex) { CambiaEstadoNotificacion("Info", false, string.Empty); CambiaEstadoNotificacion("Warning", true, "Error: " + ex.Message); LabelError.Focus(); } }
protected void BuscarResponsiva() { txtNoSerie.Text = string.Empty; txtResponsiva.Enabled = true; ddlUsuarioAsignado.Enabled = true; pnlAsignacionActual.Visible = false; //fnLimpiaControlesMain(); fnLimpiaControlDetalle(); Session["GridAdd"] = null; gwvArticuloAsignado.DataBind(); BLCatalogos oblCatalogos = new BLCatalogos(); Articulo oArticulo = new Articulo(); ArticuloHeader oArticuloHeader = new ArticuloHeader(); List <Articulo> olstArticulo = new List <Articulo>(); List <Articulo> olstArticuloHeader = new List <Articulo>(); //btnBuscarResponsiva.Visible = false; //txtResponsiva.Enabled = false; try { CambiaEstadoNotificacion("Info", false, string.Empty); CambiaEstadoNotificacion("Warning", false, string.Empty); if (!ddlUsuarioAsignado.SelectedItem.Value.Equals("1191")) { ArrayList oParams = new ArrayList(); oParams.Add(string.Empty); oParams.Add(txtResponsiva.Text); oParams.Add(ddlUsuarioAsignado.SelectedItem.Value); oParams.Add(0); oParams.Add(0); olstArticulo = bloArticulo.BuscaArticuloFitradoA(oParams); if (olstArticulo.Count > Convert.ToInt16(Constantes.CantidadElementos.Vacio)) { txtResponsiva.Text = olstArticulo[0].responsiva.ToString(); } else { txtResponsiva.Enabled = true; CambiaEstadoNotificacion("Info", true, "La responsiva buscada no existe."); CambiaEstadoNotificacion("Warning", false, string.Empty); } } else { olstArticulo = bloArticulo.BuscarArticuloporResponsiva(txtResponsiva.Text); } olstArticuloHeader = ObtieneOrigenGridResponsiva(); lstAgregar = olstArticuloHeader; Session["GridAdd"] = lstAgregar; if (olstArticulo.Count > Convert.ToInt16(Constantes.CantidadElementos.Vacio)) { txtResponsiva.Enabled = false; pnlAsignacionActual.Visible = true; LabelInfo.Text = ""; Info.Visible = false; ddlUsuarioAsignado.SelectedValue = olstArticulo[0].idUsuario.ToString(); txtPuesto.Text = oblCatalogos.ObtienePuesto (olstArticulo[0].idUsuario.HasValue ? olstArticulo[0].idUsuario.Value : 0); ddlUbicacion.SelectedValue = olstArticulo[0].idUbicacion.ToString(); txtObservaciones.Text = olstArticulo[0].ObservacionesResponsiva; txtRegion.Text = oblCatalogos.ObtieneRegion(olstArticulo[0].idUbicacion); gwvArticuloAsignado.DataSource = olstArticuloHeader; gwvArticuloAsignado.DataBind(); ddlTipoArticulo.Enabled = true; ddlMarca.Enabled = true; txtModelo.Enabled = true; dplUbicacionFiltro.Enabled = true; btnBuscarArticulo.Enabled = true; btnDocumento.Enabled = true; } else { CambiaEstadoNotificacion("Info", true, "La responsiva buscada no existe."); CambiaEstadoNotificacion("Warning", false, string.Empty); } } catch (Exception ex) { CambiaEstadoNotificacion("Info", false, string.Empty); CambiaEstadoNotificacion("Warning", true, "Error: " + ex.Message); LabelError.Focus(); } }
protected override void Page_Load(object sender, EventArgs e) { if (Request.QueryString["AjaxAction"] == "saveHMTemplateUserDecisions") { string acceptedKeys = Request.QueryString["AcceptedKeys"].ToString(); string rejectedKeys = Request.QueryString["RejectedKeys"].ToString(); string clientIdStr = Request.QueryString["ClientId"].ToString(); int clientId = 0; if (clientIdStr != null && clientIdStr != "") { clientId = Convert.ToInt32(clientIdStr); } using (Streamline.UserBusinessServices.HealthMaintenanceTemplate HealthMaintenanceObj = new Streamline.UserBusinessServices.HealthMaintenanceTemplate()) { string pendingAlertCount = ""; DataSet dataSetObj = HealthMaintenanceObj.SaveHealthMaintenaceUserDecisions(acceptedKeys, rejectedKeys, clientId); if (dataSetObj != null && dataSetObj.Tables.Count > 0) { if (dataSetObj.Tables[0] != null && dataSetObj.Tables[0].Rows.Count > 0) { pendingAlertCount = dataSetObj.Tables[0].Rows[0][0].ToString(); } } Response.Clear(); Response.Write(pendingAlertCount); Response.End(); } } if (Request.QueryString["AjaxAction"] == "HealthMaintenanceAlertCheck") { string CheckAlert = "true"; int CheckClientID = ((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientId; string retValue = HealthMaintenanceAlertCheck(CheckAlert, CheckClientID); Response.Write(retValue); Response.End(); } try { Response.Cache.SetCacheability(HttpCacheability.NoCache); if (Session["UserContext"] != null) { LabelCopyrightInfo.Text = ((Streamline.BaseLayer.StreamlineIdentity)Context.User.Identity).CopyrightInfo; } if (Page.IsPostBack == false) { try { bindTemplateGrid(); } catch (Exception ex) { ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "ShowError('" + ex.Message.ToString() + "', true);", true); } } } catch (Exception ex) { if (ex.Data["CustomExceptionInformation"] == null) { ex.Data["CustomExceptionInformation"] = ""; } string ParseMessage = ex.Message; if (ParseMessage.IndexOf("System.Data.SqlClient.SqlException:") > 0) { int SubstringLen = ParseMessage.IndexOf("\n") - ParseMessage.IndexOf("System.Data.SqlClient.SqlException:"); ParseMessage = ParseMessage.Substring(ParseMessage.IndexOf("System.Data.SqlClient.SqlException:") + 35, SubstringLen - 35); // ShowError(ParseMessage, true); } Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this); ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "ShowError('" + ex.Message.ToString() + "', true);", true); } }
protected override void Page_Load(object sender, EventArgs e) { FileStream fs; TextWriter ts; string _strClientMedicationIds = ""; ArrayList MedicationArrays; Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(DateTime.Now - new TimeSpan(0, 0, 0)); Response.Cache.SetLastModified(DateTime.Now); Response.Cache.SetAllowResponseInBrowserHistory(false); Response.Expires = 0; Response.Cache.SetNoStore(); Response.AppendHeader("Pragma", "no-cache"); divReportViewer1.Visible = true; divNonReportViewer.Visible = false; try { #region "error message color added by rohit ref. #121" Streamline.BaseLayer.CommonFunctions.SetErrorMegssageBackColor(LabelError); Streamline.BaseLayer.CommonFunctions.SetErrorMegssageForeColor(LabelError); #endregion string strPath = ""; string FileName = ""; fs = new FileStream(Server.MapPath("RDLC\\" + Context.User.Identity.Name + "\\Report.html"), FileMode.Create); ts = new StreamWriter(fs); _strClientMedicationIds = Request.QueryString["varClientMedicationIds"].ToString(); divReportViewer1.InnerHtml = ""; string strPageHtml = ""; MedicationArrays = new ArrayList(); MedicationArrays = ApplicationCommonFunctions.StringSplit(_strClientMedicationIds, "^"); for (int i = 0; i < MedicationArrays.Count; i++) { foreach (string file in Directory.GetFiles(Server.MapPath("RDLC\\" + Context.User.Identity.Name + "\\"))) { FileName = file.Substring(file.LastIndexOf("\\") + 1); if ((FileName.IndexOf("JPEG") >= 0 || FileName.IndexOf("jpeg") >= 0) && (FileName.IndexOf(MedicationArrays[i].ToString()) >= 0)) { strPageHtml += "<img src='.\\RDLC\\" + Context.User.Identity.Name + "\\" + FileName + "' style='width:108%' />"; } strPath = "'..\\RDLC\\" + Context.User.Identity.Name + "\\" + FileName; } } if (Request.QueryString["ReportViewer"].ToString() == "true") { divReportViewer1.InnerHtml = ""; strPageHtml = strPageHtml.Replace(@"\", "/"); divReportViewer1.InnerHtml = strPageHtml; ts.Close(); } else if (Request.QueryString["ReportViewer"].ToString() == "false") { ts.Close(); //Response.Write(strPageHtml); strPageHtml = strPageHtml.Replace(@"\", "/"); divNonReportViewer.InnerHtml = strPageHtml; divReportViewer1.Visible = false; divNonReportViewer.Visible = true; ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "printScript1();", true); } } catch (Exception ex) { if (ex.Data["CustomExceptionInformation"] == null) { ex.Data["CustomExceptionInformation"] = "###Source Event Name -Page_Load()"; } else { ex.Data["CustomExceptionInformation"] = ""; } if (ex.Data["DatasetInfo"] == null) { ex.Data["DatasetInfo"] = null; } Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this); } finally { fs = null; ts = null; } }
protected void LiberarTodos() { try { int?responsiva = null; int responsi; if (!string.IsNullOrEmpty(txtResponsiva.Text.Trim())) { int.TryParse(txtResponsiva.Text, out responsi); } else { responsi = 0; } if (responsi != 0) { responsiva = responsi; } lstAgregar = (List <Articulo>)Session["GridAdd"]; string sFinalMsg = string.Empty; List <Articulo> responsivasAnterioresList = bloArticulo.getResponsivasAnteriores(Convert.ToInt32(ddlUsuarioAsignado.SelectedValue)); if (responsivasAnterioresList.Count > 0) { hdnResponsivaAnterior.Value = responsivasAnterioresList[0].ResponsivaAnterior; } else { hdnResponsivaAnterior.Value = ""; } if (!hdnResponsivaAnterior.Value.Equals("")) { List <Articulo> anteriores = bloArticulo.getResponsivaAnterior (Convert.ToInt32(hdnResponsivaAnterior.Value), Convert.ToInt32(ddlUsuarioAsignado.SelectedItem.Value)); foreach (Articulo item in anteriores) { Articulo articuloHistoricov = (Articulo)item.Clone(); item.idUsuario = null; item.responsiva = 5000; item.observacion1 = ""; item.observacion2 = ""; item.observacion3 = ""; item.ObservacionesResponsiva = ""; item.idUbicacion = 72; //Enviado al SAT bloArticulo.actualizaAsignacion(item); articuloHistoricov.IdUsuarioNuevo = null; bloArticulo.InsertArticuloHistorico(articuloHistoricov); } hdnResponsivaAnterior.Value = ""; } txtResponsiva.Text = string.Empty; btnDocumento.Enabled = false; sFinalMsg = "Se actualizó la información de la responsiva correspondiente."; CambiaEstadoNotificacion("Info", true, sFinalMsg); CambiaEstadoNotificacion("Warning", false, string.Empty); LabelInfo.Focus(); btnDocumento.Enabled = false; btnGuardar.Enabled = false; btnBuscarArticulo.Enabled = false; ddlUbicacion.Enabled = false; gvResponsivasAnteriores.DataBind(); gvResponsivasAnteriores.Enabled = false; RemueveAtributoQuitarArticulo(); mpeLiberacionArticulos.Hide(); } catch (Exception ex) { CambiaEstadoNotificacion("Info", false, string.Empty); CambiaEstadoNotificacion("Warning", true, "Error: " + ex.Message); LabelError.Focus(); } }
protected void ButtonOk_Click(object sender, EventArgs e) { int PharmacyId = 0; char OrderingMethod = 'F'; int ScriptReason = -1; bool strUpdateDatabase = false; try { CommonFunctions.Event_Trap(this); objectClientMedications = new ClientMedication(); if (RadioButtonFaxToPharmacy.Checked == true) { OrderingMethod = 'F'; } else { OrderingMethod = 'P'; } if (OrderingMethod == 'F') { if (DropDownListPharmacies.SelectedIndex != 0) { PharmacyId = Convert.ToInt32(DropDownListPharmacies.SelectedValue.ToString()); } } if (DropDownListScriptReason.SelectedIndex != 0) { ScriptReason = Convert.ToInt32(DropDownListScriptReason.SelectedValue.ToString()); } //ClientMedicationScriptActivityId = objectClientMedications.InsertIntoClientMedicationScriptActivities(Convert.ToInt32(HiddenFieldLatestClientMedicationScriptId.Value), OrderingMethod, PharmacyId, ScriptReason, CreatedBy); //Send Fax for non-controlled medications if ordering Method is Fax if (OrderingMethod == 'F') { if (HiddenFieldOrderMethod.Value.IndexOf("Faxed") < 0 && HiddenFieldOrderMethod.Value.IndexOf("F") < 0) { strUpdateDatabase = SendToPrinter(ScriptReason, PharmacyId); ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "alert('Some Medications could not be Faxed,Please review script History!');", true); } strUpdateDatabase = SendToFax(ScriptReason, PharmacyId); } if (strUpdateDatabase) { ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "closeDiv();", true); } else { string strErrorMessage = "Error in Updating Database"; ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "ShowError('" + strErrorMessage + "', true);", true); } } catch (Exception ex) { if (ex.Data["CustomExceptionInformation"] == null) { ex.Data["CustomExceptionInformation"] = "Source function ButtonOk_Click of Print Order Dialog"; } else { ex.Data["CustomExceptionInformation"] = ""; } if (ex.Data["DatasetInfo"] == null) { ex.Data["DatasetInfo"] = null; } Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this); string strErrorMessage = "Error in Updating Database"; ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "ShowError('" + strErrorMessage + "', true);", true); } finally { DataSetClientScriptActivities = null; } }
protected void btnAceptar_Click(object sender, EventArgs e) { List <int> lista = (List <int>)HttpContext.Current.Session["idSelectedSess"]; List <int> ListaTotal = new List <int>(); try { foreach (GridViewRow gr in grvFiltroArticulos.Rows) { CheckBox chkSeleccionado = (CheckBox)gr.Cells[0].FindControl("chkSelecciona"); if (chkSeleccionado.Checked) { ListaTotal.Add(Convert.ToInt32(grvFiltroArticulos.DataKeys[gr.RowIndex].Value)); } } if (lista != null) { ListaTotal.AddRange(lista); } foreach (GridViewRow item in gwvArticuloAsignado.Rows) { int idItem = Convert.ToInt32(gwvArticuloAsignado.DataKeys[item.RowIndex].Value); if (ListaTotal.Contains(idItem)) { ListaTotal.Remove(idItem); } } foreach (int item in ListaTotal) { Articulo oFindArticulo = new Articulo(); BLArticulo oblArticulo = new BLArticulo(); oFindArticulo = oblArticulo.BuscaArticuloPorID(item); List <Articulo> oFindArticuloHeader = new List <Articulo>(); Articulo objectArticulo = new Articulo(); lstAgregar = (List <Articulo>)Session["GridAdd"]; if (lstAgregar != null) { lstAgregar.Add(oFindArticulo); } else { lstAgregar = new List <Articulo>(); lstAgregar.Add(oFindArticulo); } Session["GridAdd"] = lstAgregar; } ActualizaGrid(); fnLimpiaControlDetalle(); mpeBusquedaArticulo.Hide(); HttpContext.Current.Session["idSelectedSess"] = null; } catch (Exception ex) { CambiaEstadoNotificacion("Info", false, string.Empty); CambiaEstadoNotificacion("Warning", true, "Error: " + ex.Message); LabelError.Focus(); mpeBusquedaArticulo.Hide(); HttpContext.Current.Session["idSelectedSess"] = null; } }
/// <summary> /// <Description>Used to display those medication data which are consent</Description> /// <Author>Pradeep</Author> /// <CreatedOn>Oct 29,2009</CreatedOn> /// </summary> /// <param name="Filter"></param> private void DisplayMedicationData(string Filter) { DataSet _DataSetClientConsentHistory; DataRow[] DataRowsClientMedications = null; DataRow[] DataRowsClientMedicationInstructions = null; DataSet _DataSetClientConsentFilteredHistory = null; string Medicationsfilter = ""; try { _DataSetClientConsentHistory = new Streamline.UserBusinessServices.DataSets.DataSetClientMedications(); // _DataSetClientConsentHistory = new DataSet(); //Session["DataSetConsentMedicationHistory"] = null; string MedicationId = ""; if (Session["DataSetClientConsentHistory"] != null) { _DataSetClientConsentHistory = (DataSet)Session["DataSetClientConsentHistory"]; } DataTable dtTempMedicationInstructions = new DataTable(); DataTable dtTempMedications = new DataTable(); dtTempMedicationInstructions = _DataSetClientConsentHistory.Tables["ClientMedicationInstructions"].Clone(); dtTempMedications = _DataSetClientConsentHistory.Tables["ClientMedications"].Clone(); // _DataSetClientConsentHistory.Merge(_DataSetClientMedications); if (Filter == "") { DataRowsClientMedications = _DataSetClientConsentHistory.Tables["ClientMedications"].Select("1=0"); DataRowsClientMedicationInstructions = _DataSetClientConsentHistory.Tables["ClientMedicationInstructions"].Select("1=0"); } else { DataRowsClientMedications = _DataSetClientConsentHistory.Tables["ClientMedications"].Select("1=1"); //added By Priya Ref:Task No:2979 if (Filter == "All") { DataRowsClientMedicationInstructions = _DataSetClientConsentHistory.Tables["ClientMedicationInstructions"].Select("1=1"); } else { DataRowsClientMedicationInstructions = _DataSetClientConsentHistory.Tables["ClientMedicationInstructions"].Select(Filter); } } _DataSetClientConsentFilteredHistory = new DataSet(); _DataSetClientConsentFilteredHistory.Merge(DataRowsClientMedications); if (_DataSetClientConsentFilteredHistory.Tables.Count > 0) { _DataSetClientConsentFilteredHistory.Tables[0].TableName = "ClientMedications"; } _DataSetClientConsentFilteredHistory.Merge(DataRowsClientMedicationInstructions); if (_DataSetClientConsentFilteredHistory.Tables.Count > 1) { _DataSetClientConsentFilteredHistory.Tables[1].TableName = "ClientMedicationInstructions"; } //The following session is used for sorting purpose Session["DataSetConsentMedicationHistory"] = _DataSetClientConsentFilteredHistory; ConsentHistoryList1.Activate(); ConsentHistoryList1.SortString = "ConsentStartDate DESC"; ConsentHistoryList1.GenerationConsentTabControlRows(_DataSetClientConsentFilteredHistory.Tables["ClientMedications"], _DataSetClientConsentFilteredHistory.Tables["ClientMedicationInstructions"]); if (Filter != "") { if (_DataSetClientConsentFilteredHistory.Tables["ClientMedicationInstructions"] != null) { if (_DataSetClientConsentFilteredHistory.Tables["ClientMedicationInstructions"].Rows.Count == 0) { string strErrorMessage = "No Records Found matching Search Criteria"; #region "error message color added by rohit ref. #121" Streamline.BaseLayer.CommonFunctions.SetErrorMegssageBackColor(LabelError); Streamline.BaseLayer.CommonFunctions.SetErrorMegssageForeColor(LabelError); #endregion ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "ShowError('" + strErrorMessage + "', true);", true); } } } } catch (Exception ex) { Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this); string strErrorMessage = "Error in loading page"; //ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "ShowError('" + strErrorMessage + "', true);", true); } finally { _DataSetClientConsentHistory = null; DataRowsClientMedications = null; DataRowsClientMedicationInstructions = null; } }
protected override void Page_Load(object sender, EventArgs e) { FileStream fs; TextWriter ts; string _strScriptIds = ""; ArrayList ScriptArrays; string _strChartScriptIds = ""; ArrayList ChartScriptArrays; bool _strFaxSendStatus = false; string _strFaxFaildMessage = ""; Dictionary <string, string> filePathList = new Dictionary <string, string>(); string imagePath = string.Empty; try { #region "error message color added by rohit ref. #121" Streamline.BaseLayer.CommonFunctions.SetErrorMegssageBackColor(LabelError); Streamline.BaseLayer.CommonFunctions.SetErrorMegssageForeColor(LabelError); #endregion string strPath = ""; string FileName = ""; DataSet DatasetSystemConfigurationKeys = null; Streamline.DataService.SharedTables objSharedTables = new Streamline.DataService.SharedTables(); DatasetSystemConfigurationKeys = objSharedTables.GetSystemConfigurationKeys(); if (objSharedTables.GetSystemConfigurationKeys("PRINTFOURPRESCRIPTIONSPERPAGE", DatasetSystemConfigurationKeys.Tables[0]).ToUpper() == "YES") { Printheader.Text = ""; Printfourprescriptionsperpage = "Y"; } fs = new FileStream(Server.MapPath("RDLC\\" + Context.User.Identity.Name + "\\Report.html"), FileMode.Create); ts = new StreamWriter(fs); _strScriptIds = Request.QueryString["varScriptIds"].ToString(); if (Request.QueryString["varChartScriptIds"] != null) { _strChartScriptIds = Request.QueryString["varChartScriptIds"].ToString(); } _strFaxSendStatus = Convert.ToBoolean(Request.QueryString["varFaxSendStatus"]); string strPageHtml = ""; ScriptArrays = new ArrayList(); if (_strScriptIds.Contains("^")) { ScriptArrays = ApplicationCommonFunctions.StringSplit(_strScriptIds, "^"); } else if (_strScriptIds.Contains(",")) { ScriptArrays = ApplicationCommonFunctions.StringSplit(_strScriptIds, ","); } else { ScriptArrays = ApplicationCommonFunctions.StringSplit(_strScriptIds, ","); } ChartScriptArrays = new ArrayList(); if (_strChartScriptIds.Contains("^")) { ChartScriptArrays = ApplicationCommonFunctions.StringSplit(_strChartScriptIds, "^"); } else if (_strChartScriptIds.Contains(",")) { ChartScriptArrays = ApplicationCommonFunctions.StringSplit(_strChartScriptIds, ","); } else { ChartScriptArrays = ApplicationCommonFunctions.StringSplit(_strChartScriptIds, ","); } if (_strFaxSendStatus == false) { _strFaxFaildMessage = "Script could not be faxed at this time. The fax server is not available. Please print the script or re-fax the script later."; strPageHtml += "<span style='float:left;position:absolute;padding-left:30%;color:Red;text-align:center;font-size: 12px;font-family:Microsoft Sans Serif;'><b>" + _strFaxFaildMessage + "</b></span><br/>"; } //End here for (int i = 0; i < ScriptArrays.Count; i++) { foreach (string file in Directory.GetFiles(Server.MapPath("RDLC\\" + Context.User.Identity.Name + "\\"))) { FileName = file.Substring(file.LastIndexOf("\\") + 1); if ((FileName.IndexOf("JPEG") >= 0 || FileName.IndexOf("jpeg") >= 0) && (FileName.IndexOf(ScriptArrays[i].ToString()) >= 0)) { strPageHtml += "<img src='.\\RDLC\\" + Context.User.Identity.Name + "\\" + FileName + "' style='width:100%' />"; imagePath = "RDLC\\" + Context.User.Identity.Name + "\\" + FileName; filePathList.Add(FileName, imagePath); } strPath = "'..\\RDLC\\" + Context.User.Identity.Name + "\\" + FileName; strPath = strPath.Replace(@"\", "/"); } } //Get the Images from ChartScripts Folder for (int i = 0; i < ChartScriptArrays.Count; i++) { if ( Directory.Exists( Server.MapPath("RDLC\\" + Context.User.Identity.Name + "\\" + "ChartScripts" + "\\"))) { foreach ( string file in Directory.GetFiles( Server.MapPath("RDLC\\" + Context.User.Identity.Name + "\\" + "ChartScripts" + "\\")) ) { FileName = file.Substring(file.LastIndexOf("\\") + 1); if ((FileName.IndexOf("JPEG") >= 0 || FileName.IndexOf("jpeg") >= 0) && (FileName.IndexOf(ChartScriptArrays[i].ToString()) >= 0)) { strPageHtml += "<img src='.\\RDLC\\" + Context.User.Identity.Name + "\\" + "ChartScripts" + "\\" + FileName + "' style='width:100%' />"; } strPath = "'..\\RDLC\\" + Context.User.Identity.Name + "\\" + "ChartScripts" + "\\" + FileName; } } } //byte[] photo = org_logo(imagePath); string pageHTMLWithWatermark = string.Empty; bool printWithWatermark = false; int drugCategory = 0; Streamline.UserBusinessServices.DataSets.DataSetClientMedicationOrders _DataSetOrderDetails = Session["DataSetOrderDetails"] as DataSetClientMedicationOrders; string PharmacyName = Convert.ToString(Session["PharmacyName"]); string OrderingMethod = Convert.ToString(Session["OrderingMethod"]); if (OrderingMethod.Contains("Elec")) { if (Session["MedicationOrderStatus"] != null && Convert.ToString(Session["MedicationOrderStatus"]).Equals("Successful") && Session["DrugCategory"] != null) { drugCategory = Convert.ToInt32(Session["DrugCategory"]); if (drugCategory >= 2) { foreach (KeyValuePair <string, string> imageParameters in filePathList) { string phyisicalPathName = AddWatermark(imageParameters.Value, imageParameters.Key, OrderStatus.Success); pageHTMLWithWatermark += "<img src='.\\RDLC\\" + Context.User.Identity.Name + "\\" + phyisicalPathName + "'/>"; printWithWatermark = true; } } } else if (Session["MedicationOrderStatus"] != null && !Convert.ToString(Session["MedicationOrderStatus"]).Equals("Successful") && Session["DrugCategory"] != null) { drugCategory = Convert.ToInt32(Session["DrugCategory"]); foreach (KeyValuePair <string, string> imageParameters in filePathList) { string phyisicalPathName = AddWatermark(imageParameters.Value, imageParameters.Key, OrderStatus.Failure); pageHTMLWithWatermark += "<img src='.\\RDLC\\" + Context.User.Identity.Name + "\\" + phyisicalPathName + "'/>"; printWithWatermark = true; } } } else { if (Session["MedicationOrderStatus"] != null && !Convert.ToString(Session["MedicationOrderStatus"]).Equals("Successful") && Session["DrugCategory"] != null) { drugCategory = Convert.ToInt32(Session["DrugCategory"]); foreach (KeyValuePair <string, string> imageParameters in filePathList) { if (ChartScriptArrays.Count == 0) { string phyisicalPathName = AddOriginalPrescriptionImage(imageParameters.Value, imageParameters.Key); pageHTMLWithWatermark += "<img src='.\\RDLC\\" + Context.User.Identity.Name + "\\" + phyisicalPathName + "'/>"; printWithWatermark = true; } } } printWithWatermark = true; } ts.Close(); if (printWithWatermark && pageHTMLWithWatermark != "") { Response.Write(pageHTMLWithWatermark); } else { strPageHtml = strPageHtml.Replace(@"\", "/"); } Response.Write(strPageHtml); ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "printScript();", true); } catch (Exception ex) { Response.Write("Error While Generating Report" + ex.Message.ToString()); } finally { fs = null; ts = null; _strScriptIds = null; ScriptArrays = null; ChartScriptArrays = null; _strChartScriptIds = null; } }
public string GetErrorMessage(LabelError error, Label labelInfo) { string errorMessage = ""; if ((error & LabelError.LockedAlready) == LabelError.LockedAlready) errorMessage += "- Метка с названием \"" + labelInfo.Name + "\" заблокирована\n"; if ((error & LabelError.NoName) == LabelError.NoName) errorMessage += "- У метки отсутствует название\n"; if ((error & LabelError.SystemLabel) == LabelError.SystemLabel) errorMessage += "- Это системная метка, с которой запрещены какие - либо операции\n"; if ((error & LabelError.DeletedAlready) == LabelError.DeletedAlready) errorMessage += "- Метка " + (labelInfo == null ? "" : "\"" + labelInfo.Name + "\" ") + "уже удалена\n"; if ((error & LabelError.LabelAlreadyExist) == LabelError.LabelAlreadyExist) errorMessage += "- Метка с названием " + (labelInfo == null ? "" : "\"" + labelInfo.Name + "\" ") + "уже учтена в Системе\n"; if ((error & LabelError.NoDeleted) == LabelError.NoDeleted) errorMessage += "- Метку не удалось удален\n"; if ((error & LabelError.UnlockedAlready) == LabelError.UnlockedAlready) errorMessage += "- Метка уже разблокирован\n"; //if ((error & LabelError.WorkInSystem) == LabelError.WorkInSystem) // errorMessage += "- Запись недоступна для изменения: пользователь работает в Системе\n"; return errorMessage; }
protected void btnLiberarSoftware_Click(object sender, EventArgs e) { try { string Mensaje = string.Empty; foreach (GridViewRow gr in gvLiberacionSoftware.Rows) { CheckBox chkSeleccionado = (CheckBox)gr.Cells[0].FindControl("chkSelecciona"); if (chkSeleccionado.Checked) { string s_idImte = gvLiberacionSoftware.DataKeys[gr.RowIndex].Values["Cve_Asignacion"].ToString(); Asignacion_Software asignacionSoftware = new Asignacion_Software(); asignacionSoftware.Cve_Asignacion = Convert.ToInt32(s_idImte); BLAsignacion_Software blAsignacionSoftware = new BLAsignacion_Software(asignacionSoftware); asignacionSoftware = blAsignacionSoftware.ObtenAsignacionSoftware(); asignacionSoftware.Nombre_Usuario = "Disponible"; asignacionSoftware.Area_Solicita = null; blAsignacionSoftware = new BLAsignacion_Software(asignacionSoftware); Mensaje = blAsignacionSoftware.ActualiaAsignacionSoftware(); } } List <int> idSelected = HttpContext.Current.Session["idSelectedSess"] as List <int>; if (idSelected != null) { foreach (int item in idSelected) { Asignacion_Software asignacionSoftware = new Asignacion_Software(); asignacionSoftware.Cve_Asignacion = item; BLAsignacion_Software blAsignacionSoftware = new BLAsignacion_Software(asignacionSoftware); asignacionSoftware = blAsignacionSoftware.ObtenAsignacionSoftware(); asignacionSoftware.Nombre_Usuario = "Disponible"; asignacionSoftware.Area_Solicita = null; blAsignacionSoftware = new BLAsignacion_Software(asignacionSoftware); blAsignacionSoftware.ActualiaAsignacionSoftware(); } } HttpContext.Current.Session["idSelectedSess"] = null; if (Mensaje.Equals("La Asignacion de software fue actualizado correctamente")) { CambiaEstadoNotificacion("Info", true, "La liberación de software se realizó correctamente"); CambiaEstadoNotificacion("Warning", false, string.Empty); if (hdnNuevoUsuario.Value.Equals("1")) { string AreaSolicita = dplAreaSolicita.SelectedItem.Text; LLenaUsuario(); llenarArea_Solicita(); ddlUsuarioAsignado.SelectedValue = txtUsuarioNuevo.Text; dplAreaSolicita.SelectedValue = AreaSolicita; pnlNuevoUsuario.Visible = false; pnlUsuarioAsignado.Visible = true; } else { ddlUsuarioAsignado_SelectedIndexChanged(sender, e); } LabelInfo.Focus(); } } catch (Exception ex) { CambiaEstadoNotificacion("Info", false, string.Empty); CambiaEstadoNotificacion("Warning", true, "Error: " + ex.Message); LabelError.Focus(); HttpContext.Current.Session["idSelectedSess"] = null; } }
protected override void Page_Load(object sender, EventArgs e) { try { Response.Cache.SetCacheability(HttpCacheability.NoCache); AllergySearchCriteria = ""; //Added by Loveena in ref to task#2378 - CopyrightInfo if (Session["UserContext"] != null) { LabelCopyrightInfo.Text = ((Streamline.BaseLayer.StreamlineIdentity)Context.User.Identity).CopyrightInfo; } if (Page.IsPostBack == false) { try { GetAllergiesData(Request.QueryString["SearchCriteria"].ToString()); string ss = ""; ss = Request.QueryString["SearchCriteria"].ToString(); if (ss.IndexOf('!') > 0) { ss = ss.Replace('!', '&'); } if (ss.IndexOf('^') > 0) { ss = ss.Replace('^', '#'); } AllergySearchCriteria = ss; BindGridAllergies(); //this.PlaceHolderScript.Controls.Clear(); } catch (Exception ex) { ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "ShowError('" + ex.Message.ToString() + "', true);", true); } } DataRow[] DataRowAllergyReaction = Streamline.UserBusinessServices.SharedTables.DataSetGlobalCodes.Tables[0].Select("CATEGORY='ALLERGYREACTION' AND ISNULL(RecordDeleted,'N')<>'Y' and Active='Y' ", "CodeName asc"); DataRow[] DataRowAllergySeverity = Streamline.UserBusinessServices.SharedTables.DataSetGlobalCodes.Tables[0].Select("CATEGORY='ALLERGYSEVERITY' AND ISNULL(RecordDeleted,'N')<>'Y' and Active='Y' ", "CodeName asc"); DataSet DataSetAllergyReaction = new DataSet(); DataSetAllergyReaction.Merge(DataRowAllergyReaction); if (DataSetAllergyReaction.Tables.Count > 0) { DataSetAllergyReaction.Tables[0].TableName = "GlobalCodesAllergyReaction"; if (DataSetAllergyReaction.Tables["GlobalCodesAllergyReaction"].Rows.Count > 0) { DropDownListAllergyReaction.DataSource = DataSetAllergyReaction.Tables["GlobalCodesAllergyReaction"]; DropDownListAllergyReaction.DataTextField = "CodeName"; DropDownListAllergyReaction.DataValueField = "GlobalCodeId"; DropDownListAllergyReaction.DataBind(); ListItem itemAllergyReaction = new ListItem(" ", "-1"); DropDownListAllergyReaction.Items.Insert(0, itemAllergyReaction); } } DataSet DataSetAllergySeverity = new DataSet(); DataSetAllergySeverity.Merge(DataRowAllergySeverity); if (DataSetAllergySeverity.Tables.Count > 0) { DataSetAllergySeverity.Tables[0].TableName = "GlobalCodesAllergySeverity"; if (DataSetAllergySeverity.Tables["GlobalCodesAllergySeverity"].Rows.Count > 0) { DropDownListAllergySeverity.DataSource = DataSetAllergySeverity.Tables["GlobalCodesAllergySeverity"]; DropDownListAllergySeverity.DataTextField = "CodeName"; DropDownListAllergySeverity.DataValueField = "GlobalCodeId"; DropDownListAllergySeverity.DataBind(); ListItem itemAllergySeverity = new ListItem(" ", "-1"); DropDownListAllergySeverity.Items.Insert(0, itemAllergySeverity); } } } catch (Exception ex) { if (ex.Data["CustomExceptionInformation"] == null) { ex.Data["CustomExceptionInformation"] = ""; } string ParseMessage = ex.Message; if (ParseMessage.IndexOf("System.Data.SqlClient.SqlException:") > 0) { int SubstringLen = ParseMessage.IndexOf("\n") - ParseMessage.IndexOf("System.Data.SqlClient.SqlException:"); ParseMessage = ParseMessage.Substring(ParseMessage.IndexOf("System.Data.SqlClient.SqlException:") + 35, SubstringLen - 35); // ShowError(ParseMessage, true); } Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this); ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "ShowError('" + ex.Message.ToString() + "', true);", true); } }
public LabelError CheckLabelInfo(Label labelInfo, LabelError forCheck) { LabelError error = new LabelError(); //Проверка на залнение логина if ((forCheck & LabelError.NoName) == LabelError.NoName) { if (labelInfo == null || labelInfo.Name.Trim().Length == 0) { error |= LabelError.NoName; } } //Это системная метка, с которой запрещены какие - либо операции if ((forCheck & LabelError.SystemLabel) == LabelError.SystemLabel) { if ((labelInfo != null) && (labelInfo.IsSystem)) { error |= LabelError.SystemLabel; } } //Проверка на то, что метка уже удалена if ((forCheck & LabelError.DeletedAlready) == LabelError.DeletedAlready) { int labelInfoIndex = -1; if (labelInfo != null) labelInfoIndex = _labelStorage.FindIndex(x => x.Id == labelInfo.Id); if (labelInfoIndex == -1) { error |= LabelError.DeletedAlready; } } //Проверка на, то что такое название метки уже есть в системе if ((forCheck & LabelError.LabelAlreadyExist) == LabelError.LabelAlreadyExist) { //_userStorage.Find(value => value.Name.Equals(labelInfo.Name, StringComparison.InvariantCultureIgnoreCase)&& value.Id!=labelInfo.Id); if (labelInfo != null && _labelStorage.Exists(x => x.Id != labelInfo.Id && x.Name != null && x.Name.ToLower().Trim() == labelInfo.Name.ToLower().Trim())) { error |= LabelError.LabelAlreadyExist; } } //Проверка на, то что метка с таким Id заблокрована if ((forCheck & LabelError.LockedAlready) == LabelError.LockedAlready) { if (labelInfo != null && lockedLabels.Exists(x => x.Id == labelInfo.Id)) { error |= LabelError.LockedAlready; } } //Проверка на, то что метка с таким Id уже не заблоктрована if ((forCheck & LabelError.UnlockedAlready) == LabelError.UnlockedAlready) { if (labelInfo != null && !lockedLabels.Exists(x => x.Id == labelInfo.Id)) { error |= LabelError.UnlockedAlready; } } /*if ((forCheck & LabelError.UsedInPresenatation) == LabelError.UsedInPresenatation) { //IPresentationDAL pres= ; pres.GetPresentationWhichContainsLabel(labelInfo.Id); if (labelInfo != null && !lockedLabels.Exists(x => x.Id == labelInfo.Id)) { error |= LabelError.UsedInPresenatation; } }*/ return error; }
protected void ButtonLogon_Click(object sender, EventArgs e) { objMedicationLogin = new Streamline.UserBusinessServices.MedicationLogin(); //Optimization Added by Sony DataSet ds = null; DataSet userAuthenticationType = null; string authType = string.Empty; string enableADAuthentication = string.Empty; bool isValidUser = false; try { if (TextBoxUsername.Text.Trim() == string.Empty || TextBoxPassword.Text.Trim() == string.Empty) { this.LabelError.Text = "Please enter Username/Password"; return; } try { userAuthenticationType = objMedicationLogin.GetUserAuthenticationType(TextBoxUsername.Text.Trim()); if (userAuthenticationType.Tables["Authentication"].Rows.Count > 0) { authType = userAuthenticationType.Tables["Authentication"].Rows[0]["AuthenticationType"].ToString(); } if (userAuthenticationType.Tables["EnableActiveDirectory"] != null) { enableADAuthentication = userAuthenticationType.Tables["EnableActiveDirectory"].Rows[0]["EnableADAuthentication"].ToString(); } if (enableADAuthentication.ToUpperInvariant().Equals("Y") && authType.ToUpperInvariant().Equals("A")) { isValidUser = objMedicationLogin.ADAuthenticateUser(TextBoxUsername.Text.Trim(), TextBoxPassword.Text.Trim(), userAuthenticationType.Tables["Authentication"].Rows[0]["Domain"].ToString() ); if (isValidUser) { var secureADPassword = new SecureString(); ds = objMedicationLogin.GetAuthenticatedStaffInfo(Convert.ToInt32(userAuthenticationType.Tables["Authentication"].Rows[0]["StaffId"]), TextBoxUsername.Text.Trim()); TextBoxPassword.Text.ToCharArray().ToList().ForEach(secureADPassword.AppendChar); Session["ADPassword"] = secureADPassword; } } else { ds = objMedicationLogin.chkServerLogin(TextBoxUsername.Text.Trim(), TextBoxPassword.Text.Trim()); } if (HiddenFieldUseName.Value.Trim().ToLower() != TextBoxUsername.Text.Trim().ToLower()) { HiddenFieldLoginCount.Value = "0"; HiddenFieldUseName.Value = TextBoxUsername.Text; } HiddenFieldLoginCount.Value = Convert.ToString(Convert.ToInt32(HiddenFieldLoginCount.Value) + 1); hiddenOldPassword.Value = TextBoxPassword.Text.Trim(); } catch (Exception ex) { this.LabelError.Text = "Invalid Username/Password"; TextBoxPassword.Text = ""; throw ex; } //Added in ref to Task#2595 if (Convert.ToInt32(HiddenFieldLoginCount.Value) > 5) { objMedicationLogin.chkCountLogin(TextBoxUsername.Text.Trim()); this.LabelError.Text = "Your account is disabled.Please contact system administrator."; TextBoxPassword.Focus(); HiddenFieldLoginCount.Value = ""; return; } if (ds.Tables[0].Rows.Count <= 0) { this.LabelError.Text = "Invalid Username/Password"; TextBoxPassword.Text = ""; return; } //if (ds.Tables[0].Rows.Count > 0) // { // Response.Redirect("ValidatePage.aspx?ClientId=0&StaffId=" + ds.Tables[0].Rows[0]["StaffID"].ToString()); // } else { //Added by Loveena in ref to Task#3269-2.6 User Management: When Staff Created or Updated Set AccessSmartCare flag. if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0][0].ToString() == "Not an authorized user") { this.LabelError.Text = "Not an authorized user"; } else { int _logStatus = Convert.ToInt32((ds.Tables[0].Rows[0][5]).ToString()); // Password Expire Functionality if (_logStatus == 1 || _logStatus == 2) { ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), "key", "javascript:OpenChangePassword('" + TextBoxPassword.Text + "','" + TextBoxUsername.Text + "');", true); if (hiddenCancelled.Value == "0") { ScriptManager.RegisterClientScriptBlock(LabelError, LabelError.GetType(), "key", "javascript:alert('Password changed successfully')", true); TextBoxPassword.Text = hiddenOldPassword.Value; } if (hiddenCancelled.Value == "1") { ScriptManager.RegisterClientScriptBlock(LabelError, LabelError.GetType(), "key", "alert('Password changed failed')", true); return; } } else { //Added in ref to Task#2595 //Comented by Pradeep for testing needs to be uncoment later //if (ds.Tables[0].Rows[0]["QuestionsAnswered"] != System.DBNull.Value) // { // this.LabelError.Text = ds.Tables[0].Rows[0]["QuestionsAnswered"].ToString(); // TextBoxPassword.Focus(); // } //else // { //Commented in ref to Task#2700 Response.Redirect("ValidatePage.aspx?ClientId=0&StaffId=" + ds.Tables[0].Rows[0]["StaffID"].ToString(), false); //} //Added in ref to Task#2595 //if (ds.Tables[0].Rows[0]["QuestionsAnswered"] != System.DBNull.Value) //{ // //Modified by Loveena in ref to Task#2700 // //this.LabelError.Text = ds.Tables[0].Rows[0]["QuestionsAnswered"].ToString(); // //TextBoxPassword.Focus(); // Response.Redirect("ValidatePage.aspx?ClientId=0&StaffId=" + ds.Tables[0].Rows[0]["StaffID"].ToString() + "&QuestionsAnswered=" + ds.Tables[0].Rows[0]["QuestionsAnswered"].ToString()); //} //else //{ // Response.Redirect("ValidatePage.aspx?ClientId=0&StaffId=" + ds.Tables[0].Rows[0]["StaffID"].ToString() + "&QuestionsAnswered="); //} } } } } } catch (Exception ex) { if (ex.Data["CustomExceptionInformation"] == null) { ex.Data["CustomExceptionInformation"] = "###Source Function Name - MedicationLogin--Page_Load(), ParameterCount -0 ###"; } else { ex.Data["CustomExceptionInformation"] = ""; } if (ex.Data["DatasetInfo"] == null) { ex.Data["DatasetInfo"] = null; } Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this); } }