示例#1
0
        /////////////////////////////////////////////////////////////////////
        // Code Written By   : Sanjay Rana
        // Written Date      : 25th July 2006
        // Modification Date :
        // Description       : Drug List
        //
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        //

        protected void Page_Load(object sender, EventArgs e)
        {
            IDrugMst DrugManager;

            try
            {
                if (!IsPostBack)
                {
                    (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text   = "Customize Lists >> ";
                    (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = "Drugs";

                    DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration");
                    //pr_Admin_SelectDrug_Constella
                    DataSet theDS = DrugManager.GetDrug();
                    MakeDrugList(theDS);
                }
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
                return;
            }
            finally
            {
                DrugManager = null;
            }
        }
    /////////////////////////////////////////////////////////////////////
    // Code Written By   : Sanjay Rana
    // Written Date      : 25th July 2006
    // Modification Date :
    // Description       : Drug List
    //
    /// /////////////////////////////////////////////////////////////////


    protected void Page_Load(object sender, EventArgs e)
    {
        IDrugMst DrugManager;

        try
        {
            if (!IsPostBack)
            {
                //(Master.FindControl("lblRoot") as Label).Text = " » Customize Lists";
                //(Master.FindControl("lblMark") as Label).Visible = false;
                //(Master.FindControl("lblheader") as Label).Text = "Drugs";
                (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text   = "Customize Lists >> ";
                (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = "Drugs";

                DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration");
                //pr_Admin_SelectDrug_Constella
                DataSet theDS = DrugManager.GetDrug();
                MakeDrugList(theDS);//11Mar08
                //--------- 11Mar08---------
                //string theStr;
                //foreach (DataRow theDR in theDS.Tables[0].Rows)
                //{
                //    theStr = theDR["DrugGeneric"].ToString();
                //    if (theStr.IndexOf("/") != -1)
                //        theStr = theStr.Replace("/", "/ ");
                //    theDR["DrugGeneric"] = theStr;

                //    theStr = theDR["GenericAbbv"].ToString();
                //    if (theStr.IndexOf("/") != -1)
                //        theStr = theStr.Replace("/", "/ ");
                //    theDR["GenericAbbv"] = theStr;

                //}
                //grdMasterDrugs.DataSource = theDS.Tables[0];
                //BindGrid();
                //--------------------------
            }
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
            return;
        }
        finally
        {
            DrugManager = 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);
        }
        IDrugMst DrugManager;

        try
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["Fid"]))
                {
                    ViewState["FID"] = Request.QueryString["Fid"].ToString();
                }

                DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration");
                DataSet theDS = DrugManager.GetDrug(0);
                MakeDrugList(theDS);

                AuthenticationManager Authentication = new AuthenticationManager();
                if (Authentication.HasFunctionRight(22, 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
        {
            DrugManager = null;
        }
    }
示例#4
0
    private void Init_Page()
    {
        DataTable dt = new DataTable();

        if (Page.IsPostBack != true)
        {
            GetMasters();
            FillDropDowns();

            if (Request.QueryString["name"] == "Add")
            {
                lblH2.Text             = "Add Drug";
                Session["ExistDrugId"] = 0;
            }

            else if (Request.QueryString["name"] == "Edit")
            {
                IDrugMst      DrugManager;
                BindFunctions BindManager = new BindFunctions();
                lblH2.Text = "Edit Drug";
                int drug_pk = Convert.ToInt32(Request.QueryString["DrugId"]);
                Session["ExistDrugId"] = drug_pk;

                DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration");
                DataSet theDS = DrugManager.GetDrug(drug_pk);
                dt = theDS.Tables[0];

                ddlDrugType.SelectedValue       = dt.Rows[0]["DrugTypeId"].ToString();
                txtDrugName.Text                = dt.Rows[0]["DrugName"].ToString();
                txtDrugAbbre.Text               = dt.Rows[0]["GenericAbbrevation"].ToString();
                ddlPurchaseUnit.SelectedValue   = dt.Rows[0]["PurchaseUnit"].ToString();
                txtPurchaseUnitQty.Text         = dt.Rows[0]["QtyPerPurchaseUnit"].ToString();
                ddlDispensingUnit.SelectedValue = dt.Rows[0]["DispensingUnit"].ToString();
                ddlIsSyrup.SelectedValue        = dt.Rows[0]["Syrup"].ToString();
                ddStatus.Text = dt.Rows[0]["Status"].ToString();
            }
        }
    }
示例#5
0
    /////////////////////////////////////////////////////////////////////
    // Code Written By   : Sanjay Rana
    // Written Date      : 25th July 2006
    // Modification Date :
    // Description       : Drug List
    //
    /// /////////////////////////////////////////////////////////////////


    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);
        }
        IDrugMst DrugManager;

        try
        {
            if (!IsPostBack)
            {
                //(Master.FindControl("lblRoot") as Label).Text = " » Customize Lists";
                //(Master.FindControl("lblMark") as Label).Visible = false;
                //(Master.FindControl("lblheader") as Label).Text = "Drugs";
                //(Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text = "Customize Lists >> ";
                //(Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = "Drugs";

                //checking the NULL condition, if user close the page without doing anything......
                //ViewState["FID"] = Request.QueryString["Fid"].ToString(); commented on 23 Jan 2014
                if (!string.IsNullOrEmpty(Request.QueryString["Fid"]))
                {
                    ViewState["FID"] = Request.QueryString["Fid"].ToString();
                }


                DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration");
                //pr_Admin_SelectDrug_Constella
                DataSet theDS = DrugManager.GetDrug();
                MakeDrugList(theDS);//11Mar08
                //--------- 11Mar08---------
                //string theStr;
                //foreach (DataRow theDR in theDS.Tables[0].Rows)
                //{
                //    theStr = theDR["DrugGeneric"].ToString();
                //    if (theStr.IndexOf("/") != -1)
                //        theStr = theStr.Replace("/", "/ ");
                //    theDR["DrugGeneric"] = theStr;

                //    theStr = theDR["GenericAbbv"].ToString();
                //    if (theStr.IndexOf("/") != -1)
                //        theStr = theStr.Replace("/", "/ ");
                //    theDR["GenericAbbv"] = theStr;

                //}
                //grdMasterDrugs.DataSource = theDS.Tables[0];
                //BindGrid();
                //--------------------------
                AuthenticationManager Authentication = new AuthenticationManager();
                if (Authentication.HasFunctionRight(22, FunctionAccess.Add, (DataTable)Session["UserRight"]) == false)
                {
                    btnAdd.Enabled = false;
                }
                //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
        {
            DrugManager = null;
        }
    }