Example #1
0
        public static object LoadCoded788(string sCodeID, string JMBookingID, string Drug, string sJurisID)
        {
            IDataReader objReader = new TableDB().TableWhere(KPIHlp.CVI32(sJurisID), KPIHlp.CVI32(sCodeID), string.Empty, String.Empty, JMBookingID, Drug);
            DataSet     DSCoded   = new DataSet();

            DSCoded.Tables.Add();
            DSCoded.Load(objReader, LoadOption.PreserveChanges, DSCoded.Tables[0]);
            if (objReader != null && !objReader.IsClosed)
            {
                objReader.Close();
            }

            List <Coded> LstCoded = null;

            if (DSCoded != null && DSCoded.Tables[0].Rows.Count > 0)
            {
                LstCoded = (from CodedRow in DSCoded.Tables[0].AsEnumerable().Cast <DataRow>()
                            select new Coded
                {
                    CodeValue = Convert.ToString(CodedRow["CodeValue"]).Trim(),
                    Description = Convert.ToString(CodedRow["Description"])
                }).ToList();
            }
            return((new System.Web.Script.Serialization.JavaScriptSerializer()).Serialize(LstCoded));
        }
Example #2
0
        public static List <ListItem> GetDrugData(string BookingID, Int32 sJurisID)
        {
            DataSet         objDs     = new DataSet();
            IDataReader     objReader = new TableDB().TableWhere(sJurisID, (int)TableID.JMMDrug, string.Empty, String.Empty, BookingID);
            List <ListItem> customers = new List <ListItem>();

            while (objReader.Read())
            {
                customers.Add(new ListItem
                {
                    Value = objReader["ID"].ToString(),
                    Text  = objReader["Description"].ToString()
                });
            }

            if (objReader != null && !objReader.IsClosed)
            {
                objReader.Close();
            }

            return(customers);
        }