Exemple #1
0
 public Medicine(
     string name,
     Dictionary <string, Color> tags,
     MedicineGroup medicineInfos,
     MedicineScheduleInfo medicineScheduleInfo)
 {
     this.name = name;
     this.tags = tags;
     this.medicineOverAllInfo  = medicineInfos;
     this.medicineScheduleInfo = medicineScheduleInfo;
 }
Exemple #2
0
 public Medicine(
     string name,
     string registeredBy,
     List <MedicineGroup> medicineLongInfos,
     MedicineScheduleInfo medicineScheduleInfo,
     ManufacturerInfo manufacturerInfo)
 {
     this.name                 = name;
     this.registeredBy         = registeredBy;
     this.perBatchInfoList     = medicineLongInfos;
     this.medicineScheduleInfo = medicineScheduleInfo;
     this.manufacturerInfo     = manufacturerInfo;
 }
        public MedicineScheduleInfo GetScheduleInfo()
        {
            MedicineScheduleInfo md = new MedicineScheduleInfo("", 0);
            string       query      = "select * from scheduletable where medicinename = @medname";
            MySqlCommand cmd        = new MySqlCommand(query, globalCon);

            cmd.Parameters.AddWithValue("@medname", medName);
            MySqlDataReader reader = cmd.ExecuteReader(System.Data.CommandBehavior.SingleRow);

            while (reader.Read())
            {
                string   medName = reader.GetString(0);
                DateTime scDate  = reader.GetDateTime(1);
                int      nofS    = reader.GetInt16(2);
                md = new MedicineScheduleInfo(medName, nofS, scDate);
            }
            reader.Close();
            return(md);
        }
Exemple #4
0
        public Medicine MedicineLongInfo()
        {
            string       companyName       = "";
            string       query             = "select manfName,username from mednametable where medName=@mname";
            MySqlCommand getDetailsCommand = new MySqlCommand(query, globalCon);

            getDetailsCommand.Parameters.AddWithValue("@mname", name);
            MySqlDataReader reader = getDetailsCommand.ExecuteReader();

            while (reader.Read())
            {
                registeredBy = reader.GetString(1);
                companyName  = reader.GetString(0);
            }
            reader.Close();
            //Get List of Manufacturer Infos.
            manufacturerInfo = ManufacturerInfo.GetShortInfoOf(companyName);
            //Get List of Batch Infos.
            perBatchInfoList = MedicineGroup.SeparatedBatchInfo(name);
            //Get Full Schedule Info.
            medicineScheduleInfo = new MedicineScheduleInfo(name).GetScheduleInfo();
            //Return the Medicine.
            return(new Medicine(name, registeredBy, perBatchInfoList, medicineScheduleInfo, manufacturerInfo));
        }