示例#1
0
    protected void SpawnMed()
    {
        GameObject   temp    = Instantiate(objectToSpawn, this.gameObject.transform.position, Quaternion.identity);
        MedicineData medData = temp.AddComponent <MedicineData>();

        medData.medicine = this.GetComponent <MedicineData>().medicine;
    }
示例#2
0
 public AdminController(IArticleData articleData,
                        IApiErrorHandler apiErrorHandler,
                        AssignedMedicineData assignedMedicineData,
                        AssignedPlanData assignedPlanData,
                        IFeedbackData feedbackData,
                        ILabTestData labTestData,
                        IMapper mapper,
                        LabTestRequestsData labTestRequestsData,
                        MedicineData medicineData,
                        PatientNoteData patientNoteData,
                        UserData userData,
                        UserManager <ApplicationUser> userManager,
                        RoleManager <ApplicationRole> roleManager,
                        UserRoleData userRoleData,
                        PatientData patientData,
                        PatientProgressData patientProgressData)
 {
     _articleData          = articleData;
     _apiErrorHandler      = apiErrorHandler;
     _assignedMedicineData = assignedMedicineData;
     _assignedPlanData     = assignedPlanData;
     _feedbackData         = feedbackData;
     _labTestData          = labTestData;
     _mapper = mapper;
     _labTestRequestsData = labTestRequestsData;
     _medicineData        = medicineData;
     _patientNoteData     = patientNoteData;
     _userData            = userData;
     _userManager         = userManager;
     _roleManager         = roleManager;
     _userRoleData        = userRoleData;
     _patientData         = patientData;
     _patientProgressData = patientProgressData;
 }
示例#3
0
        public static MedicineData GetMedicineData(TrayData tray, string pillId)
        {
            MedicineData medicine = null;

            medicine = tray.Cups.SelectMany(x => x.Medicines).FirstOrDefault(x => x.PillId.Contains(pillId));
            if (medicine == null)
            {
                medicine = tray.Cups.SelectMany(x => x.Medicines).FirstOrDefault(x => x.PillInfo != null &&
                                                                                 ((FragmentData)x.PillInfo).WholePill != null &&
                                                                                 ((FragmentData)x.PillInfo).WholePill.PillId == pillId);
            }
            return(medicine);
        }
示例#4
0
        public void Configure(EntityTypeBuilder <Medicine> builder)
        {
            builder.ToTable(nameof(Medicine), SchemaConstant.DBO);

            builder.HasKey(e => e.Id);

            builder.Property(e => e.Id).HasMaxLength(MaxLengthConstant.ID).IsRequired();
            builder.Property(e => e.Brand).HasMaxLength(MaxLengthConstant.ShortStringLenght).IsRequired();
            builder.Property(e => e.Price).HasColumnType("decimal(16, 2)").IsRequired();
            builder.Property(e => e.Quantity).IsRequired();
            builder.Property(e => e.ExpiryDate).HasColumnType("date").IsRequired();
            builder.Property(e => e.Notes).HasMaxLength(MaxLengthConstant.LongStringLenght).IsRequired();
            MedicineData.Seed(builder);
        }
示例#5
0
 public int AddMedicine(MedicineData medicine)
 {
     medicine.Id = random.Next(1000);
     list.Add(medicine);
     return(medicine.Id);
 }
示例#6
0
        private void Save_Click(object sender, EventArgs e)
        {
            //var Medicine = db.MedicineInfos.SingleOrDefault(u => u.Medicine_Name == textBox1.Text);
            if (textBox6.Text != "")
            {
                //int mid = Convert.ToInt32(textBox6.Text);

                //var Medicine_Id = db.MedicineInfos.Select(u => u.Medicine_Id);
                //if (Medicine_Id == null)
                //{
                //    MessageBox.Show("This Id Already Added!'Medicine Id Must be Unique'");

                //}

                try
                {
                    string Medicine_Name, Medicine_Catagory, Dosage, Manufacturer;

                    int Medicine_Available;


                    DateTime Entry_Date;
                    DateTime Production_Date;
                    DateTime Expire_Date;

                    int Buying_Price;
                    int Selling_Price;
                    int Medicine_Id;


                    Medicine_Name     = textBox1.Text;
                    Medicine_Catagory = textBox2.Text;
                    Dosage            = textBox7.Text;
                    Manufacturer      = comboBox1.Text;

                    Medicine_Available = Convert.ToInt32(textBox8.Text);
                    Entry_Date         = Convert.ToDateTime(dateTimePicker1.Text);
                    Production_Date    = Convert.ToDateTime(dateTimePicker2.Text);
                    Expire_Date        = Convert.ToDateTime(dateTimePicker3.Text);
                    Buying_Price       = Convert.ToInt32(textBox4.Text);
                    Selling_Price      = Convert.ToInt32(textBox5.Text);
                    Medicine_Id        = Convert.ToInt32(textBox6.Text);

                    MedicineData.InsertPermacyData(Medicine_Name, Medicine_Catagory, Dosage, Manufacturer, Medicine_Available, Entry_Date, Production_Date, Expire_Date, Buying_Price, Selling_Price, Medicine_Id);
                    MessageBox.Show("Medicine Added Successfully");


                    this.Hide();
                }



                catch (Exception)
                {
                    MessageBox.Show("please fill all information");
                }
            }



            else
            {
                MessageBox.Show("Medicine Id Must Needed");
            }
        }
 public IActionResult Post([FromBody] MedicineData medicine)
 {
     _repo.AddMedicine(medicine);
     return(Created("", HttpStatusCode.OK));
 }