コード例 #1
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";


                ViewState["TableName"]  = Request.QueryString["TableName"].ToString();
                ViewState["CategoryId"] = Request.QueryString["CategoryId"].ToString();
                ViewState["ListName"]   = Request.QueryString["LstName"].ToString();

                ViewState["Update"]   = Request.QueryString["Upd"].ToString();
                ViewState["CCID"]     = Request.QueryString["CCID"].ToString();
                ViewState["ModuleId"] = Convert.ToInt32(Request.QueryString["ModId"]);

                (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text   = "Customize Lists >> ";
                (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = "Laboratory";
                ViewState["FID"] = Request.QueryString["Fid"].ToString();
                LabManager       = (ILabMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BLabMst, BusinessProcess.Administration");
                //DataSet theDS = LabManager.GetLabs();
                DataSet theDS = LabManager.GetLabTestList();//pr_Admin_GetLabTestList_Constella
                this.grdLab.DataSource = theDS.Tables[0];
                this.grdLab.DataBind();
                ViewState["gridSortDirection"] = "Desc";
                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
        {
            LabManager = null;
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        /////////////////////////////////////////////////////////////////////
        // Code Written By   : Pankaj Kumar
        // Written Date      : 25th July 2006
        // Modify Date       : Rakhi Tyagi
        // Modification Date : 22 Feb 2007
        // Modify Date       : Rupesh Pathak
        // Modification Date : 19 Nov 2007
        // Description       : Lab test List
        //
        /// /////////////////////////////////////////////////////////////////
        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";
                ViewState["FID"] = Request.QueryString["Fid"].ToString();
                LabManager       = (ILabMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BLabMst, BusinessProcess.Administration");
                //DataSet theDS = LabManager.GetLabs();
                DataSet theDS = LabManager.GetLabTestList();//pr_Admin_GetLabTestList_Constella
                this.grdLab.DataSource = theDS.Tables[0];
                this.grdLab.DataBind();
                ViewState["gridSortDirection"] = "Desc";
                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
        {
            LabManager = null;
        }
    }