Пример #1
0
        private void btnGiriş_Click_1(object sender, EventArgs e)
        {
            var kullaniciWebService = new KullaniciWebService();
            var sifre = Encrypt(txtPassword.Text);
            var model = kullaniciWebService.GetByUsernamePassword(txtUsername.Text, sifre);

            if (model != null)
            {
                sirketId = Convert.ToInt16(model.sirketID);
                if (model.rolID == 1)
                {
                    aracKiralaMenu.Visible        = true;
                    kiralamaTalepleriMenu.Visible = true;
                    kiralamaGecmisiMenu.Visible   = true;
                    cikisMenu.Visible             = true;
                }
                else if (model.rolID == 2)
                {
                    aracKiralaMenu.Visible        = true;
                    kiralamaTalepleriMenu.Visible = true;
                    kiralamaGecmisiMenu.Visible   = true;
                    tumAraclarMenu.Visible        = true;
                    calisanlarMenu.Visible        = true;
                    cikisMenu.Visible             = true;
                }
                grbGiris.Visible = false;
            }
        }
Пример #2
0
        public void calisanListele()
        {
            grbCalisanlar.Visible      = true;
            grbGiris.Visible           = false;
            grbAracBilgileri.Visible   = false;
            grbAracKirala.Visible      = false;
            grbKiralamaGecmisi.Visible = false;
            grbTalepler.Visible        = false;
            grbTarihBilgileri.Visible  = false;
            grpAllCars.Visible         = false;
            grbCalisanlar.Width        = 1200;
            grbCalisanlar.Height       = 400;
            dgwCalisanlar.Width        = 1100;
            grbCalisanlar.Location     = new Point(50, 50);
            KullaniciWebService kullaniciWebService = new KullaniciWebService();
            var model = kullaniciWebService.Get(sirketId);

            dgwCalisanlar.DataSource = model;

            btnSil.Enabled = false;

            dgwCalisanlar.Columns[0].Visible = false;
            dgwCalisanlar.Columns[1].Visible = false;
            dgwCalisanlar.Columns[3].Visible = false;
            dgwCalisanlar.Columns[4].Visible = false;
            dgwCalisanlar.Columns[7].Visible = false;
            dgwCalisanlar.Columns[8].Visible = false;
        }
      public ActionResult Sil(int id)
      {
          KullaniciWebService kullaniciWebService = new KullaniciWebService();

          kullaniciWebService.Delete(id);
          return(RedirectToAction("Index"));
      }
      // GET: Calisanlar
      public ActionResult Index()
      {
          KullaniciWebService kulaniciWebService = new KullaniciWebService();
          var model = kulaniciWebService.Get(Convert.ToInt16(Session["sirketId"]));

          return(View(model));
      }
Пример #5
0
        private void btnSil_Click(object sender, EventArgs e)
        {
            KullaniciWebService kullaniciWebService = new KullaniciWebService();

            kullaniciWebService.Delete(calisanId);
            calisanListele();
            btnSil.Enabled         = false;
            btnCalisanEkle.Enabled = true;
        }
      public ActionResult CalisanEkle(Kullanici kullanici)
      {
          KullaniciWebService kullaniciWebService = new KullaniciWebService();

          kullanici.rolID    = 1;
          kullanici.sirketID = Convert.ToInt16(Session["sirketId"].ToString());
          var sifre = Encrypt(kullanici.password);

          kullanici.password = sifre;
          kullaniciWebService.Add(kullanici);
          return(RedirectToAction("Index"));
      }
Пример #7
0
        private void btnCalisanEkle_Click(object sender, EventArgs e)
        {
            KullaniciWebService kullaniciWebService = new KullaniciWebService();
            Kullanici           kullanici           = new Kullanici();

            kullanici.adi      = txtCalisanAd.Text;
            kullanici.soyadi   = txtCalisanSoyad.Text;
            kullanici.username = txtCalisanUsername.Text;
            kullanici.password = Encrypt(txtCalisanpwd.Text);
            kullanici.rolID    = 1;
            kullanici.sirketID = sirketId;

            kullaniciWebService.Add(kullanici);
            calisanListele();
        }
        public ActionResult Login(string username, string password)
        {
            password = Encrypt(password);
            KullaniciWebService kullaniciWebService = new KullaniciWebService();
            var model = kullaniciWebService.GetByUsernamePassword(username, password);

            if (model != null)
            {
                FormsAuthentication.SetAuthCookie(model.username, false);
                Session["sirketId"] = model.sirketID;
                Session["rolId"]    = model.rolID;
                return(RedirectToAction("Index", "AracCalisan"));
            }
            else
            {
                return(RedirectToAction("Login"));
            }
        }