Beispiel #1
0
        public IActionResult Index()
        {
            tblKullanicilar tblKullanicilar = _IKullanicilarService.GetById(StaticValues.LoginId);
            ModelUser       user            = new ModelUser();

            user.name    = tblKullanicilar.Isim;
            user.surname = tblKullanicilar.Soyisim;

            DuyurularDtoResponse db    = new DuyurularDtoResponse(_ItblResimDuyuruService, _ItblPdfDuyuruService, _ITblDuyuruService, _ItblResimService, _ItblPdfService);
            ModelDuyurular       model = new ModelDuyurular();

            model.listDuyuru = new List <DuyurularDto>();
            string Url = Request.GetDisplayUrl();

            string[]  sub         = Url.Split("/");
            int       length      = sub.Length;
            int       id          = Int32.Parse(sub[length - 1].Substring(0, 1));
            ModelUser modelDuyuru = new ModelUser();

            modelDuyuru.duyuru = new DuyurularDto();
            foreach (var VARIABLE in db.DuyuruList())
            {
                if (id == VARIABLE.id)
                {
                    modelDuyuru.duyuru = VARIABLE;
                }
            }

            modelDuyuru.duyuru.array = modelDuyuru.duyuru.aciklama.Split("<br>");
            modelDuyuru.name         = tblKullanicilar.Isim;
            modelDuyuru.surname      = tblKullanicilar.Soyisim;
            return(View(modelDuyuru));
        }
Beispiel #2
0
        public IActionResult Index(ModelUser user)
        {
            tblKullanicilar tblKullanicilar = _ItblKullanicilarService.GetById(StaticValues.LoginId);
            ModelUser       model           = new ModelUser();

            model.name    = tblKullanicilar.Isim;
            model.surname = tblKullanicilar.Soyisim;
            tblKullanicilar kull = _ItblKullanicilarService.FindbyMail(user.kull.mail, user.icerik);

            if (kull == null)
            {
                model.isSuccessfull = false;
            }
            else
            {
                model.isSuccessfull = true;
                if (kull.aktif == 1)
                {
                    kull.aktif = 0;
                }
                else
                {
                    kull.aktif = 1;
                }
                _ItblKullanicilarService.Update(kull);
            }

            return(View(model));
        }
Beispiel #3
0
        public IActionResult Index(ModelUser model)
        {
            tblKullanicilar tblKullanicilar = _ItblKullanicilarService.GetById(StaticValues.LoginId);
            ModelUser       user            = new ModelUser();

            user.name    = tblKullanicilar.Isim;
            user.surname = tblKullanicilar.Soyisim;
            if (model.cat == 1)
            {
                tblKanun temp = new tblKanun();
                temp.Adi   = model.baslik;
                temp.Id    = _ItblKanunService.GetAll().ToList().Count + 1;
                temp.Url   = model.url;
                temp.aktif = 0;
                _ItblKanunService.Add(temp);
                model.isSuccessfull = true;
            }
            else if (model.cat == 2)
            {
                tblyonetmenlik temp = new tblyonetmenlik();
                temp.Adi   = model.baslik;
                temp.Id    = _ItblYonetmenlikService.GetAll().ToList().Count + 1;
                temp.Url   = model.url;
                temp.aktif = 0;
                _ItblYonetmenlikService.Add(temp);

                model.isSuccessfull = true;
            }
            else
            {
                user.isSuccessfull = false;
            }

            return(View(user));
        }
Beispiel #4
0
        public IActionResult Index()
        {
            tblKullanicilar tblKullanicilar = _ItblKullanicilarService.GetById(StaticValues.LoginId);
            ModelUser       user            = new ModelUser();

            user.name    = tblKullanicilar.Isim;
            user.surname = tblKullanicilar.Soyisim;
            return(View(user));
        }
        public IActionResult Index()
        {
            tblKullanicilar kullanici = kull.GetById(StaticValues.LoginId);
            ModelUser       model     = new ModelUser();

            model.name    = kullanici.Isim;
            model.surname = kullanici.Soyisim;
            return(View(model));
        }
        public IActionResult Index()
        {
            tblKullanicilar tblKullanicilar = _IKullanicilarService.GetById(StaticValues.LoginId);
            ModelUser       user            = new ModelUser();

            user.name       = tblKullanicilar.Isim;
            user.surname    = tblKullanicilar.Soyisim;
            user.listDuyuru = _ITblDuyuruService.GetAll().ToList();
            return(View(user));
        }
        public IActionResult Index()
        {
            tblKullanicilar tblKullanicilar = _ItblKullanicilarService.GetById(StaticValues.LoginId);
            ModelUser       model           = new ModelUser();

            model.name            = tblKullanicilar.Isim;
            model.surname         = tblKullanicilar.Soyisim;
            model.isSuccessfull   = null;
            model.yonetmenliklist = _ItblYonetmenlikService.GetAll();
            model.kanunlist       = ITblKanunService.GetAll();
            return(View(model));
        }
Beispiel #8
0
        public IActionResult Index()
        {
            if (StaticValues.LoginId == null)
            {
                StaticValues.LoginId = null;
                return(Redirect("Giris"));
            }

            tblKullanicilar tblKullanicilar = _ItblKullanicilarService.GetById(StaticValues.LoginId);
            ModelUser       user            = new ModelUser();

            user.name    = tblKullanicilar.Isim;
            user.surname = tblKullanicilar.Soyisim;
            return(View(user));
        }
 public IActionResult Index()
 {
     try
     {
         tblKullanicilar tblKullanicilar = _ItblKullanicilarService.GetById(StaticValues.LoginId);
         ModelUser       user            = new ModelUser();
         user.name    = tblKullanicilar.Isim;
         user.surname = tblKullanicilar.Soyisim;
         return(View(user));
     }
     catch (Exception e)
     {
         return(Redirect("Giris"));
     }
 }
 public static tblKullanicilar Login(string kullaniciAdi, string sifre)
 {
     try
     {
         tblKullanicilar kul = (from k in db.tblKullanicilar
                                where k.kullanici_Ad == kullaniciAdi &&
                                k.kullanici_Sifre == sifre
                                select k).SingleOrDefault();
         return(kul);
     }
     catch (Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
         return(null);
     }
 }
        private void btnGiris_Click(object sender, EventArgs e)
        {
            string          kullaniciAdi = txtKullaniciAdi.Text;
            string          sifre        = txtSifre.Text;
            tblKullanicilar k;

            if ((k = MamiKatmanı.Login(kullaniciAdi, sifre)) != null)
            {
                Kullanici = k;
                MessageBox.Show("Giriş Başarılı", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                Form frmAnaMenü = new frmParent();
                frmAnaMenü.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Kullanıcı adı veya şifre hatalı!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #12
0
 public static string KullaniciEkle(KullaniciView Kullanici)
 {
     try
     {
         using (PersonelOtomasyonDBEntities2 db = new PersonelOtomasyonDBEntities2())
         {
             tblKullanicilar K = new tblKullanicilar();
             K.kullanici_Ad    = Kullanici.KAd;
             K.kullanici_Sifre = Kullanici.Sifre;
             K.type_ID         = Kullanici.Type;
             db.tblKullanicilar.Add(K);
             db.SaveChanges();
             return("Yes");
         }
     }catch (Exception e)
     {
         return("No");
     }
 }
Beispiel #13
0
        public static string KullaniciEkle(string KAd, string Sifre, int Type)
        {
            try
            {
                using (DBOtelEntities db = new DBOtelEntities())
                {
                    tblKullanicilar K = new tblKullanicilar();
                    K.kullaniciID    = KAd;
                    K.kullaniciSifre = Sifre;
                    K.kullaniciTipID = Type;

                    db.tblKullanicilar.Add(K);
                    db.SaveChanges();
                    return("Yes");
                }
            }catch (Exception e)
            {
                return(e.Message);
            }
        }
        public static string KullaniciEkle(string KAd,string Sifre,int Type)
        {
            try
            {
                using (DBOtelEntities db = new DBOtelEntities())
                {
                    tblKullanicilar K = new tblKullanicilar();
                    K.kullaniciID = KAd;
                    K.kullaniciSifre = Sifre;
                    K.kullaniciTipID = Type;

                    db.tblKullanicilar.Add(K);
                    db.SaveChanges();
                    return "Yes";
                }
            }catch(Exception e)
            {
                return e.Message;
            }
        }
        public IActionResult Index(ModelUser model)
        {
            ModelUser user = new ModelUser();

            tblKullanicilar change = _ItblKullanicilarService.GetById(StaticValues.LoginId);

            if (model.password1 == model.password2 && model.password1 != null && model.password1 != "")
            {
                change.Sifre = model.password1;
                _ItblKullanicilarService.Update(change);
                user.isSuccessfull = true;
            }
            else
            {
                user.isSuccessfull = false;
            }
            user.name    = change.Isim;
            user.surname = change.Soyisim;
            return(View(user));
        }
        public IActionResult Index(ModelUser user)
        {
            tblKullanicilar kullanici = kull.GetById(StaticValues.LoginId);
            ModelUser       model     = new ModelUser();

            model.name    = kullanici.Isim;
            model.surname = kullanici.Soyisim;

            tblKullanicilar temp = new tblKullanicilar();

            temp.Soyisim = user.kull.surname;
            temp.Isim    = user.kull.name;
            temp.Id      = kull.GetAll().ToList().Count + 1;
            temp.Sifre   = "123456";
            temp.rol     = user.kull.rolu;
            temp.Mail    = user.kull.mail;
            temp.aktif   = 1;
            kull.Add(temp);
            model.isSuccessfull = true;
            return(View(model));
        }
Beispiel #17
0
        public IActionResult Index()
        {
            string Url = Request.GetDisplayUrl();

            string[]        sub             = Url.Split("/");
            int             length          = sub.Length;
            int             id              = Int32.Parse(sub[length - 1].Substring(0, 1));
            tblKullanicilar tblKullanicilar = _IKullanicilarService.GetById(StaticValues.LoginId);
            ModelUser       model           = new ModelUser();

            if (StaticValues.isİtKanun == 1)
            {
                foreach (var VARIABLE in _IKanunService.GetAll().ToList())
                {
                    if (id == VARIABLE.Id)
                    {
                        model.kanun = VARIABLE;
                    }
                }
            }
            else if (StaticValues.isİtKanun == 2)
            {
                foreach (var VARIABLE in _ITblYonetmenlikService.GetAll().ToList())
                {
                    if (id == VARIABLE.Id)
                    {
                        model.yonetmenlik = VARIABLE;
                    }
                }
            }


            model.name          = tblKullanicilar.Isim;
            model.surname       = tblKullanicilar.Soyisim;
            model.isSuccessfull = null;

            return(View(model));
        }
 public void Update(tblKullanicilar entity)
 {
     _tblKullanicilarDal.Update(entity);
 }
 public void Delete(tblKullanicilar entity)
 {
     _tblKullanicilarDal.Delete(entity);
 }
 public void Add(tblKullanicilar entity)
 {
     _tblKullanicilarDal.Insert(entity);
 }
        public IActionResult Index(ModelUser model)
        {
            tblKullanicilar tblKullanicilar = _ItblKullanicilarService.GetById(StaticValues.LoginId);
            ModelUser       user            = new ModelUser();

            user.name    = tblKullanicilar.Isim;
            user.surname = tblKullanicilar.Soyisim;
            List <TblDuyuru> duyurlar = _itbkDuyuruService.GetAll().ToList();

            string e = model.icerik.Replace(Environment.NewLine, "<br>");

            int temp = duyurlar.Count + 1;;


            _itbkDuyuruService.Add(new TblDuyuru()
            {
                Baslik     = model.baslik,
                Id         = duyurlar.Count + 1,
                UploadTime = DateTime.Now,
                İcerik     = e,
                aktif      = 0
            });

            if (model.resimUrl != null)
            {
                var fileName = _hostingEnvironment.WebRootPath + @"\Main\images\resimler\";
                model.resimUrl.CopyTo(new FileStream(fileName + (_itblResimService.GetAll().ToList().Count + 1) + ".jpg", FileMode.Create));
                string ResimUrl = "images/resimler/" + (_itblResimService.GetAll().ToList().Count + 1) + ".jpg";
                int    temp1    = _itblResimService.GetAll().ToList().Count + 1;
                _itblResimService.Add(new tblResim()
                {
                    Id       = _itblResimService.GetAll().ToList().Count + 1,
                    ResimUrl = ResimUrl
                });
                _itResimDuyuruService.Add(new tblResimDuyuru()
                {
                    DuyuruId = temp,
                    ResimId  = temp1
                });
            }


            if (model.dosyaUrl != null)
            {
                var fileName = _hostingEnvironment.WebRootPath + @"\Main\pdfs\";
                model.dosyaUrl.CopyTo(new FileStream(fileName + (_itblPdfService.GetAll().ToList().Count + 1) + ".pdf",
                                                     FileMode.Create));
                string pdfurl = "pdfs/" + (_itblPdfService.GetAll().ToList().Count + 1) + ".pdf";

                int temp1 = _itblPdfService.GetAll().ToList().Count + 1;
                _itblPdfService.Add(new tblPdf()
                {
                    Id     = _itblPdfService.GetAll().ToList().Count + 1,
                    PdfUrl = pdfurl
                });
                _itblpdfDuyuruService.Add(new tblPdfDuyuru()
                {
                    DuyuruId = temp,
                    PdfId    = temp1
                });
            }

            user.isSuccessfull = true;

            return(View(user));
        }