Example #1
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;
 }
Example #2
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));
        }