Example #1
0
 [HttpGet] // כניסה ללשונית פרטים דמוגרפיים של מטופלת
 public ActionResult Demography()
 {
     try
     {
         Session.Timeout += 10;
         if (Session["Patiant"] == null)
         {
             return(RedirectToAction("Login", "Account"));
         }
         ViewBag.status    = Session["status"];
         Session["status"] = "";
         BLPatiants           blp  = new BLPatiants();
         Patiants             p    = blp.getPatiantsById(Session["Patiant"].ToString()); //שליפת נתוני המטופלת מהמסד
         BLMaterialStatus     blms = new BLMaterialStatus();
         List <MaritalStatus> ms   = blms.getMaterialStatus();                           //שליפת נתוני המטופלת מהמסד
         BLGetKupot           blk  = new BLGetKupot();
         List <Kupot>         k    = blk.getKupot();                                     //שליפת נתוני המטופלת מהמסד
         MyModels             M    = new MyModels();
         M.MyP = p;
         M.MyS = ms;
         M.MyK = k;
         return(View(M));
     }
     catch (Exception e)
     {
         return(View());
     }
 }
Example #2
0
 public ActionResult ReciepitsListOfPatiants()// כניסה לקבלות של מטופל
 {
     try
     {
         if (Session["UserName"] == null || Session["UserPasswerd"] == null)
         {
             return(RedirectToAction("Login", "Account"));
         }
         if (Session["Patiant"] == null)
         {
             return(RedirectToAction("Login", "Account"));
         }
         Session.Timeout += 10;
         BLReceipt      bl             = new BLReceipt();
         List <receipt> NewReceiptList = new List <receipt>(); //קבלות ממוינות
         List <receipt> result         = bl.getReceipt(Session["Patiant"].ToString(), "p");
         if (result != null && result.Count > 1)               //מיון תוצאות
         {
             var GroupResult = result.GroupBy(gro => new { gro.receiptNum }).Select(xx => new { xx.Key.receiptNum }).ToList();
             foreach (var rec in GroupResult)
             {
                 double sum = 0;
                 foreach (var itemInResult in result)//סכימת תשלומים לקבלה אחת
                 {
                     if (itemInResult.receiptNum == rec.receiptNum)
                     {
                         sum += itemInResult.Sum;
                     }
                 }
                 var SingleReceipt = result.FirstOrDefault(xxx => xxx.receiptNum == rec.receiptNum); //לוקחים רשומה אחת והופכים אותה לקבלה מאוחדת
                 SingleReceipt.Sum = sum;                                                            //עדכון הסכום הכולל של כל התשלומים לקבלה
                 NewReceiptList.Add(SingleReceipt);
             }
         }
         else
         {
             if (result != null && result.Count != 0)
             {
                 NewReceiptList.Add(result.FirstOrDefault());
             }
         }
         BLPatiants blc = new BLPatiants();
         Patiants   p   = blc.getPatiantsById(Session["Patiant"].ToString());
         MyPatiantsRecepitModels model = new MyPatiantsRecepitModels();
         model.recepit = NewReceiptList;
         model.MyP     = p;
         return(View(model));
     }
     catch
     {
         MyPatiantsRecepitModels model = new MyPatiantsRecepitModels();
         return(View(model));
     }
 }
Example #3
0
        public Patiants getPatiantsById(string id)
        {
            DAPatiants     da     = new DAPatiants();
            ListDictionary Params = new ListDictionary();

            Params.Add("@id", id);
            DataSet  ds = da.getPatiantsById(Params);
            Patiants p  = new Patiants();

            p.A                   = BLCtrl.getInt(ds.Tables[0].Rows[0], "A", 0);
            p.BirthDate           = BLCtrl.getDateTime(ds.Tables[0].Rows[0], "BirthDate", DateTime.Today);
            p.Children            = BLCtrl.getInt(ds.Tables[0].Rows[0], "Children", 0);
            p.City                = BLCtrl.getString(ds.Tables[0].Rows[0], "City", "");
            p.Code                = BLCtrl.getInt(ds.Tables[0].Rows[0], "Code", 0);
            p.ContactExam         = BLCtrl.getString(ds.Tables[0].Rows[0], "ContactExam", "");
            p.ContactGinformation = BLCtrl.getString(ds.Tables[0].Rows[0], "ContactGinformation", "");
            p.Doctor              = BLCtrl.getString(ds.Tables[0].Rows[0], "Doctor", "");
            p.Email               = BLCtrl.getString(ds.Tables[0].Rows[0], "Email", "");
            p.FathersOrigin       = BLCtrl.getString(ds.Tables[0].Rows[0], "FathersOrigin", "");
            p.Fax                 = BLCtrl.getString(ds.Tables[0].Rows[0], "Fax", "");
            p.FirstName           = BLCtrl.getString(ds.Tables[0].Rows[0], "FirstName", "");
            p.followedup          = BLCtrl.getBool(ds.Tables[0].Rows[0], "followedup", false);
            p.FollowUp            = BLCtrl.getBool(ds.Tables[0].Rows[0], "FollowUp", false);
            p.G                   = BLCtrl.getInt(ds.Tables[0].Rows[0], "G", 0);
            p.Id                  = BLCtrl.getString(ds.Tables[0].Rows[0], "Id", "");
            p.Kupah               = BLCtrl.getInt(ds.Tables[0].Rows[0], "Kupah", 0);
            p.L                   = BLCtrl.getInt(ds.Tables[0].Rows[0], "L", 0);
            p.Language            = BLCtrl.getString(ds.Tables[0].Rows[0], "Language", "");
            p.LastName            = BLCtrl.getString(ds.Tables[0].Rows[0], "LastName", "");
            p.MaritalStatus       = BLCtrl.getInt(ds.Tables[0].Rows[0], "MaritalStatus", 0);
            p.MothersOrigin       = BLCtrl.getString(ds.Tables[0].Rows[0], "MothersOrigin", "");
            p.Occupation          = BLCtrl.getString(ds.Tables[0].Rows[0], "Occupation", "");
            p.P                   = BLCtrl.getInt(ds.Tables[0].Rows[0], "P", 0);
            p.Phone               = BLCtrl.getString(ds.Tables[0].Rows[0], "Phone", "");
            p.Phone2              = BLCtrl.getString(ds.Tables[0].Rows[0], "Phone2", "");
            p.reffered            = BLCtrl.getString(ds.Tables[0].Rows[0], "reffered", "");
            p.Street              = BLCtrl.getString(ds.Tables[0].Rows[0], "Street", "");
            p.T                   = BLCtrl.getInt(ds.Tables[0].Rows[0], "T", 0);

            return(p);
        }
Example #4
0
        public List <Patiants> getPatiants()
        {
            PatientsList dm = new PatientsList();

            ListDictionary Params = new ListDictionary();
            // Params.Add("@dt", dt);

            DataSet         ds = dm.getPatiants(Params);
            List <Patiants> l  = new List <Patiants>();
            Patiants        p;

            foreach (DataRow item in ds.Tables[0].Rows)
            {
                // f.FollowUp = BLCtrl.getString(item, "FollowUp", "");
                p           = new Patiants();
                p.Id        = BLCtrl.getString(item, "Id", " ");
                p.FirstName = BLCtrl.getString(item, "FirstName", " ");
                p.LastName  = BLCtrl.getString(item, "LastName", " ");
                p.Doctor    = BLCtrl.getString(item, "Doctor", " ");
                l.Add(p);
            }
            return(l);
        }
Example #5
0
        public List <Patiants> getFolloaed_patient()
        {
            DAFolloaed_patient dfp    = new DAFolloaed_patient();
            ListDictionary     Params = new ListDictionary();
            DataSet            ds     = dfp.getFolloaed_patient(Params);
            List <Patiants>    lp     = new List <Patiants>();
            Patiants           p;

            foreach (DataRow item in ds.Tables[0].Rows)
            {
                p           = new Patiants();
                p.Id        = BLCtrl.getString(item, "id", " ");
                p.FirstName = BLCtrl.getString(item, "FirstName", " ");
                p.LastName  = BLCtrl.getString(item, "LastName", " ");
                p.Phone     = BLCtrl.getString(item, "Phone", " ");
                p.Phone2    = BLCtrl.getString(item, "Phone2", " ");
                p.City      = BLCtrl.getString(item, "City", " ");
                p.Kupah     = BLCtrl.getInt(item, "Kupah", 1);
                //p.FollowUp = BLCtrl.getBool(item, "FollowUp", false);
                lp.Add(p);
            }
            return(lp);
        }
Example #6
0
 [HttpPost]// עדכון הנתונים במסד
 public ActionResult Demography(Patiants pat)
 {
     try
     {
         pat.Id = pat.Id.TrimEnd('/');
         BLPatiants bl     = new BLPatiants();
         int        result = bl.UpdatePatiant(pat.Id, pat.FirstName, pat.LastName, pat.Doctor, pat.reffered, pat.Language, pat.City, pat.Street, pat.Phone, pat.Phone2, pat.Fax, pat.Email, pat.BirthDate, pat.ContactExam, pat.ContactGinformation, pat.FathersOrigin, pat.MothersOrigin, pat.Kupah, pat.MaritalStatus, pat.Children, pat.G, pat.T, pat.P, pat.A, pat.L, pat.FollowUp, pat.Occupation, pat.followedup);
         if (result == 0)// שמירת הנתונים צלחה
         {
             Session["status"] = "הנתונים נשמרו בהצלחה";
             return(RedirectToAction("Demography", "Patiants", new { pat.Id }));
         }
         else// כשל בשמירת הנתונים
         {
             Session["status"] = "התרחשה שגיאה";
             return(RedirectToAction("Demography", "Patiants", new { pat.Id }));
         }
     }
     catch
     {
         Session["status"] = "התרחשה שגיאה";
         return(RedirectToAction("Demography", "Patiants", new { pat.Id }));
     }
 }
Example #7
0
 public ActionResult addPatiant(Patiants s) //הוספת מטופל
 {
     try
     {
         Session.Timeout += 10;//session הגדלת ה
         BL_AddPatiants b = new BL_AddPatiants();
         int            i = 0;
         i = b.CheckID(s.Id);
         bool check = myStatic.IsValidId(s.Id); // שליחה לפונ' לבדיקת תקינות תעודת הזהות
         if (i == 20)                           // אם המטופל אינו קיים במערכת
         {
             if (check == false)                // אם התעודת זהות איננה תקינה
             {
                 s.Id = "";
                 ModelState.AddModelError("Id", "תעודת זהות אינה תקינה");
             }
             if (ModelState.IsValid)
             {
                 ModelState.Remove("Id");
                 int result = b.Add_Patiants(s.Id, s.FirstName, s.LastName, s.Kupah);
                 ViewBag.message = "מטופל נוסף למערכת בהצלחה";
                 return(View(new Patiants()));
             }
         }
         else //אם המטופל קיים במערכת
         {
             s.Id = "";
             ModelState.AddModelError("Id", "מטופל קיים במערכת");
         }
         return(View(s));
     }
     catch (Exception e)
     {
         return(View(s));
     }
 }