示例#1
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
            pharmacy p1 = new pharmacy(label4.Text);

            p1.ShowDialog();
        }
        public ActionResult Save(pharmacy invoice)
        {
            if (!ModelState.IsValid)
            {
                var viewModel = new PharmacyFormViewModel
                {
                    Pharmacy = invoice
                };

                return(View("PharmacyForm", viewModel));
            }

            if (invoice._Id == Guid.Empty)
            {
                _context.InsertRecord(_table, invoice);
            }

            else
            {
                var invoiceInDb = _context.LoadRecordByIdProperity <pharmacy>(_table, invoice.Id);
                invoiceInDb.Patient = invoice.Patient;
                invoiceInDb.Notes   = invoice.Notes;
                invoiceInDb.Price   = invoice.Price;
                invoiceInDb.Drugs   = invoice.Drugs;

                _context.UPsertRecordByObjectId(_table, invoice._Id, invoice);
            }

            return(RedirectToAction("Index", "Pharmacy"));
        }
        public ActionResult New()
        {
            var drug = new pharmacy();

            drug.Id = GenerateUniqueID();

            var viewModel = new PharmacyFormViewModel
            {
                Pharmacy = drug
            };

            return(View("PharmacyForm", viewModel));
        }
示例#4
0
 public batch(string str1, pharmacy mainform)
 {
     pharm = mainform;
     InitializeComponent();
     label1.Text = str1;
 }
示例#5
0
 public ActionResult Edit(pharmacy pharmacy)
 {
     db.Entry(pharmacy).State = System.Data.Entity.EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
示例#6
0
 public ActionResult Create(pharmacy pharmacy)
 {
     db.pharmacies.Add(pharmacy);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }