protected void Page_Load(object sender, EventArgs e)
    {
        IEmployeeMst EmployeeManager;

        try
        {
            if (!IsPostBack)
            {
                //(Master.FindControl("lblRoot") as Label).Text = " » Customize Lists";
                //(Master.FindControl("lblMark") as Label).Visible = false;
                //(Master.FindControl("lblheader") as Label).Text = Request.QueryString["LstName"].ToString();
                (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text   = "Customize Lists >> ";
                (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = Request.QueryString["LstName"].ToString();
                ViewState["ListName"] = Request.QueryString["LstName"].ToString();
                ViewState["FID"]      = Request.QueryString["Fid"].ToString();
                lblHeader.Text        = Request.QueryString["LstName"].ToString();
                EmployeeManager       = (IEmployeeMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BEmployeeMst, BusinessProcess.Administration");
                DataSet theDS = EmployeeManager.GetEmployee();
                this.grdMasterEmployee.DataSource = theDS.Tables[0];
                this.grdMasterEmployee.DataBind();
                if (ViewState["grdDataSource"] == null)
                {
                    ViewState["grdDataSource"] = theDS.Tables[0];
                }
                ViewState["SortDirection"] = "Desc";
                BindGrid();
                AuthenticationManager Authentication = new AuthenticationManager();
                if (Authentication.HasFunctionRight(Convert.ToInt32(ViewState["FID"]), FunctionAccess.Add, (DataTable)Session["UserRight"]) == false)
                {
                    btnAdd.Enabled = false;
                }
            }
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
            return;
        }
        finally
        {
            EmployeeManager = null;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "")
        {
            IQCareMsgBox.Show("SessionExpired", this);
            Response.Redirect("~/frmlogin.aspx", true);
        }
        Session["PatientId"] = 0;
        //(Master.FindControl("lblheader") as Label).Text = "User Group Administration";
        //(Master.FindControl("lblMark") as Label).Visible = false;
        (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Visible = false;
        (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text  = "User Group Administration";

        IUserRole UserRoleManager;

        try
        {
            if (!IsPostBack)
            {
                UserRoleManager = (IUserRole)ObjectFactory.CreateInstance("BusinessProcess.Administration.BUserRole, BusinessProcess.Administration");
                DataSet theDS = (DataSet)UserRoleManager.GetUserRoleList();
                this.grdUsergroup.DataSource   = theDS.Tables[0];
                ViewState["gridSortDirection"] = theDS.Tables[0];
                if (ViewState["gridSource"] == null)
                {
                    ViewState["gridSource"]        = theDS.Tables[0];
                    ViewState["gridSortDirection"] = "Desc";
                }
                this.grdUsergroup.DataBind();

                BindGrid();
            }
        }
        catch (Exception err)
        {
            MsgBuilder theMsgBuilder = new MsgBuilder();
            theMsgBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theMsgBuilder, this);
            return;
        }
        finally
        {
            UserRoleManager = null;
        }
    }
Ejemplo n.º 3
0
        /// <summary>
        /// Fields the validation.
        /// </summary>
        /// <param name="labtobedone">The labtobedone.</param>
        /// <param name="orderbydate">The orderbydate.</param>
        /// <param name="orderby">The orderby.</param>
        /// <param name="appcurrentdate">The appcurrentdate.</param>
        /// <returns></returns>
        private static Boolean FieldValidation(string labtobedone, string orderbydate, string orderby, string appcurrentdate)
        {
            IIQCareSystem _iqcareSecurity = (IIQCareSystem)ObjectFactory.CreateInstance("BusinessProcess.Security.BIQCareSystem, BusinessProcess.Security");
            DateTime      _theCurrentDate = (DateTime)_iqcareSecurity.SystemDate();
            IQCareUtils   theUtils        = new IQCareUtils();

            Page page = HttpContext.Current.Handler as Page;

            if (orderby == "0")
            {
                MsgBuilder theMsg = new MsgBuilder();
                theMsg.DataElements["Control"] = "Ordered By";
                IQCareMsgBox.Show("BlankDropDown", theMsg, page);
                return(false);
            }
            else if (orderbydate == "")
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["Control"] = "Ordered By Date";
                IQCareMsgBox.Show("BlankTextBox", theBuilder, page);
                return(false);
            }
            else if (Convert.ToDateTime(orderbydate) > Convert.ToDateTime(appcurrentdate))
            {
                IQCareMsgBox.Show("OrderedToDate", page);
                return(false);
            }
            //----------

            if (labtobedone != "")
            {
                DateTime _theVisitDate = Convert.ToDateTime(theUtils.MakeDate(labtobedone));
                if (HttpContext.Current.Session["IEVisitDate"] != null)                                                   //ViewState["IEVisitDate"] != null)
                {
                    DateTime _theIEVisitDate = Convert.ToDateTime(HttpContext.Current.Session["IEVisitDate"].ToString()); //Convert.ToDateTime(ViewState["IEVisitDate"].ToString());
                    if (_theIEVisitDate > _theVisitDate)
                    {
                        IQCareMsgBox.Show("CompareLabTobeDoneDate", page);
                        return(false);
                    }
                }
            }

            return(true);
        }
Ejemplo n.º 4
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            if (Convert.ToInt32(ddlRegion.SelectedValue) <= 0)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["Control"] = lblfrom.Text;
                IQCareMsgBox.Show("BlankDropDown", theBuilder, this);
                ddlRegion.Focus();
                return;
            }

            if (Convert.ToInt32(ddDistrict.SelectedValue) <= 0)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["Control"] = lblto.Text;
                IQCareMsgBox.Show("BlankDropDown", theBuilder, this);
                ddDistrict.Focus();
                return;
            }

            btnSave.Enabled = true;
            DataTable theDT = (DataTable)ViewState["GrdData"];
            DataRow   theDR = theDT.NewRow();
            theDR[0] = Convert.ToInt32(ddlRegion.SelectedValue);
            theDR[1] = ddlRegion.SelectedItem.ToString();
            theDR[2] = Convert.ToInt32(ddDistrict.SelectedValue);
            theDR[3] = ddDistrict.SelectedItem.ToString();
            theDT.Rows.Add(theDR);
            IQCareUtils theUtils = new IQCareUtils();
            DataView    theDV    = new DataView(theDT);
            theDV.Sort           = theDT.Columns[3].ColumnName.ToString() + " asc";
            theDT                = (DataTable)theUtils.CreateTableFromDataView(theDV);
            ViewState["GrdData"] = theDT;
            Bind_Grid(theDT);
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
            return;
        }
    }
    private void GetMasters()
    {
        IDrugMst DrugManager;

        try
        {
            DataSet theDSXML = new DataSet();
            theDSXML.ReadXml(MapPath("..\\XMLFiles\\DrugMasters.con"));
            if (theDSXML.Tables["Mst_DrugType"] != null)                        //10Mar08 -- put conditios
            {
                theMasterDS.Tables.Add(theDSXML.Tables["Mst_DrugType"].Copy()); // table 0

                DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration");
                DataSet theDS = new DataSet();
                theDS = (DataSet)DrugManager.GetAllDropDowns();//pr_Admin_GetDrugDropDowns_Constella //all GenID,GenName,GenAbbr,DrugTypeID,DelFlag

                DataView  theDV;
                DataTable theDT;
                // incase of add OR Active
                if ((Request.QueryString["Status"] == null) || (Request.QueryString["Status"].ToString() == "Active"))
                {
                    theDV           = new DataView(theDS.Tables[0]);
                    theDV.RowFilter = "DeleteFlag=0";
                    theDT           = theDV.Table;
                    theMasterDS.Tables.Add(theDT.Copy());//get only active generics  // table 1
                }
                else if (Request.QueryString["Status"].ToString() == "InActive")
                {
                    theMasterDS.Tables.Add(theDS.Tables[0].Copy());              // get list of all generics // table 1
                }
                theMasterDS.Tables.Add(theDSXML.Tables["Mst_Strength"].Copy());  // table 2
                theMasterDS.Tables.Add(theDSXML.Tables["Mst_Frequency"].Copy()); // table 3
            }
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
        }
        finally
        {
            DrugManager = null;
        }
    }
Ejemplo n.º 6
0
        private Boolean FieldValidation(string labtobedone, string orderbydate, string orderby, string appcurrentdate)
        {
            IQCareUtils theUtils = new IQCareUtils();


            if (orderby == "0")
            {
                IQCareMsgBox.NotifyAction("Ordered by is not selected", "Field Validation", true, this, "javascript:HideModalPopup();return false;");
                return(false);
            }
            else if ((orderbydate != null && String.IsNullOrEmpty(orderbydate)))
            {
                IQCareMsgBox.NotifyAction("Order date is not specified", "Field Validation", true, this, "javascript:HideModalPopup();return false;");
                return(false);
            }
            else if (Convert.ToDateTime(orderbydate) > Convert.ToDateTime(appcurrentdate))
            {
                IQCareMsgBox.NotifyAction("Order date cannot be greater than todays date.", "Field Validation", true, this, "javascript:HideModalPopup();return false;");
                return(false);
            }
            else
            {
                DateTime dtRegDate = Convert.ToDateTime(((DataTable)Session["PatientInformation"]).Rows[0]["RegistrationDate"]);
                if (Convert.ToDateTime(orderbydate) < dtRegDate)
                {
                    IQCareMsgBox.NotifyAction("Order date cannot be less than registration date.", "Field Validation", true, this, "javascript:HideModalPopup();return false;");
                    return(false);
                }
            }
            if (!(labtobedone != null && String.IsNullOrEmpty(labtobedone)))
            {
                DateTime _theVisitDate = Convert.ToDateTime(theUtils.MakeDate(labtobedone));
                if (HttpContext.Current.Session["IEVisitDate"] != null)                                                   //ViewState["IEVisitDate"] != null)
                {
                    DateTime _theIEVisitDate = Convert.ToDateTime(HttpContext.Current.Session["IEVisitDate"].ToString()); //Convert.ToDateTime(ViewState["IEVisitDate"].ToString());
                    if (_theIEVisitDate > _theVisitDate)
                    {
                        IQCareMsgBox.NotifyAction("Lab to be done date cannot be less than the Patient Enrollment date.", "Field Validation", true, this, "javascript:HideModalPopup();return false;");
                        return(false);
                    }
                }
            }

            return(true);
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Session["PatientId"]       = 0;
                Session["TechnicalAreaId"] = 206;
                ViewState["Facility"]      = null;
                if (!IsPostBack)
                {
                    BindCombo();
                }
                ISCMReport objPODetails   = (ISCMReport)ObjectFactory.CreateInstance("BusinessProcess.SCM.BSCMReport, BusinessProcess.SCM");
                DataSet    theDTPODetails = objPODetails.PharmacyDashBoard(Convert.ToInt32(ddlStore.SelectedValue));

                //RadHtmlChart1.DataSource = theDTPODetails.Tables[0];
                //RadHtmlChart1.DataBind();

                RadHtmlChart2.DataSource = theDTPODetails.Tables[1];
                RadHtmlChart2.DataBind();

                //grdDrugsRunningOut.DataSource = theDTPODetails.Tables[2];
                //grdDrugsRunningOut.DataBind();
                resizeScreen();
                (Master.FindControl("pnlExtruder") as Panel).Visible        = false;
                (Master.FindControl("level2Navigation") as Control).Visible = true;
                //(Master.FindControl("levelTwoNavigationUserControl1").FindControl("lblformname") as Label).Text = "Pharmacy Dashboard";
                (Master.FindControl("levelTwoNavigationUserControl1").FindControl("patientLevelMenu") as Menu).Visible           = false;
                (Master.FindControl("levelTwoNavigationUserControl1").FindControl("PharmacyDispensingMenu") as Menu).Visible     = true;
                (Master.FindControl("levelTwoNavigationUserControl1").FindControl("UserControl_Alerts1") as UserControl).Visible = false;
                (Master.FindControl("levelTwoNavigationUserControl1").FindControl("PanelPatiInfo") as Panel).Visible             = false;

                //(Master.FindControl("facilityBanner") as Control).Visible = false;
                //(Master.FindControl("patientBanner") as Control).Visible = false;
                //(Master.FindControl("username1") as Control).Visible = false;
                //(Master.FindControl("currentdate1") as Control).Visible = false;
                //(Master.FindControl("facilityName") as Control).Visible = false;
                //(Master.FindControl("imageFlipLevel2") as Control).Visible = false;
            }
            catch (Exception ex)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = ex.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Page.IsPostBack != true)
                {
                    ViewState["CategoryId"] = 0;
                    //ViewState["TableName"] = Request.QueryString["TableName"].ToString();
                    if (Request.QueryString["TableName"].ToString() == "PreDefinedFields")
                    {
                        ViewState["TableName"] = "ModDeCode";
                    }
                    else
                    {
                        ViewState["TableName"] = Request.QueryString["TableName"].ToString();
                    }
                    if (Request.QueryString["CategoryId"].ToString() != "")
                    {
                        ViewState["CategoryId"] = Convert.ToInt32(Request.QueryString["CategoryId"]);
                    }
                    if (Request.QueryString["ModId"].ToString() != "")
                    {
                        ViewState["ModuleId"] = Convert.ToInt32(Request.QueryString["ModId"]);
                    }
                    ViewState["ListName"] = Request.QueryString["LstName"].ToString();
                    ViewState["FID"]      = Request.QueryString["Fid"].ToString();
                    ViewState["Update"]   = Request.QueryString["Upd"].ToString();
                    //    (Master.FindControl("lblMark") as Label).Visible = true;
                    //(Master.FindControl("lblRoot") as Label).Text = " » Customize Lists";
                    //(Master.FindControl("lblMark") as Label).Text = "";
                    //(Master.FindControl("lblMark") as Label).Visible = false;
                    //(Master.FindControl("lblheader") as Label).Text = ViewState["ListName"].ToString();
                    (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text   = "Customize Lists >> ";
                    (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = ViewState["ListName"].ToString();

                    Init_Form();
                }
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
            }
        }
    private void FillOldData(Int32 PatID)
    {
        DataSet       dsvalues = null;
        ICustomFields CustomFields;

        try
        {
            DataSet theCustomFields = (DataSet)ViewState["CustomFieldsDS"];
            string  theTblName      = "";
            if (theCustomFields.Tables[0].Rows.Count > 0)
            {
                theTblName = theCustomFields.Tables[0].Rows[0]["FeatureName"].ToString().Replace(" ", "_");
            }
            string theColName = "";
            foreach (DataRow theDR in theCustomFields.Tables[0].Rows)
            {
                if (theDR["ControlId"].ToString() != "9")
                {
                    if (theColName == "")
                    {
                        theColName = theDR["Label"].ToString();
                    }
                    else
                    {
                        theColName = theColName + "," + theDR["Label"].ToString();
                    }
                }
            }

            CustomFields = (ICustomFields)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomFields, BusinessProcess.Administration");
            dsvalues     = CustomFields.GetCustomFieldValues("dtl_CustomField_" + theTblName.ToString().Replace("-", "_"), theColName, Convert.ToInt32(PatID.ToString()), 0, Convert.ToInt32(ViewState["visitPk"]), 0, 0, Convert.ToInt32(ApplicationAccess.PMTCTEnrollment));
            CustomFieldClinical theCustomManager = new CustomFieldClinical();
            theCustomManager.FillCustomFieldData(theCustomFields, dsvalues, pnlCustomList, "PMTCTEnroll");
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
        }
        finally
        {
            CustomFields = null;
        }
    }
Ejemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "")
        {
            IQCareMsgBox.Show("SessionExpired", this);
            Response.Redirect("~/frmlogin.aspx", true);
        }
        Session["PatientId"] = 0;

        //(Master.FindControl("lblheader") as Label).Text = "User Administration";
        //(Master.FindControl("lblMark") as Label).Visible = false;
        (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Visible = false;
        (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text  = "User Administration";
        if (Page.IsPostBack == false)
        {
            Init_Form();
        }
    }
Ejemplo n.º 11
0
 protected void btnCalculate_ServerClick(object sender, EventArgs e)
 {
     if (txtAge.Text.Trim() == "")
     {
         MsgBuilder theBuilder = new MsgBuilder();
         theBuilder.DataElements["Control"] = "Age";
         IQCareMsgBox.Show("BlankTextBox", theBuilder, this);
         txtAge.Focus();
     }
     else
     {
         DateTime theregdt = Convert.ToDateTime(ViewState["regDate"].ToString());
         DateTime theSysdt = Convert.ToDateTime(Application["AppCurrentDate"].ToString());
         double   Regyear  = theregdt.Year - Math.Round(Convert.ToDouble(txtAge.Text));
         txtDOB.Text     = ViewState["regDate"].ToString().Substring(0, 7) + Regyear.ToString();
         txtRegAge.Value = Convert.ToString(theSysdt.Year - Convert.ToInt32(txtDOB.Text.Substring(7, 4)));
     }
 }
Ejemplo n.º 12
0
 public void BindGrid(DataTable dt)
 {
     try
     {
         if (dt.Rows.Count > 0)
         {
             grdChildInfo.DataSource = null;
             grdChildInfo.DataSource = dt;
             grdChildInfo.DataBind();
         }
     }
     catch (Exception err)
     {
         MsgBuilder theBuilder = new MsgBuilder();
         theBuilder.DataElements["MessageText"] = err.Message.ToString();
         IQCareMsgBox.Show("#C1", theBuilder, this);
     }
 }
Ejemplo n.º 13
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (FieldValidation() == false)
        {
            return;
        }

        if (GetPassWord_Data() == false)
        {
            return;
        }
        else
        {
            IQCareMsgBox.Show("UpdateMessage", this);

            Response.Redirect("~/frmlogin.aspx", true);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "")
        {
            IQCareMsgBox.Show("SessionExpired", this);
            Response.Redirect("~/frmlogin.aspx", true);
        }
        if (!Page.IsPostBack)
        {
            Session["PatientId"] = 0;
            BindGrid();
        }
        //(Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Visible = false;
        //(Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = "Customize Lists";
        IQWebUtils Utils = new IQWebUtils();

        Utils.HidePatientLevelheader();
    }
Ejemplo n.º 15
0
        private Boolean FieldValidation()
        {
            MsgBuilder theBuilder = new MsgBuilder();


            if (txtAdd.Text == "")
            {
                if (ViewState["Type"].ToString() == "Schedule")
                {
                    theBuilder.DataElements["Control"] = "Schedule Name";
                }
                IQCareMsgBox.Show("BlankTextBox", theBuilder, this);
                txtAdd.Focus();
                return(false);
            }

            return(true);
        }
Ejemplo n.º 16
0
 protected void gridlabMaster_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         if (e.CommandName == "RemoveFromGroup")
         {
             int testId = Int32.Parse(e.CommandArgument.ToString());
             mGr.RemoveTestFromGroup(testId, this.MainLabTestId);
             IQCareMsgBox.NotifyAction("Lab test has been removed from this group", "Success", false, this, "");
             this.PopulateLabTest();
             return;
         }
     }
     catch (Exception ex)
     {
         this.ShowErrorMessage(ref ex);
     }
 }
Ejemplo n.º 17
0
 protected void Page_Init(object sender, EventArgs e)
 {
     if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "")
     {
         IQCareMsgBox.Show("SessionExpired", this);
         Response.Redirect("~/frmlogin.aspx", true);
     }
     ////RTyagi..19Feb 07..
     ///***************** Check For User Rights ****************/
     //AuthenticationManager Authentiaction = new AuthenticationManager();
     //if (Request.QueryString["name"] == "Delete")
     //{
     //    if (Authentiaction.HasFunctionRight(ApplicationAccess.DeletePatient, FunctionAccess.Delete, (DataTable)Session["UserRight"]) == false)
     //    {
     //        btndelete.Enabled = false;
     //    }
     //}
 }
    protected void grdPClassification_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        System.Data.DataTable theDT = new System.Data.DataTable();
        theDT = ((DataTable)Session["GridData"]);
        int theRow = Convert.ToInt32(e.RowIndex);

        PatientClassificationMgr = (IPatientClassification)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientClassification, BusinessProcess.Clinical");
        PatientClassificationMgr.DeletePatientClassification(Convert.ToInt32(Session["Ptn_Pk"]), Convert.ToInt32(ViewState["ARTSponsorID"]), Convert.ToDateTime(ViewState["VisitDate"]));
        theDT.Rows[theRow].Delete();
        theDT.AcceptChanges();
        Session["GridData"] = theDT;
        grdPClassification.Columns.Clear();
        grdPClassification.DataSource = (DataTable)Session["GridData"];
        BindGrid();
        IQCareMsgBox.Show("DeleteSuccess", this);
        Refresh();
        btnadd.Text = "Add";
    }
Ejemplo n.º 19
0
    protected void GrdUserList_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        int thePage     = GrdUserList.PageIndex;
        int thePageSize = GrdUserList.PageSize;

        GridViewRow theRow = GrdUserList.Rows[e.NewSelectedIndex];

        if (theRow.Cells[3].Text.ToString() != "InActive")
        {
            int    UserId = Convert.ToInt32(theRow.Cells[4].Text.ToString());
            string theUrl = string.Format("{0}?SelectedUserId={1}", "frmadmin_adduser.aspx", UserId);
            Response.Redirect(theUrl);
        }
        else
        {
            IQCareMsgBox.Show("UserListInactiveSelect", this);
        }
    }
        /// <summary>
        /// Deletes the patient.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void DeleteSelectedPatient(object sender, EventArgs e)
        {
            IDeletePatient FormManager;

            FormManager = (IDeletePatient)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDeletePatient, BusinessProcess.Administration");
            int theResultRow = FormManager.DeletePatient(this.PatientId, this.UserId);

            if (theResultRow == 0)
            {
                string errorMessage = IQCareMsgBox.GetMessage("DeletePatientError", this);
                this.NotifyAction(errorMessage, "Patient Delete Error", true, string.Format("javascript:return false;", "../frmFacilityHome.aspx"));
            }
            else
            {
                string strResponse = labelDeleteText.Text.Replace("Delete all records for ", "") + " has been deleted successfully";
                this.NotifyAction(strResponse, "Patient Delete", false, string.Format("javascript:window.location='{0}'; return false;", "../frmFacilityHome.aspx"));
            }
        }
Ejemplo n.º 21
0
        private void ExportToCSV(string theQuery)
        {
            try
            {
                DataView theDV = new DataView();
                theDV = ManipulateData(theQuery.ToString());

                DataTable theDT = new DataTable();
                theDT = theDV.ToTable();

                StringBuilder str = new StringBuilder();
                for (int i = 0; i < theDT.Columns.Count; i++)
                {
                    str.Append(theDT.Columns[i].ColumnName.ToString());
                    str.Append(",");
                }
                str.Append("\n");
                str.Append("\n");

                for (int i = 0; i <= theDT.Rows.Count - 1; i++)
                {
                    for (int j = 0; j <= theDT.Columns.Count - 1; j++)
                    {
                        str.Append(theDT.Rows[i][j].ToString());
                        str.Append(",");
                    }
                    str.Append("\n");
                }

                Response.Clear();
                Response.AddHeader("content-disposition", "attachment;filename=Export.csv");
                Response.Charset = "";
                Response.Cache.SetCacheability(HttpCacheability.NoCache);
                Response.ContentType = "application/vnd.csv";
                System.IO.StringWriter       stringWrite = new System.IO.StringWriter();
                System.Web.UI.HtmlTextWriter htmlWrite   = new HtmlTextWriter(stringWrite);
                Response.Write(str.ToString());
                Response.End();
            }
            catch
            {
                IQCareMsgBox.Show("TooManyRec", this);
            }
        }
Ejemplo n.º 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            IDrugMst DrugManager;

            try
            {
                DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration");
                if (IsPostBack != true)
                {
                    ViewState["Type"]     = Request.QueryString["Type"].ToString();
                    ViewState["DrugType"] = Request.QueryString["DrugType"].ToString();
                    ViewState["DrugData"] = (DataTable)Session["DrugScheduleData"];
                    if (Session["SelectedScheduleData"] != null)
                    {
                        ViewState["SelectedData"] = (DataTable)Session["SelectedScheduleData"];
                    }
                    Session.Remove("DrugScheduleData");
                    Session.Remove("SelectedScheduleData");

                    Init_Form();
                }

                if (ViewState["Type"] != null)
                {
                    if (ViewState["Type"].ToString() == "Schedule")
                    {
                        lblHeader.Text = "Drug Schedule Mapping";
                    }

                    lstAvailable.Focus();
                }
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
                return;
            }
            finally
            {
                DrugManager = null;
            }
        }
Ejemplo n.º 23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "")
        {
            IQCareMsgBox.Show("SessionExpired", this);
            Response.Redirect("~/frmlogin.aspx", true);
        }
        ILabMst LabManager;

        try
        {
            if (!IsPostBack)
            {
                //(Master.FindControl("lblRoot") as Label).Text = " » Customize Lists";
                //(Master.FindControl("lblMark") as Label).Visible = false;
                //(Master.FindControl("lblheader") as Label).Text = "Laboratory";
                //(Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text = "Customize Lists >> ";
                //(Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = "Laboratory";
                LabManager = (ILabMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BLabMst, BusinessProcess.Administration");
                DataSet theDS = LabManager.GetLabs();
                this.grdLab.DataSource = theDS.Tables[0];
                this.grdLab.DataBind();
                ViewState["gridSortDirection"] = "Desc";
                ViewState["FID"] = Request.QueryString["Fid"].ToString();
                if (ViewState["grdDataSource"] == null)
                {
                    ViewState["grdDataSource"] = theDS.Tables[0];
                }
                ViewState["SortDirection"] = "Desc";
                BindGrid();
            }
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
            return;
        }
        finally
        {
            LabManager = null;
        }
    }
Ejemplo n.º 24
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (FieldValidation() == false)
        {
            return;
        }
        IDesignation DesignationManager;

        try
        {
            if (Request.QueryString["name"] == "Add")
            {
                DesignationManager = (IDesignation)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDesignation, BusinessProcess.Administration");
                int DesignationId = DesignationManager.SaveNewDesignation(txtDesignationName.Text, 1, Convert.ToInt32(txtSeq.Text));
                if (DesignationId == 0)
                {
                    IQCareMsgBox.Show("DesignationExists", this);
                    return;
                }
                else
                {
                    IQCareMsgBox.Show("DesignationSave", this);
                    clear_fields();
                }
            }
            else if (Request.QueryString["name"] == "Edit")
            {
                DesignationManager = (IDesignation)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDesignation, BusinessProcess.Administration");
                int DesignationId = DesignationManager.UpdateDesignation(Convert.ToInt32(Request.QueryString["designationid"]), txtDesignationName.Text, 1, Convert.ToInt32(this.ddStatus.SelectedValue), Convert.ToInt32(txtSeq.Text));
                IQCareMsgBox.Show("DesignationUpdate", this);
            }
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
            return;
        }
        finally
        {
            DesignationManager = null;
        }
    }
Ejemplo n.º 25
0
 protected void buttonSave_Click(object sender, EventArgs e)
 {
     try
     {
         string testName = textLabName.Text.Trim();
         string testRef  = textReference.Text;
         if (testRef == "")
         {
             textLabName.Text.Trim().ToUpper().Replace(' ', '_');
         }
         bool           isGroup    = chkGroupYes.Checked;
         TestDepartment department = null;
         if (!isGroup)
         {
             if (ddlDepartment.SelectedValue == "-1")
             {
                 throw new Exception("Please select department");
             }
             department = new TestDepartment()
             {
                 Id = Convert.ToInt32(ddlDepartment.SelectedValue), Name = ddlDepartment.SelectedItem.Text
             };
         }
         LabTest test = new LabTest()
         {
             Id            = -1,
             Name          = testName,
             ReferenceId   = testRef,
             IsGroup       = isGroup,
             DeleteFlag    = false,
             Department    = department,
             LoincCode     = txtLoinc.Text.Trim(),
             UserId        = this.UserId,
             TestParameter = null
         };
         LabTest result = mGr.SaveLabTest(test, this.UserId);
         this.PopulateLabTests();
         IQCareMsgBox.NotifyAction("Lab " + result.Name + " successfully saved", "Success", false, this, "javascript:HideModalPopup();return false;");
     }
     catch (Exception ex)
     {
         this.ShowErrorMessage(ref ex);
     }
 }
Ejemplo n.º 26
0
    private void fill_dropdowns()
    {
        try
        {
            Iuser CmbManager;
            CmbManager = (Iuser)ObjectFactory.CreateInstance("BusinessProcess.Administration.BUser,BusinessProcess.Administration");
            DataSet theDS = CmbManager.FillDropDowns();
            CmbManager = null;

            //// User Groups List
            BindFunctions GblCls = new BindFunctions();
            GblCls.BindCheckedList(lstUsergroup, theDS.Tables[0], "groupname", "groupid");

            //Stores list
            IQCareUtils theUtils = new IQCareUtils();
            DataTable   dt       = new DataTable();
            DataSet     theXMLDS = new DataSet();
            theXMLDS.ReadXml(Server.MapPath("..\\XMLFiles\\AllMasters.con"));
            DataView theDV = new DataView(theXMLDS.Tables["mst_Store"]);
            theDV.RowFilter = "DeleteFlag=0";
            if (theDV.Table != null)
            {
                dt = theUtils.CreateTableFromDataView(theDV);
            }
            GblCls.BindCheckedList(chklistStores, dt, "Name", "Id");
            //Designation
            DataTable dtdesig = new DataTable();
            theDV           = new DataView(theXMLDS.Tables["Mst_Designation"]);
            theDV.RowFilter = "DeleteFlag=0";
            if (theDV.Table != null)
            {
                dt = theUtils.CreateTableFromDataView(theDV);
            }
            GblCls.BindCombo(dddesignation, dt, "Name", "Id");
            //GblCls.BindCombo(ddEmployee,dt,"EmployeeName","EmployeeId");
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
        }
    }
Ejemplo n.º 27
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Ajax.Utility.RegisterTypeForAjax(typeof(frmLogin));
         if (Page.IsPostBack != true)
         {
             Thread theThread = new Thread(new ParameterizedThreadStart(IQCareUtils.GenerateCache));
             theThread.Start(false);
             Init_Form();
         }
     }
     catch (Exception err)
     {
         MsgBuilder theBuilder = new MsgBuilder();
         theBuilder.DataElements["MessageText"] = err.Message.ToString();
         IQCareMsgBox.Show("#C1", theBuilder, this);
     }
 }
Ejemplo n.º 28
0
 private bool ValidateLogin()
 {
     if (txtuname.Text.Trim() == "")
     {
         IQCareMsgBox.Show("BlankUserName", this);
         return(false);
     }
     if (txtpassword.Text.Trim() == "")
     {
         IQCareMsgBox.Show("BlankPassword", this);
         return(false);
     }
     if (Convert.ToInt32(ddLocation.SelectedValue) < 1)
     {
         IQCareMsgBox.Show("BlankLocation", this);
         return(false);
     }
     return(true);
 }
Ejemplo n.º 29
0
 protected override void OnInit(EventArgs e)
 {
     try
     {
         base.OnInit(e);
         if (Request.QueryString["mod"] == "0")
         {
             FindPatient.IncludeEnrollement = true;
         }
         else
         {
             FindPatient.IncludeEnrollement = false;
             if (Request.QueryString["mod"] != "")
             {
                 FindPatient.SelectedServiceLine = int.Parse(Request.QueryString["mod"]);
             }
         }
         FindPatient.SelectedPatientChanged += new CommandEventHandler(FindPatient_SelectedPatientChanged);
     }
     catch (Exception ex)
     {
         CLogger.WriteLog(ELogLevel.ERROR, ex.ToString());
         if (Session["PatientId"] == null || Convert.ToInt32(Session["PatientId"]) != 0)
         {
             IQCareMsgBox.NotifyAction("Application has an issue, Please contact Administrator!", "Application Error", true, this, "window.location.href='../frmFindAddCustom.aspx?srvNm=" + Session["TechnicalAreaName"] + "&mod=0'");
             //Response.Write("<script>alert('Application has an issue, Please contact Administrator!') ; window.location.href='../frmFindAddCustom.aspx?srvNm=" + Session["TechnicalAreaName"] + "&mod=0'</script>");
         }
         else
         {
             if (Session["TechnicalAreaId"] != null || Convert.ToInt16(Session["TechnicalAreaId"]) != 0)
             {
                 IQCareMsgBox.NotifyAction("Application has an issue, Please contact Administrator!", "Application Error", true, this, "window.location.href='../frmFacilityHome.aspx';");
                 //Response.Write("<script>alert('Application has an issue, Please contact Administrator!') ; window.location.href='../frmFacilityHome.aspx'</script>");
             }
             else
             {
                 IQCareMsgBox.NotifyAction("Application has an issue, Please contact Administrator!", "Application Error", true, this, "window.location.href='../frmLogin.aspx';");
                 //Response.Write("<script>alert('Application has an issue, Please contact Administrator!') ; window.location.href='../frmLogin.aspx'</script>");
             }
         }
         ex = null;
     }
 }
Ejemplo n.º 30
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        if (((DataTable)Session["GridData"]).Rows.Count < 1)
        {
            IQCareMsgBox.Show("PharmacyNoData", this);
            return;
        }

        int      Id, Ptn_pk = 0, CouncellingTypeId, CouncellingTopicId, UserId, DeleteFlag, Visit_pk, LocationID;
        string   Comments, OtherDetail;
        DateTime VisitDate;

        FollowupEducation = (IFollowupEducation)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BFollowupEducation, BusinessProcess.Clinical");
        DataTable theDT = (DataTable)Session["GridData"];

        foreach (DataRow theDR in theDT.Rows)
        {
            if (theDR["Id"] == DBNull.Value)
            {
                Id = -1;
            }
            else
            {
                Id = Convert.ToInt32(theDR["Id"]);
            }
            IQCareUtils theUtils = new IQCareUtils();
            Ptn_pk             = Convert.ToInt32(Session["Ptn_Pk"]);
            CouncellingTypeId  = Convert.ToInt32(theDR["CouncellingTypeId"]);
            CouncellingTopicId = Convert.ToInt32(theDR["CouncellingTopicId"]);
            LocationID         = Convert.ToInt32(Session["AppLocationId"]);
            UserId             = Convert.ToInt32(Session["AppUserId"]);
            DeleteFlag         = 0;
            Comments           = theDR["Comments"].ToString();
            OtherDetail        = theDR["OtherDetail"].ToString();
            VisitDate          = Convert.ToDateTime(theDR["VisitDate"]);
            Visit_pk           = Convert.ToInt32(theDR["Visit_pk"]);

            FollowupEducation.SaveFollowupEducation(Id, Ptn_pk, CouncellingTypeId, CouncellingTopicId, Visit_pk, LocationID, VisitDate, Comments, OtherDetail, UserId, DeleteFlag);
        }

        ClearSession();
        SaveCancel();
    }