public ActionResult PersonalDebst(PersonalDebtsModel gelenler)
        {
            if (Session["grup"].Equals(3) && gelenler.SecilenAy != 0)
            {
                List <Kullanıcılar>      kullanıcılar = StokKontrolEntitiesProvider.GetAllUserList();
                List <KullanıcılarModel> model        = new List <KullanıcılarModel>();
                Borclandirma             borclandirma = new Borclandirma();
                PersonalDebtsModel       model2       = new PersonalDebtsModel();

                List <Aylar> Aylar2 = StokKontrolEntitiesProvider.GetAllAylarList();
                foreach (var ay in Aylar2)
                {
                    model2.Ay.Add(ay);
                }

                foreach (Kullanıcılar kullanıcı in kullanıcılar)
                {
                    if (kullanıcı.GrupId != 3)
                    {
                        model2.Kullanici.Add(kullanıcı);
                    }
                }
                ModelState.Clear();
                for (int i = 0; i < model2.Kullanici.Count(); i++)
                {
                    if (model2.Kullanici[i].GuncelBorc == null)
                    {
                        model2.Kullanici[i].GuncelBorc = 0;
                    }
                    for (int j = 0; j < gelenler.Kullanici.Count(); j++)
                    {
                        if (model2.Kullanici[i].ObjectId == gelenler.Kullanici[j].ObjectId && gelenler.Selected[j] == true)
                        {
                            if (gelenler.SecilenAy == 0)
                            {
                                ModelState.Clear();
                            }
                            else
                            {
                                StokKontrolEntitiesProvider.Borclandirma.Add(new Borclandirma
                                {
                                    KisiId              = model2.Kullanici[i].ObjectId,
                                    BorcMiktari         = gelenler.Borclandirma[j],
                                    BorlandirmaTarihiId = gelenler.SecilenAy
                                });
                                StokKontrolEntitiesProvider.SaveChanges();
                            }
                        }
                    }
                }
                for (int index = 0; index < model2.Kullanici.Count(); index++)
                {
                    model2.GuncelBorc.Add(StokKontrolEntitiesProvider.GetToplamBorcByObjectId(model2.Kullanici[index].ObjectId));
                }
                ViewBag.Aylar2 = StokKontrolEntitiesProvider.GetAllAylarList();
                StokKontrolEntitiesProvider.SaveChanges();
                return(View(model2));
            }
            return(RedirectToAction("Index", "Login"));
        }
 public ActionResult PersonalDebst()
 {
     if (Session["grup"].Equals(3))
     {
         List <Kullanıcılar> kullanıcılar = StokKontrolEntitiesProvider.GetAllUserList();
         PersonalDebtsModel  model2       = new PersonalDebtsModel();
         List <Aylar>        Aylar2       = StokKontrolEntitiesProvider.GetAllAylarList();
         foreach (var ay in Aylar2)
         {
             model2.Ay.Add(ay);
         }
         foreach (Kullanıcılar kullanıcı in kullanıcılar)
         {
             if (kullanıcı.GrupId != 3)
             {
                 model2.Kullanici.Add(kullanıcı);
             }
         }
         for (int index = 0; index < model2.Kullanici.Count(); index++)
         {
             model2.GuncelBorc.Add(StokKontrolEntitiesProvider.GetToplamBorcByObjectId(model2.Kullanici[index].ObjectId));
         }
         return(View(model2));
     }
     return(RedirectToAction("Index", "Login"));
 }
 public ActionResult GetPersonalDebst(int SecilenAy)
 {
     if (SecilenAy != 0)
     {
         List <Kullanıcılar> kullanıcılar = StokKontrolEntitiesProvider.GetAllUserList();
         PersonalDebtsModel  model        = new PersonalDebtsModel();
         int index = 0;
         foreach (Kullanıcılar kullanıcı in kullanıcılar)
         {
             if (StokKontrolEntitiesProvider.GetToplamBorcByDateAndObjectId2(SecilenAy, kullanıcı.ObjectId) != 0)
             {
                 model.GuncelBorc.Add(StokKontrolEntitiesProvider.GetToplamBorcByDateAndObjectId2(SecilenAy, kullanıcı.ObjectId));
                 model.Kullanici.Add(kullanıcı);
             }
             index++;
         }
         // model nesnesi oluştur sonra içini secilen aya göre doldur sonra modeli yolla
         // var p = Parti....
         return(PartialView("_PartialBorclandirmaList", model));
     }
     else
     {
         return(RedirectToAction("PersonalDebst", "Home"));
     }
 }
 public ActionResult GetCurrentDebts(int SecilenAy)
 {
     if (SecilenAy != 0)
     {
         List <Kullanıcılar> kullanıcılar = StokKontrolEntitiesProvider.GetAllUserList();
         PersonalDebtsModel  model        = new PersonalDebtsModel();
         List <Aylar>        Aylar2       = StokKontrolEntitiesProvider.GetAllAylarList();
         foreach (var ay in Aylar2)
         {
             model.Ay.Add(ay);
         }
         int index = 0;
         foreach (Kullanıcılar kullanıcı in kullanıcılar)
         {
             if (StokKontrolEntitiesProvider.GetToplamBorcByDateAndObjectId2(SecilenAy, kullanıcı.ObjectId) != 0)
             {
                 model.GuncelBorc.Add(StokKontrolEntitiesProvider.GetToplamBorcByDateAndObjectId2(SecilenAy, kullanıcı.ObjectId));
                 model.Kullanici.Add(kullanıcı);
                 model.SecilenAy = SecilenAy;
             }
             else
             {
             }
             index++;
         }
         // model nesnesi oluştur sonra içini secilen aya göre doldur sonra modeli yolla
         // var p = Parti....
         return(PartialView("_PartialCurrentDebts", model));
     }
     else
     {
         List <Kullanıcılar> kullanıcılar = StokKontrolEntitiesProvider.GetAllUserList();
         PersonalDebtsModel  model        = new PersonalDebtsModel();
         int index = 0;
         foreach (Kullanıcılar kullanıcı in kullanıcılar)
         {
             if (StokKontrolEntitiesProvider.GetToplamBorcByDateAndObjectId2(SecilenAy, kullanıcı.ObjectId) != 0)
             {
                 model.GuncelBorc.Add(StokKontrolEntitiesProvider.GetToplamBorcByDateAndObjectId2(SecilenAy, kullanıcı.ObjectId));
                 model.Kullanici.Add(kullanıcı);
             }
             index++;
         }
         return(PartialView("_PartialCurrentDebts", model));
     }
 }