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 Products(List <UrunModel> gelenler)
        {
            if (Session["grup"].Equals(3))
            {
                List <Urun>      urunler     = StokKontrolEntitiesProvider.GetAllProducts();
                List <UrunTipi>  urunTipleri = StokKontrolEntitiesProvider.GetAllUrunTipi();
                List <UrunModel> model       = new List <UrunModel>();

                for (int i = 0; i < urunler.Count(); i++)
                {
                    if (urunler[i].StokMiktari == null)
                    {
                        urunler[i].StokMiktari = 0;
                    }
                    for (int j = 0; j < gelenler.Count(); j++)
                    {
                        if (urunler[i].ObjectId == gelenler[j].ObjectId && gelenler[j].Selected == true)
                        {
                            urunler[i].StokMiktari += gelenler[j].UretimMiktari;
                        }
                    }
                }
                StokKontrolEntitiesProvider.SaveChanges();

                foreach (Urun urun in urunler)
                {
                    if (urun.UrunTipi != null)
                    {
                        model.Add(new UrunModel(urun, urunTipleri, urun.UrunTipi.UrunTipi1));
                    }
                    else
                    {
                        model.Add(new UrunModel(urun, urunTipleri));
                    }
                }
                ModelState.Clear();
                return(View(model));
            }
            return(RedirectToAction("Index", "Login"));
        }