private void btn_Save_Click(object sender, EventArgs e) { try { rendez_vous rdv = new rendez_vous { id_patient = iD_patient, date_rdv = dateRDV.DateTime.ToString("yyyy-MM-dd"), seance = comboPeriode.Text, id_user = 2, disponible = Convert.ToInt32(ckboxDisponible.Checked), traiter = 0, payer = 0, terminer = 0 }; rdvDao.Add(rdv); string toastID = "3cc53fe8-e357-4b86-b11f-493dc4e86bec"; toastAdd.ShowNotification(toastID); getNbRDV(); Application.OpenForms["Home"].Activate(); this.Close(); } catch (Exception ex) { XtraMessageBox.Show(DevExpress.LookAndFeel.UserLookAndFeel.Default, ex.Message); } }
public ActionResult Rendez(string message, string Prenom, string CNE) { var UserId = User.Identity.GetUserId(); var MedId = (int)(Session[" Medcineid"]); var check = db.rendez_vous.Where(a => a.Medcineid == MedId && a.UserId == UserId).ToList(); if (check.Count < 1) { var medcine = new rendez_vous(); medcine.Medcineid = MedId; medcine.UserId = UserId; medcine.Message = message; medcine.Prenom = Prenom; medcine.CNE = CNE; medcine.Date = DateTime.Now; db.rendez_vous.Add(medcine); db.SaveChanges(); ViewBag.Result = "Rendez-vous réservé"; } else { ViewBag.Result = "Desolé tu est deja reserver"; } return(View()); }
public ActionResult DeleteConfirmed(int id) { rendez_vous medcine = db.rendez_vous.Find(id); db.rendez_vous.Remove(medcine); db.SaveChanges(); return(RedirectToAction("listrendez")); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } rendez_vous medcine = db.rendez_vous.Find(id); if (medcine == null) { return(HttpNotFound()); } return(View(medcine)); }
public void Update(rendez_vous rendez_vous) { data.Update(rendez_vous); }
public void Add(rendez_vous rendez_vous) { data.Add(rendez_vous); }