public ActionResult MedicineCategory() { var model = new MedicineDAL().GetCategories().ToList(); ViewData["GetMedicineCatory"] = model; return(View()); }
public ActionResult AddPatientMedicine(int?patient_id, int?PatientMedID) { List <tblPatientAppointment> lstAppointment = new PatientDAL().getPatientAppointments(Convert.ToInt32(patient_id)).ToList(); if (lstAppointment.Count > 0) { ViewBag.lstAppointment = lstAppointment; } Session["lstAppointment"] = lstAppointment; List <tblMedicine> lstMed = new MedicineDAL().GetAllMedicine().ToList(); ViewBag.lstMed = lstMed; Session["lstMed"] = lstMed; List <tblMedicineTiming> lstTiming = new MedicineDAL().GetMedicineTiming().ToList(); Session["lstTiming"] = lstTiming; ViewBag.lstTiming = lstTiming; List <tblMedicineOccurance> lstOccurance = new MedicineDAL().GetMedicineOccurance().ToList(); Session["lstOccurance"] = lstOccurance; ViewBag.lstOccurance = lstOccurance; if (Session["Medicine"] != null) { ViewBag.med = Session["Medicine"]; } return(View()); }
public ActionResult MedicineList() { { var model = new MedicineDAL().GetAllMedicine().ToList(); ViewData["GetMedicine"] = model; return(View()); } }
public ActionResult AddMedicineCat(int?cat_id) { var model = new tblMedicineCategory(); if (cat_id != null) { model = new MedicineDAL().SingleRecord(Convert.ToInt32(cat_id)); } return(View(model)); }
public ActionResult AddMedicine(int?medicine_id) { var model = new tblMedicine(); var cat = new MedicineDAL().GetCategories().ToList(); ViewBag.MedicineCat = cat; if (medicine_id != null) { model = new MedicineDAL().GetMedicine(Convert.ToInt32(medicine_id)); } return(View(model)); }
private void LoadMedicines() { var medModel = new MedicineModel(); var medDal = new MedicineDAL(); oDs = new DataSet(); //medModel.ItemName = SearchMed.Value; ////oDs = medDal.SeachData(medModel); oDs = medDal.SelectAll(); var medsTable = new DataTable(); medsTable.Columns.Add("id"); medsTable.Columns.Add("dname"); var medsRow = medsTable.NewRow(); medsRow[0] = 0; medsRow[1] = "--Select Medicine--"; medsTable.Rows.Add(medsRow); if (oDs != null) { if (oDs.Tables[0].Rows.Count > 0) { for (int i = 0; i <= oDs.Tables[0].Rows.Count - 1; i++) { var medsFinal = medsTable.NewRow(); medsFinal[0] = oDs.Tables[0].Rows[i]["id"].ToString(); medsFinal[1] = oDs.Tables[0].Rows[i]["dname"].ToString(); medsTable.Rows.Add(medsFinal); } } } medsList.DataSource = medsTable; medsList.DataValueField = "id"; medsList.DataTextField = "dname"; medsList.DataBind(); }
private void LoadMedicines() { var medModel = new MedicineModel(); var medDal = new MedicineDAL(); oDs = new DataSet(); medModel.ItemName = SearchMed.Value; //oDs = medDal.SeachData(medModel); oDs = medDal.SelectAll(); cbMedList.DataSource = oDs.Tables[0]; cbMedList.DataValueField = "code"; cbMedList.DataTextField = "dname"; cbMedList.DataBind(); myDropDownlistID.DataSource = oDs.Tables[0]; myDropDownlistID.DataValueField = "code"; myDropDownlistID.DataTextField = "dname"; myDropDownlistID.DataBind(); }
public ActionResult AddMedicineCat(int?cat_id, tblMedicineCategory medicineCategory) { string username = ""; medicineCategory.isActive = true; HttpCookie cookie = HttpContext.Request.Cookies["AdminCookies"]; if (cookie != null) { username = Convert.ToString(cookie.Values["UserName"]); } try { // TODO: Add insert logic here if (cat_id != null) { medicineCategory.ID = Convert.ToInt32(cat_id); new MedicineDAL().UpdateRecord(medicineCategory); TempData["AlertTask"] = "medicine updated successfully"; } else { medicineCategory.CreatedBy = username; medicineCategory.CreatedAt = DateTime.UtcNow; cat_id = new MedicineDAL().InsertRecord(medicineCategory); TempData["AlertTask"] = "medicine added successfully"; } return(Redirect("/medicine-categories")); } catch { return(View()); } }
public ActionResult AddMedicine(int?medicine_id, tblMedicine Obj) { string username = ""; HttpCookie cookie = HttpContext.Request.Cookies["AdminCookies"]; if (cookie != null) { username = Convert.ToString(cookie.Values["UserName"]); } try { Obj.isActive = true; // TODO: Add insert logic here if (medicine_id != null) { Obj.ID = Convert.ToInt32(medicine_id); new MedicineDAL().UpdateMedicine(Obj); TempData["AlertTask"] = "medicine updated successfully"; } else { Obj.CreatedBy = username; Obj.CreatedAt = DateTime.UtcNow; medicine_id = new MedicineDAL().AddMedicine(Obj); TempData["AlertTask"] = "medicine added successfully"; } return(Redirect("/medicine")); } catch { return(View()); } }
public ActionResult AddPatientMedicine(string add, string Save, int?patient_id, int?PatientMedID, tblPatientMedicine obj) { string redirect_url = ""; List <tblPatientMedicine> lst = new List <tblPatientMedicine>(); var button = add ?? Save; if (button == "Add") { string username = ""; HttpCookie cookie = HttpContext.Request.Cookies["AdminCookies"]; if (cookie != null) { username = Convert.ToString(cookie.Values["UserName"]); } obj.CreatedAt = DateTime.UtcNow; obj.patient_id = Convert.ToInt32(patient_id); obj.CreatedBy = username; obj.tblMedicine = new MedicineDAL().GetMedicine(Convert.ToInt32(obj.MedicineID)); obj.tblPatientAppointment = new PatientDAL().GetPatientAppointment(Convert.ToInt32(patient_id), Convert.ToInt32(obj.PatientAppointmentID)); tblMedicineTiming time = new MedicineDAL().GetMedicineTiming().Where(x => x.ID == Convert.ToInt32(obj.Timing)).FirstOrDefault(); obj.Timing = time.TimingName; tblMedicineOccurance occurance = new MedicineDAL().GetMedicineOccurance().Where(x => x.ID == Convert.ToInt32(obj.Occurance)).FirstOrDefault(); obj.Occurance = occurance.OccuranceName; obj.isActive = true; if (Session["Medicine"] != null) { lst = Session["Medicine"] as List <tblPatientMedicine>; } lst.Add(obj); Session["Medicine"] = lst; redirect_url = "/add-patient-medicine?Patient_id=" + patient_id; } else { if (ModelState.IsValid) { lst = Session["Medicine"] as List <tblPatientMedicine>; foreach (var med in lst) { tblPatientMedicine newobj = new tblPatientMedicine(); newobj.CreatedAt = med.CreatedAt; newobj.CreatedBy = med.CreatedBy; newobj.isActive = med.isActive; newobj.MedicineID = med.MedicineID; newobj.NoofDays = med.NoofDays; newobj.Occurance = med.Occurance; newobj.PatientAppointmentID = med.PatientAppointmentID; newobj.patient_id = med.patient_id; newobj.Quantity = med.Quantity; newobj.Timing = med.Timing; new PatientDAL().SavePatientMed(newobj); } Session["Medicine"] = null; redirect_url = "/Patient-medicine?Patient_id=" + patient_id; } } ViewBag.med = Session["Medicine"]; return(Redirect(redirect_url)); }
public MedicineBLL() { this.db = new DataAccess(); this.medicine = new MedicineDAL(); }
public MedicineBUS() { medDAL = new MedicineDAL(); medDAL.InitializeDB(); }
public MedicineBLLImpl() { medicineDAL = new MedicineDALImpl(); }