[HttpPost]// עדכון הנתונים במסד public ActionResult PastGenicology(PastGenicology pg) { try { Session.Timeout += 10; string id = Session["Patiant"].ToString(); BLPastGenicology bl = new BLPastGenicology(); int result = bl.addOrUpdatePastGenicology(id, DateTime.Today, pg.AgeOfMenarche, pg.CycleRegular, pg.CycleRegularT, pg.MenstrualSyptoms, pg.MenstrualSyptomsT, pg.MenopauseSyptoms, pg.MenopauseSyptomsT, pg.Contraception, pg.ContraceptionT); if (result == 0)// שמירת הנתונים צלחה { Session["status2"] = "הנתונים נשמרו בהצלחה"; return(RedirectToAction("PastGenicology", "PastGenicology", new { pg })); } else// כשל בשמירת הנתונים { Session["status2"] = "התרחשה שגיאה"; return(RedirectToAction("PastGenicology", "PastGenicology", new { pg })); } } catch { Session["status2"] = "התרחשה שגיאה"; return(RedirectToAction("PastGenicology", "PastGenicology", new { pg })); } }
public List <PastGenicology> getPastGeniclogiById(string id) { DAPastGenicology da = new DAPastGenicology(); ListDictionary Params = new ListDictionary(); Params.Add("@id", id); DataSet ds = da.getPastGeniclogiById(Params); PastGenicology pg = new PastGenicology(); List <PastGenicology> pgl = new List <PastGenicology>(); foreach (DataRow item in ds.Tables[0].Rows) { pg = new PastGenicology(); pg.UpdateCode = BLCtrl.getInt(item, "UpdateCode", 0); pg.AgeOfMenarche = BLCtrl.getInt(item, "AgeOfMenarche", 18); pg.CycleRegular = BLCtrl.getBool(item, "CycleRegular", true); pg.CycleRegularT = BLCtrl.getString(item, "CycleRegularT", ""); pg.MenstrualSyptoms = BLCtrl.getBool(item, "MenstrualSyptoms", false); pg.MenstrualSyptomsT = BLCtrl.getString(item, "MenstrualSyptomsT", ""); pg.MenopauseSyptoms = BLCtrl.getBool(item, "MenopauseSyptoms", false); pg.MenopauseSyptomsT = BLCtrl.getString(item, "MenopauseSyptoms", ""); pg.Contraception = BLCtrl.getBool(item, "Contraception", false); pg.ContraceptionT = BLCtrl.getString(item, "ContraceptionT", ""); pgl.Add(pg); } return(pgl); }
public PastGenicology getPastGenicology(string id, DateTime date) { DAPastGenicology da = new DAPastGenicology(); ListDictionary Params = new ListDictionary(); Params.Add("@id", id); Params.Add("@date", date); DataSet ds = da.getPastGenicology(Params); PastGenicology pg = new PastGenicology(); pg.UpdateCode = BLCtrl.getInt(ds.Tables[0].Rows[0], "UpdateCode", 0); pg.AgeOfMenarche = BLCtrl.getInt(ds.Tables[0].Rows[0], "AgeOfMenarche", 18); pg.CycleRegular = BLCtrl.getBool(ds.Tables[0].Rows[0], "CycleRegular", true); pg.CycleRegularT = BLCtrl.getString(ds.Tables[0].Rows[0], "CycleRegularT", ""); pg.MenstrualSyptoms = BLCtrl.getBool(ds.Tables[0].Rows[0], "MenstrualSyptoms", false); pg.MenstrualSyptomsT = BLCtrl.getString(ds.Tables[0].Rows[0], "MenstrualSyptomsT", ""); pg.MenopauseSyptoms = BLCtrl.getBool(ds.Tables[0].Rows[0], "MenopauseSyptoms", false); pg.MenopauseSyptomsT = BLCtrl.getString(ds.Tables[0].Rows[0], "MenopauseSyptomsT", ""); pg.Contraception = BLCtrl.getBool(ds.Tables[0].Rows[0], "Contraception", false); pg.ContraceptionT = BLCtrl.getString(ds.Tables[0].Rows[0], "ContraceptionT", ""); return(pg); }
// כניסה ללשונית הסטוריה גניקולגית public ActionResult PastGenicology() { try { if (Session["UserName"] == null || Session["UserPasswerd"] == null) { return(RedirectToAction("Login", "Account")); } if (Session["Patiant"] == null) { return(RedirectToAction("Login", "Account")); } ViewBag.status2 = Session["status2"]; Session["status2"] = ""; string id = Session["Patiant"].ToString(); BLPastGenicology BL = new BLPastGenicology(); PastGenicology p = BL.getPastGenicology(id, DateTime.Today); // שליפת נתוני המטופלת מהמסד return(View(p)); } catch (Exception e) { return(View()); } }