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 (this.IsPostBack != true)
     {
         ViewState["ListName"] = Request.QueryString["LstName"].ToString();
         if (Request.QueryString["TableName"] == "PreDefinedDruglist")
         {
             DataSet    thePharmacyDS = new DataSet();
             IPediatric PediatricManager;
             PediatricManager    = (IPediatric)ObjectFactory.CreateInstance("BusinessProcess.Pharmacy.BPediatric, BusinessProcess.Pharmacy");
             thePharmacyDS       = PediatricManager.GetPediatricFields(1);
             Session["DrugData"] = thePharmacyDS.Tables[0];
             BindList();
         }
         if (Request.QueryString["TableName"] == "PreDefinedLablist")
         {
             lblHeader.Text = "Predefined Lab List";
             DataSet       theLabDS = new DataSet();
             ILabFunctions LabManager;
             LabManager          = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory");
             theLabDS            = LabManager.GetLabs();
             Session["DrugData"] = theLabDS.Tables[0];
             BindLabList();
         }
     }
 }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            IPediatric PediatricManager;

            PediatricManager = (IPediatric)ObjectFactory.CreateInstance("BusinessProcess.Pharmacy.BPediatric, BusinessProcess.Pharmacy");
            DataTable dtsave = CreateSaveTable();
            int       i      = 1;

            foreach (ListItem item in lstSelectedDrug.Items)
            {
                DataRow theDR;
                int     idx = lstSelectedDrug.Items.IndexOf(item);
                theDR = dtsave.NewRow();
                string str = item.Text;
                theDR[0]          = item.Value;
                theDR[1]          = idx + 1;
                theDR["SystemId"] = Convert.ToInt32(Session["SystemId"]);
                dtsave.Rows.Add(theDR);
                i++;
            }

            if (dtsave.Rows.Count > -1)
            {
                PediatricManager.SavePredefineList(Request.QueryString["TableName"].ToString(), dtsave, Convert.ToInt32(Session["AppUserId"]));
            }
            MsgBuilder theBuilder = new MsgBuilder();

            theBuilder.DataElements["Name"] = ViewState["ListName"].ToString();
            IQCareMsgBox.Show("CustomMasterSave", theBuilder, this);
            Cancel();
        }
Exemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.IsPostBack != true)
     {
         ViewState["ListName"] = Request.QueryString["LstName"].ToString();
         if (Request.QueryString["TableName"] == "PreDefinedDruglist")
         {
             DataSet    thePharmacyDS = new DataSet();
             IPediatric PediatricManager;
             PediatricManager    = (IPediatric)ObjectFactory.CreateInstance("BusinessProcess.Pharmacy.BPediatric, BusinessProcess.Pharmacy");
             thePharmacyDS       = PediatricManager.GetPediatricFields(1);
             Session["DrugData"] = thePharmacyDS.Tables[0];
             BindList();
         }
         if (Request.QueryString["TableName"] == "PreDefinedLablist")
         {
             lblHeader.Text = "Predefined Lab List";
             DataSet       theLabDS = new DataSet();
             ILabFunctions LabManager;
             LabManager          = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory");
             theLabDS            = LabManager.GetLabs();
             Session["DrugData"] = theLabDS.Tables[0];
             BindLabList();
         }
     }
 }
        public void BindPharmacyHistoryData()
        {
            IPediatric PediatricManager;

            PediatricManager = (IPediatric)ObjectFactory.CreateInstance("BusinessProcess.Pharmacy.BPediatric, BusinessProcess.Pharmacy");
            dsHistory        = PediatricManager.IQTouchGetPharmacyDetails(Convert.ToInt32(Request.QueryString["PatientID"]));
            rgviewpharmacyform.DataSource = dsHistory.Tables[0];
        }
Exemplo n.º 5
0
        public void BindMasterTable()
        {
            IPediatric PediatricManager;

            PediatricManager      = (IPediatric)ObjectFactory.CreateInstance("BusinessProcess.Pharmacy.BPediatric, BusinessProcess.Pharmacy");
            theDS                 = PediatricManager.GetPediatricFields(Convert.ToInt32("1"));
            Session["MasterData"] = theDS;
            Session["Frequency"]  = theDS.Tables[8];
            Session["Batch"]      = theDS.Tables[32];
        }
        public void BindList()
        {
            IQCareUtils   theUtils = new IQCareUtils();
            BindFunctions theBind  = new BindFunctions();
            DataView      theDV;

            theDV = new DataView((DataTable)Session["DrugData"]);
            DataTable theDT = theUtils.CreateTableFromDataView(theDV);

            if (theDT != null)
            {
                DataView theDV1 = new DataView(theDT);
                theDV1.Sort = "DrugName Asc";
                theDT       = theUtils.CreateTableFromDataView(theDV1);
            }
            if (theDT != null)
            {
                Session["DrugTable"] = theDT;
                theBind.BindList(lstDrugList, theDT, "DrugName", "drug_pk");
            }



            DataSet    thePharmacyDS = new DataSet();
            IPediatric PediatricManager;

            PediatricManager = (IPediatric)ObjectFactory.CreateInstance("BusinessProcess.Pharmacy.BPediatric, BusinessProcess.Pharmacy");
            thePharmacyDS    = PediatricManager.GetPreDefinedDruglist();
            if (thePharmacyDS.Tables[0].Rows.Count > 0)
            {
                Session["SelectedData"] = thePharmacyDS.Tables[0];
                theBind.BindList(lstSelectedDrug, thePharmacyDS.Tables[0], "DrugName", "drug_pk");
                DataTable theDT1 = (DataTable)Session["DrugTable"];
                foreach (DataRow r in thePharmacyDS.Tables[0].Rows)
                {
                    DataRow[] theDR1 = theDT1.Select("drug_pk=" + r[0].ToString());
                    if (theDR1.Length > 0)
                    {
                        theDT1.Rows.Remove(theDR1[0]);
                    }
                }
                Session["DrugTable"] = theDT1;
                lstDrugList.Items.Clear();
                theBind.BindList(lstDrugList, theDT1, "DrugName", "drug_pk");
            }
            else
            {
                Session["SelectedData"] = CreateSelectedTable();
            }
        }