Пример #1
0
 void Success(Hesap hsp)
 {
     try
     {
         CustomizeControl1.ControlList.Clear();
         CustomizeControl1.PanelVisible = false;
         string m_MailMesaj = BAYMYO.UI.FileIO.ReadText(Server.MapPath(Settings.ViewPath) + "Activation.view");
         m_MailMesaj = m_MailMesaj.Replace("%SiteUrl%", Settings.SiteUrl);
         m_MailMesaj = m_MailMesaj.Replace("%SiteTitle%", Settings.Site.Title);
         m_MailMesaj = m_MailMesaj.Replace("%VirtualPath%", Settings.VirtualPath);
         m_MailMesaj = m_MailMesaj.Replace("%ReturnUrl%", Request.QueryString["ReturnUrl"]);
         m_MailMesaj = m_MailMesaj.Replace("%ID%", hsp.ID.ToString());
         m_MailMesaj = m_MailMesaj.Replace("%Adi%", hsp.Adi).Replace("%Soyadi%", hsp.Soyadi);
         m_MailMesaj = m_MailMesaj.Replace("%OnayKodu%", hsp.OnayKodu);
         Core.SendMail(hsp.Mail, hsp.Adi + " " + hsp.Soyadi, "Aktivasyon Maili", m_MailMesaj, true);
         m_MailMesaj = null;
         Response.Redirect(Settings.VirtualPath + "?go=register&r=aktivasyon", false);
     }
     catch (Exception)
     {
         CustomizeControl1.MessageText = MessageBox.Show(DialogResult.Stop, string.Format("Hesabınız oluşturuldu fakat sunucmuzdaki yoğunluk sebebi ile <b>Aktivasyon Maili</b> <u>gönderilemedi</u>! Lütfen tekrar <b>Aktivasyon Maili</b> talebinde bulunmak için <a href=\"{0}\" target=\"_self\">buraya tıklayın</a>.", Settings.VirtualPath + "?go=register&r=aktivasyon"));
         CustomizeControl1.ControlList.Clear();
         CustomizeControl1.PanelVisible = false;
     }
 }
Пример #2
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            string IbanOlustur = "1515";
            Random rnd         = new Random();

            for (int i = 0; i < 5; i++)
            {
                int sayi = rnd.Next(1000, 9999);


                IbanOlustur += sayi.ToString();
            }

            Hesap h = new Hesap();

            h.MusteriId = MusteriID;
            h.IBAN      = IbanOlustur;
            h.Bakiye    = 0;
            h.Aktif     = true;
            h.HesapAdi  = txtHesapAdi.Text;
            m.Hesap.Add(h);
            m.SaveChanges();
            MessageBox.Show("Yeni Hesap Oluşturuldu", "Bilgi");

            this.Close();
        }
Пример #3
0
        public bool Ekle(Hesap entity, int MusteriID, string HesapNo)
        {
            _rowsAffected = 0;

            try
            {
                var query = new StringBuilder();
                query.Append("INSERT INTO [dbo].[tblHesap] ");
                query.Append(" ([MusteriID],[Bakiye],[HesapNo],[Durum])");
                query.Append("VALUES ");
                query.Append(
                    "( @MusteriID, @Bakiye, @HesapNo, @Durum ) ");


                var commandText = query.ToString();
                query.Clear();

                using (var dbConnection = _dbProviderFactory.CreateConnection())
                {
                    if (dbConnection == null)
                    {
                        throw new ArgumentNullException("dbConnection", "The db connection can't be null.");
                    }

                    dbConnection.ConnectionString = _connectionString;

                    using (var dbCommand = _dbProviderFactory.CreateCommand())
                    {
                        if (dbCommand == null)
                        {
                            throw new ArgumentNullException("dbCommand" + " The db Insert command for entity [tblHesap] can't be null. ");
                        }

                        dbCommand.Connection  = dbConnection;
                        dbCommand.CommandText = commandText;

                        //Input Params
                        DBHelper.AddParameter(dbCommand, "@MusteriID", MusteriID);
                        DBHelper.AddParameter(dbCommand, "@Bakiye", entity.Bakiye);
                        DBHelper.AddParameter(dbCommand, "@HesapNo", HesapNo);
                        DBHelper.AddParameter(dbCommand, "@Durum", "Açık");

                        //Open Connection
                        if (dbConnection.State != ConnectionState.Open)
                        {
                            dbConnection.Open();
                        }

                        //Execute query
                        _rowsAffected = dbCommand.ExecuteNonQuery();
                    }
                }
                //Return the results of query/ies
                return(true);
            }
            catch (Exception ex)
            {
                throw new Exception("HesapRepository:Ekleme Hatası", ex);
            }
        }
Пример #4
0
        public ActionResult Yatir(ParaViewModel model)
        {
            BusinessLayerResult <ParaViewModel> layerResult = new BusinessLayerResult <ParaViewModel>();

            if (ModelState.IsValid)
            {
                if (Decimal.Parse(model.Tutar) == 0)
                {
                    layerResult.Errors.Add("0'dan başka bir tutar giriniz");
                }
                else
                {
                    long  hesap = model.ParaHesapNo;
                    Hesap hes   = hesapManager.Find(x => x.HesapNo == hesap);

                    decimal para = Decimal.Parse(model.Tutar);

                    hes.Bakiye = (hes.Bakiye + para);

                    hesapManager.Update(hes);
                    return(RedirectToAction("Index"));
                }

                if (layerResult.Errors.Count > 0)
                {
                    layerResult.Errors.ForEach(x => ModelState.AddModelError("", x));
                    return(View(model));
                }
                return(RedirectToAction("Index"));
            }

            return(View(model));
        }
Пример #5
0
        static void Main(string[] args)
        {
            // temsilciler - delegate

            //Hesap hesap = Topla;
            //int sonuc = hesap(5, 4);

            //hesap = Carp;

            //Console.WriteLine("Carp : " + hesap(5,4));

            //Console.WriteLine(sonuc);

            //Hesap hesap = new Hesap(Topla);
            //Console.WriteLine("Topla : " +hesap(5,4));
            //hesap=new Hesap(Cikar);
            //Console.WriteLine("Çıkar : "+hesap(5,4));

            Hesap hesap = new Hesap(Topla);
            int   sonuc = hesap.Invoke(4, 4);

            Console.WriteLine(sonuc);



            Console.ReadKey();
        }
Пример #6
0
        public ActionResult HgsSatis(HgsSatis hgsSatis)
        {
            BusinessLayerResult <HgsSatis> layerResult = new BusinessLayerResult <HgsSatis>();
            HgsSatisManager hgsSatisManager            = new HgsSatisManager();

            if (ModelState.IsValid)
            {
                HGS   hgs        = hgsManager.Find(x => x.HgsNo == hgsSatis.HgsNo);
                Hesap kullanilan = hesapManager.Find(x => x.HesapNo == hgsSatis.HesapNo);

                if (kullanilan == null)
                {
                    layerResult.Errors.Add("Girilen alıcı hesap numarası yanlış veya eksik");
                }
                else if (hgsSatis.Tutar.ToString() == null || hgsSatis.Tutar == 0)
                {
                    layerResult.Errors.Add("Lütfen 0'dan başka bir tutar giriniz");
                }
                else if (kullanilan.Bakiye < hgsSatis.Tutar)
                {
                    layerResult.Errors.Add("Yetersiz bakiye");
                }
                else
                {
                    ServiceReference1.HgsWebServiceSoapClient servis = new ServiceReference1.HgsWebServiceSoapClient();
                    decimal bakiye = Convert.ToDecimal(servis.hgsSatis(hgs.HgsBakiyesi, hgs.HgsID, hgsSatis.Tutar));

                    if (bakiye.ToString() != null)
                    {
                        hgsSatis.Zaman = DateTime.Now;

                        kullanilan.Bakiye = (kullanilan.Bakiye - hgsSatis.Tutar);
                        hesapManager.Update(kullanilan);


                        hgs.HgsBakiyesi = hgs.HgsBakiyesi + hgsSatis.Tutar;
                        hgsManager.Update(hgs);

                        hgsSatisManager.Insert(hgsSatis);
                    }
                }

                if (layerResult.Errors.Count > 0)
                {
                    layerResult.Errors.ForEach(x => ModelState.AddModelError("", x)); List <Hesap> hesaplar = new List <Hesap>();
                    foreach (Hesap hes in hesapManager.List())
                    {
                        if (hes.MusteriNo == CurrentSession.User.MusteriNo && hes.Bakiye != 0)
                        {
                            hesaplar.Add(hes);
                        }
                    }
                    //ViewBag.hgsler = new SelectList(hgsler, "HgsNo", "HgsNo");
                    TempData["hesaplar"] = new SelectList(hesaplar, "HesapNo", "HesapNo");
                    return(View(hgsSatis));
                }
                return(RedirectToAction("HgsBilgi", "HGS", new { id = hgs.HgsID }));
            }
            return(View(hgsSatis));
        }
Пример #7
0
        public ActionResult DeleteConfirmed(int id)
        {
            Hesap hesap = hesapManager.Find(x => x.HesapID == id);

            //hesapManager.Delete(hesap);
            return(RedirectToAction("Index"));
        }
Пример #8
0
    {//Temsilcilerin amacı bir ya da birden fazla methodu temsil etmektir yani işaret bir pointerdır.
        static void Main(string[] args)
        {
            Hesap hesap = Topla;  //senin adın hesap olacak ve sen topla adında bir methodu temsil edeceksin.
            int   sonuc = hesap(5, 4);

            Console.WriteLine("Topla: " + sonuc);
            hesap = Carp;
            Console.WriteLine("Carp: " + hesap(5, 4));
            hesap = Cıkar;
            Console.WriteLine("Cıkar: " + hesap(5, 20));
            hesap = Bol;
            Console.WriteLine("Bol: " + hesap(5, 1));
            //delegateslerin yerleride çok önemlidir atadıktan sonra yazılan methodun çıktı yazılımını hemen ardından yazmamız gerekir.

            Hesap hesabı = new Hesap(Topla);

            Console.WriteLine("Topla: " + hesabı(5, 4));
            hesabı = new Hesap(Cıkar);
            Console.WriteLine("Cıkar: " + hesabı(5, 4));
            //Bu şekilde de yazılabilir.

            Hesap hesapet = new Hesap(Topla);
            int   sonucu  = hesap.Invoke(4, 4);

            Console.WriteLine(sonucu);
            //bir değer kullanım ınvoke da kendi içerisindeki referansı çağırıyor(ınvoke=çağırmak)
            Console.ReadLine();
        }
Пример #9
0
        public ActionResult Edit(Hesap hesap)
        {
            BusinessLayerResult <Hesap> layerResult = new BusinessLayerResult <Hesap>();

            if (ModelState.IsValid)
            {
                Hesap hes = hesapManager.Find(x => x.HesapID == hesap.HesapID);
                if (hes.Bakiye != 0)
                {
                    layerResult.Errors.Add("Lütfen hesabınızdaki parayı çekip tekrar deneyin");
                }
                else
                {
                    hes.Durum = false;

                    hesapManager.Update(hes);
                    return(RedirectToAction("Index"));
                }

                if (layerResult.Errors.Count > 0)
                {
                    layerResult.Errors.ForEach(x => ModelState.AddModelError("", x));

                    return(View(hesap));
                }
            }

            return(View(hesap));
        }
        public ActionResult HesapAyar(Hesap gelenhesap, string parola1, string parola2)
        {
            var hesap = db.Hesaps.Where(w => w.HesapID == 1).SingleOrDefault();

            if (hesap != null)
            {
                hesap.AdSoyad = gelenhesap.AdSoyad;
                hesap.Eposta  = gelenhesap.Eposta;
                if (gelenhesap.Parola != null && gelenhesap.Parola == hesap.Parola)
                {
                    if (parola1 == parola2)
                    {
                        hesap.Parola = parola1;
                    }
                }
                else
                {
                    ModelState.AddModelError("", "Hatalı parola girdiniz. Parolanızı hatırlamıyorsanız hesabınızdan çıkış yaparak şifrenizi yenileyebilirsiniz.");
                    return(View(hesap));
                }

                db.SaveChanges();
            }
            return(RedirectToAction("Index"));
        }
Пример #11
0
        public bool Transfer(string GonderenHesapNo, string AlanHesapNo, decimal Miktar)
        {
            try
            {
                Hesap GonderenHesap = null;
                Hesap AlanHesap     = null;
                using (var repo = new HesapRepository())
                {
                    GonderenHesap = repo.HesapNoSec(GonderenHesapNo);
                    if (GonderenHesap.Bakiye >= Miktar)
                    {
                        AlanHesap = repo.HesapNoSec(AlanHesapNo);

                        repo.HesapNoBakiyeGuncelle(GonderenHesapNo, GonderenHesap.Bakiye - Miktar);
                        repo.HesapNoBakiyeGuncelle(AlanHesapNo, AlanHesap.Bakiye + Miktar);
                        return(true);
                    }
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw new Exception("HesapBusiness:HesapRepository:Seçme Hatası", ex);
            }
        }
Пример #12
0
 void CreateTicket(Hesap member)
 {
     try
     {
         Session["UserInfo"] = member;
         FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
             1,                                    //Ticket versiyonu (şu andadaki güncel versiyon 1’dir)
             member.Adi,                           //ticket ile ilgili olan txtusername
             DateTime.Now,                         //şu anki zamanı alıyor.
             DateTime.Now.AddDays(30),             //yaratılan cookie’nin zamanını ayarlıyor.
             false,                                //yaratılan cookie’nin IsPErsistent özelliğini false yapıyor.
             member.Roller,                        // kullanıcının rollerle ilgili bilgisini alıyor.
             FormsAuthentication.FormsCookiePath); // yaratılan cookie’nin yolunu belirtiyor.
                                                   // FormsAuthenticationTicket ile yaratılan cookie’yi şifreliyoruz.
         string     encTicket = FormsAuthentication.Encrypt(ticket);
         HttpCookie cookie    = new HttpCookie(FormsAuthentication.FormsCookieName, encTicket);
         // Eğer FormsAuthenticationTicket ile yaratılan cookie’nin expiration süresi
         //sınırsız ise, bu cookie’ye ticket nesnesinin Expiration süresi atanıyor.
         if (ticket.IsPersistent)
         {
             cookie.Expires = ticket.Expiration;
         }
         Response.Cookies.Add(cookie);
     }
     catch (Exception)
     {
     }
 }
Пример #13
0
        public bool BorcOde(int AboneNo, string HesapNo)
        {
            var repo2 = new HesapRepository();

            try
            {
                using (var repo = new OdemeRepository())
                {
                    Odeme o      = repo.AboneNoSec(AboneNo);
                    Hesap h      = repo2.HesapNoSec(HesapNo);
                    var   bakiye = h.Bakiye;
                    var   borc   = o.Borc;
                    if (borc > 0 && borc <= bakiye)
                    {
                        bakiye -= borc;
                        borc    = 0;
                        repo2.HesapBakiyeGuncelle(h.HesapID, bakiye);
                        repo.BorcOde(AboneNo);

                        return(true);
                    }
                }
                return(false);
            }
            catch (Exception ex)
            {
                throw new Exception("OdemeBusiness:OdemeRepository:Ödeme Hatası", ex);
            }
        }
Пример #14
0
        public ActionResult Virman(int?id)
        {
            //@Html.DropDownListFor(model => model.HesapNo, new SelectList(ViewBag.HesapList, "HesapNo", "Bakiye" ))
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Hesap hesap = hesapManager.Find(x => x.HesapID == id.Value);

            if (hesap == null)
            {
                return(HttpNotFound());
            }

            Transfer tran = new Transfer();

            tran.GonderenHesapNo = hesap.HesapNo;

            List <Hesap> hesaplar = new List <Hesap>();

            foreach (Hesap hes in hesapManager.List())
            {
                if (hes.MusteriNo == CurrentSession.User.MusteriNo && hes.Durum == true && hes.HesapNo != hesap.HesapNo)
                {
                    hesaplar.Add(hes);
                }
            }
            TempData["hesaplar"] = new SelectList(hesaplar, "HesapNo", "HesapNo");

            return(View(tran));
        }
Пример #15
0
        public IActionResult HesapKapat([FromBody] Hesap h)
        {
            var EkNo     = h.EkNo;
            var tc       = User.Claims.FirstOrDefault().Value;
            var musteri  = uow.Musteriler.Find(x => x.TcKimlikNo.Equals(tc)).FirstOrDefault();
            var hesaplar = uow.Hesaplar.Find(x => x.MusteriNo == musteri.MusteriNo && x.Aktif == true).ToList();

            if (hesaplar.Count == 1 && hesaplar.FirstOrDefault().Bakiye > 0)
            {
                return(BadRequest(new
                {
                    error = "Hesabınızdaki parayı çekmelisiniz."
                }));
            }
            var digerHesap   = hesaplar.Find(x => x.EkNo != EkNo);
            var silinenHesap = hesaplar.Find(x => x.EkNo == EkNo);

            digerHesap.Bakiye  += silinenHesap.Bakiye;
            silinenHesap.Aktif  = false;
            silinenHesap.Bakiye = 0;
            uow.Hesaplar.Edit(digerHesap);
            uow.SaveChanges();

            uow.Hesaplar.Edit(silinenHesap);
            uow.SaveChanges();
            return(Ok(new {
                data = "Hesap başarıyla silindi, bakiye diğer hesaba aktarıldı."
            }));
        }
Пример #16
0
        public static bool MapsSaved(string point, string zoom, string title, string description)
        {
            if (Core.IsUserActive & !string.IsNullOrEmpty(point))
            {
                System.Threading.Thread.Sleep(3000);
                Hesap hsp = Core.CurrentUser;
                if (hsp != null)
                {
                    if (!string.IsNullOrEmpty(hsp.ID) & hsp.Aktif)
                    {
                        switch (hsp.Tipi)
                        {
                        case AccountType.None:
                        case AccountType.Standart:
                            return(false);

                        default:
                            string[] kordinatlar = point.Replace("(", "").Replace(")", "").Replace(" ", "").Split(',');
                            jSonData.CreateFile("maps", hsp.ID.ToString(),
                                                new Maps
                            {
                                Lat         = kordinatlar[0],
                                Lng         = kordinatlar[1],
                                Zoom        = zoom,
                                Title       = title,
                                Description = description
                            });
                            return(true);
                        }
                    }
                }
            }
            return(false);
        }
Пример #17
0
        public ActionResult AdminParolaYenile(Hesap user)
        {
            var sorgu = (from i in db.Hesaps where i.Eposta.Equals(user.Eposta) select i).SingleOrDefault();

            if (sorgu != null)
            {
                Guid randomkey = Guid.NewGuid();//32 karakterli randomkodu üret

                var apyenisifre = randomkey.ToString().Substring(0, 5);
                sorgu.Parola = apyenisifre;
                db.SaveChanges();

                MailMessage mail = new MailMessage();
                mail.IsBodyHtml = true;
                mail.To.Add(sorgu.Eposta);
                mail.From       = new MailAddress("*****@*****.**", "WebSite Yönetim Paneli", System.Text.Encoding.UTF8);
                mail.Subject    = "Şifre Güncelleme Talebi";
                mail.Body       = "Merhaba <b>" + sorgu.AdSoyad + "</b>,<br><br> Şifre Yenileme Talebiniz Alınmıştır.<br> Panel Giriş kodunuz: <b>" + apyenisifre + "</b> <br><br>Aşağıdaki linke tıklayarak yukarıdaki kod ile yönetim panelinize giriş yapabilir ve şifrenizi güncelleyebilirsiniz. </br><br> <a style='text-decoration:none;' href='http://*****:*****@gmail.com", "site-mail-sifre");
                smp.Port        = 587;
                smp.Host        = "smtp.gmail.com";
                smp.EnableSsl   = true;
                smp.Send(mail);

                ViewBag.success = "Şifre yenileme talebiniz eposta adresinize gönderilmiştir.";
                return(View());
            }
            else
            {
                ViewBag.uyari = "Eposta adresi bulunamadı!";
                return(View(user));
            }
        }
Пример #18
0
        public ActionResult AdminGiris(Hesap user, string benihatirla)
        {
            var login = db.Hesaps.Where(w => w.Eposta == user.Eposta && w.Parola == user.Parola).SingleOrDefault();

            if (login != null)
            {
                //beni hatirla yeni isaretlenmisse
                if (benihatirla == "on")
                {
                    HttpCookie adminpanelcerez = new HttpCookie("ManagerLoginCerez");
                    adminpanelcerez.Values.Add("CerezAdsoyad", login.AdSoyad);
                    adminpanelcerez.Values.Add("CerezYetki", login.Yetki);

                    adminpanelcerez.Expires = DateTime.Now.AddDays(30);//30gün boyunca hatirla
                    Response.Cookies.Add(adminpanelcerez);
                }
                Session["ManagerAdmin"] = login.AdSoyad.ToString();
                Session["ManagerYetki"] = login.Yetki;

                return(RedirectToAction("Index", "APManager"));
            }
            else
            {
                ViewBag.LoginHata = "Giriş bilgileriniz hatalı..";
                return(View());
            }
        }
Пример #19
0
        public async Task <IActionResult> Register([FromBody] MusteriRegisterDto musteriRegisterDto)
        {
            if (await _authRepository.UserExists(musteriRegisterDto.TCKN))
            {
                ModelState.AddModelError("UserExist", "Username already exists");
            }
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            int myRandomNo;

            while (true)
            {
                Random rnd = new Random();
                myRandomNo = rnd.Next(10000000, 99999999);
                if (!UniqueHesapNo(myRandomNo.ToString()))
                {
                    break;
                }
            }
            Musteri musteri = new Musteri
            {
                Ad     = musteriRegisterDto.Ad,
                Soyad  = musteriRegisterDto.Soyad,
                TCKN   = musteriRegisterDto.TCKN,
                Sifre  = musteriRegisterDto.Sifre,
                Adres  = musteriRegisterDto.Adres,
                EPosta = musteriRegisterDto.EPosta,
                TelNo  = musteriRegisterDto.TelNo,
            };
            var remusteri = await _authRepository.Register(musteri);

            if (remusteri == null)
            {
                return(BadRequest(ModelState));
            }
            Hesap hesap = new Hesap
            {
                AktiflikDurumu = true,
                BakiyeBilgi    = 0,
                EkNo           = 1000,
                HesapNo        = myRandomNo.ToString(),
                Musteri        = musteri,
                TCKN           = musteri.TCKN
            };

            _appRepository.Add(hesap);

            if (!_appRepository.SaveAll())
            {
                return(BadRequest(ModelState));
            }

            return(StatusCode(201));
        }
Пример #20
0
        public void ParaCek_BakiyeSifirAltinaDuserse_ArgumentOutOfRangeHatasiFirlatmali()
        {
            // arrange: test ön hazýrlýk
            decimal baslangicBakiye = 100;
            decimal cekilecekTutar  = 110;
            Hesap   hesap           = new Hesap("Ali Yýlmaz", baslangicBakiye);

            // act & assert: eylem ve iddia
            Assert.ThrowsException <ArgumentOutOfRangeException>(() => hesap.ParaCek(cekilecekTutar));
        }
Пример #21
0
        void standartHesap_SubmitClick(SortedDictionary <string, Control> controls)
        {
            if (Core.IsUserActive
                & !string.IsNullOrEmpty(((TextBox)controls["hspAdi"]).Text)
                & !string.IsNullOrEmpty(((TextBox)controls["hspMail"]).Text))
            {
                using (Hesap hsp = Core.CurrentUser)
                {
                    hsp.IP     = Context.Request.ServerVariables["REMOTE_ADDR"].ToString();
                    hsp.Adi    = ((TextBox)controls["hspAdi"]).Text;
                    hsp.Soyadi = ((TextBox)controls["hspSoyadi"]).Text;
                    hsp.Mail   = ((TextBox)controls["hspMail"]).Text;
                    if (!string.IsNullOrEmpty((controls["hspSifre"] as TextBox).Text.Trim()))
                    {
                        string sifre = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile((controls["hspSifre"] as TextBox).Text, "md5");
                        if (!hsp.Sifre.Equals(sifre))
                        {
                            hsp.Sifre = sifre;
                            string m_MailMesaj = BAYMYO.UI.FileIO.ReadText(Server.MapPath(Settings.ViewPath) + "PasswordNew.view");
                            m_MailMesaj = m_MailMesaj.Replace("%SiteUrl%", Settings.SiteUrl);
                            m_MailMesaj = m_MailMesaj.Replace("%SiteTitle%", Settings.Site.Title);
                            m_MailMesaj = m_MailMesaj.Replace("%VirtualPath%", Settings.VirtualPath);
                            m_MailMesaj = m_MailMesaj.Replace("%IP%", Context.Request.ServerVariables["REMOTE_ADDR"].ToString());
                            m_MailMesaj = m_MailMesaj.Replace("%ID%", hsp.ID.ToString());
                            m_MailMesaj = m_MailMesaj.Replace("%Adi%", hsp.Adi).Replace("%Soyadi%", hsp.Soyadi);
                            m_MailMesaj = m_MailMesaj.Replace("%Mail%", hsp.Mail);
                            m_MailMesaj = m_MailMesaj.Replace("%Sifre%", ((TextBox)controls["hspSifre"]).Text);
                            Core.SendMail(hsp.Mail, hsp.Adi + " " + hsp.Soyadi, "Şifre Değiştirildi", m_MailMesaj, true);
                            m_MailMesaj = null;
                        }
                    }
                    hsp.DogumTarihi = ((DateTimeControl)controls["DogumTarihi"]).Date;
                    hsp.Cinsiyet    = Core.GetSexType(BAYMYO.UI.Converts.NullToByte(((DropDownList)controls["hspCinsiyet"]).SelectedValue));
                    hsp.OnayKodu    = Core.GenerateSecurityCode();
                    hsp.Abonelik    = ((CheckBox)controls["hspAbonelik"]).Checked;

                    if (!string.IsNullOrEmpty(hsp.ID))
                    {
                        switch (HesapMethods.Update(hsp))
                        {
                        case "EMAIL":
                            CustomizeControl1.MessageText = MessageBox.Show(DialogResult.Stop, "Kayıt olmak istediğiniz <b>'E-Mail'</b> adresi başkası tarafından kullanılıyor! Lütfen başka bir 'E-Mail' adresi ile tekrar deneyiniz yada eğer bu e-mail adresinin sizin olduğundan eminseniz şifremi unuttum kısımından tekrar şifre talebinde bulununuz!");
                            break;

                        default:
                            CustomizeControl1.MessageText = MessageBox.Show(ProccesType.Update, DialogResult.Succes);
                            break;
                        }
                    }
                }
            }
        }
Пример #22
0
 void CustomizeControl1_SubmitClick(SortedDictionary <string, Control> controls)
 {
     if (!string.IsNullOrEmpty(Request.QueryString["g"]) & !string.IsNullOrEmpty(Request.QueryString["s"]))
     {
         using (TextBox txtSifre = controls["sifre"] as TextBox)
         {
             if (!string.IsNullOrEmpty(txtSifre.Text.Trim()))
             {
                 using (BAYMYO.MultiSQLClient.MParameterCollection param = new BAYMYO.MultiSQLClient.MParameterCollection())
                 {
                     param.Add("id", Request.QueryString["g"], BAYMYO.MultiSQLClient.MSqlDbType.VarChar);
                     param.Add("onaykodu", Request.QueryString["s"], BAYMYO.MultiSQLClient.MSqlDbType.VarChar);
                     using (Hesap m = HesapMethods.GetHesap(System.Data.CommandType.Text, "select * from hesap where id=?id and onaykodu=?onaykodu and aktivasyon=1 and aktif=1 limit 1", param))
                     {
                         if (!string.IsNullOrEmpty(m.ID))
                         {
                             m.OnayKodu = Core.GenerateSecurityCode();
                             m.Sifre    = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(txtSifre.Text.Trim(), "md5");
                             if (!string.IsNullOrEmpty(HesapMethods.Update(m)))
                             {
                                 string m_MailMesaj = BAYMYO.UI.FileIO.ReadText(Server.MapPath(Settings.ViewPath) + "PasswordNew.view");
                                 m_MailMesaj = m_MailMesaj.Replace("%SiteUrl%", Settings.SiteUrl);
                                 m_MailMesaj = m_MailMesaj.Replace("%SiteTitle%", Settings.Site.Title);
                                 m_MailMesaj = m_MailMesaj.Replace("%VirtualPath%", Settings.VirtualPath);
                                 m_MailMesaj = m_MailMesaj.Replace("%ReturnUrl", Request.QueryString["ReturnUrl"]);
                                 m_MailMesaj = m_MailMesaj.Replace("%IP%", Context.Request.ServerVariables["REMOTE_ADDR"].ToString());
                                 m_MailMesaj = m_MailMesaj.Replace("%ID%", m.ID.ToString());
                                 m_MailMesaj = m_MailMesaj.Replace("%Adi%", m.Adi).Replace("%Soyadi%", m.Soyadi);
                                 m_MailMesaj = m_MailMesaj.Replace("%Mail%", m.Mail);
                                 m_MailMesaj = m_MailMesaj.Replace("%Sifre%", txtSifre.Text);
                                 Core.SendMail(m.Mail, m.Adi + " " + m.Soyadi, "Şifre Değiştirildi", m_MailMesaj, true);
                                 CustomizeControl1.MessageText  = MessageBox.Show(DialogResult.Succes, string.Format("Şifre değiştirme işleminiz başarılı bir şekilde gerçekleştirildi. Lütfen sisteme giriş yapmak için <a class=\"toolTip\" title=\"Üye girişi yapmak için tıklayın!\" href=\"{0}\">buraya tıklayın</a>.", Settings.VirtualPath + "?go=login"));
                                 CustomizeControl1.PanelVisible = false;
                                 m_MailMesaj = null;
                             }
                             else
                             {
                                 CustomizeControl1.MessageText  = MessageBox.UnSuccessful();
                                 CustomizeControl1.PanelVisible = false;
                             }
                         }
                         else
                         {
                             CustomizeControl1.MessageText  = MessageBox.UnSuccessful();
                             CustomizeControl1.PanelVisible = false;
                         }
                     }
                 }
             }
         }
     }
 }
Пример #23
0
        void standartHesap_SubmitClick(SortedDictionary <string, Control> controls)
        {
            try
            {
                if (!string.IsNullOrEmpty(((TextBox)controls["rgsAdi"]).Text)
                    & !string.IsNullOrEmpty(((TextBox)controls["rgsMail"]).Text)
                    & !string.IsNullOrEmpty(((TextBox)controls["rgsSifre"]).Text))
                {
                    using (Hesap hsp = new Hesap())
                    {
                        hsp.IP          = Context.Request.ServerVariables["REMOTE_ADDR"].ToString();
                        hsp.Adi         = ((TextBox)controls["rgsAdi"]).Text;
                        hsp.Soyadi      = ((TextBox)controls["rgsSoyadi"]).Text;
                        hsp.Mail        = ((TextBox)controls["rgsMail"]).Text;
                        hsp.Sifre       = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile((controls["rgsSifre"] as TextBox).Text, "md5");
                        hsp.Roller      = "U";
                        hsp.OnayKodu    = Core.GenerateSecurityCode();
                        hsp.DogumTarihi = ((DateTimeControl)controls["rgsDogumTarihi"]).Date;
                        hsp.Cinsiyet    = Core.GetSexType(BAYMYO.UI.Converts.NullToByte(((DropDownList)controls["rgsCinsiyet"]).SelectedValue));
                        hsp.Tipi        = AccountType.Standart;
                        hsp.Abonelik    = ((CheckBox)controls["rgsAbonelik"]).Checked;
                        hsp.Yorum       = true;
                        hsp.Aktivasyon  = false;
                        hsp.Aktif       = false;
                        hsp.KayitTarihi = DateTime.Now;
                        string result = BAYMYO.UI.Converts.NullToString(HesapMethods.Insert(hsp));
                        switch (result)
                        {
                        case "EMAIL":
                            CustomizeControl1.MessageText = MessageBox.Show(DialogResult.Stop, "Kayıt olmak istediğiniz <b>'E-Mail'</b> adresi başkası tarafından kullanılıyor! Lütfen başka bir 'E-Mail' adresi ile tekrar deneyiniz yada eğer bu e-mail adresinin sizin olduğundan eminseniz şifremi unuttum kısımından tekrar şifre talebinde bulununuz!");
                            break;

                        default:
                            if (!result.Equals(BAYMYO.UI.Converts.NullToGuidString(null)))
                            {
                                hsp.ID = result;
                                Success(hsp);
                            }
                            else
                            {
                                CustomizeControl1.MessageText = MessageBox.Show(DialogResult.Error, "Üyelik işleminiz gerçekleştirilemiyor. Lütfen bilgilerinizi kontrol edip tekrar deneyiniz!");
                            }
                            break;
                        }
                    }
                }
            }
            catch (Exception)
            {
                CustomizeControl1.MessageText = MessageBox.Show(DialogResult.Error, "Üyelik işleminiz gerçekleştirilemiyor. Lütfen bilgilerinizi kontrol edip tekrar deneyiniz!");
            }
        }
Пример #24
0
 public static bool MapsRemove(string subPath, string fileName)
 {
     if (Core.IsUserActive)
     {
         System.Threading.Thread.Sleep(3000);
         Hesap hsp = Core.CurrentUser;
         if (!string.IsNullOrEmpty(subPath) & !string.IsNullOrEmpty(fileName))
         {
             return(BAYMYO.UI.FileIO.Remove(HttpContext.Current.Server.MapPath(Settings.JSonPath + "maps/" + subPath + "/" + fileName + ".js")));
         }
     }
     return(false);
 }
Пример #25
0
        // GET: Hesap/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Hesap hesap = hesapManager.Find(x => x.HesapID == id.Value);

            if (hesap == null)
            {
                return(HttpNotFound());
            }
            return(View(hesap));
        }
Пример #26
0
        public IHttpActionResult Ekle(int id, int ek)
        {
            Hesap hesap = new Hesap();

            hesap.Bakiye    = 0;
            hesap.Durum     = "Açık";
            hesap.MusteriID = id;
            if (ModelState.IsValid)
            {
                var olusturulanHesap = business.HesapEkle(hesap, id, ek);
                return(Ok(olusturulanHesap));
            }
            return(BadRequest());
        }
Пример #27
0
        //private void ekle_click(object sender ,EventArgs e)
        //{
        //    SirketDataContext context = new SirketDataContext();
        //    Departmanlar departmanlar = new Departmanlar();

        //    departmanlar.DepartmanAdi = txtDepartmanAdi.Text;
        //    departmanlar.DepartmanTanimi = txtDepartmanTanimi.Text;
        //    departmanlar.DepartmanMudurAdi = txtDepartmanMudurAdi.Text;
        //    departmanlar.DepartmanCalisanSayisi = int.Parse(txtCalisanSayisi.Text);
        //    context.Departmanlar.add(departmanlar);
        //    context.SaveChanges();
        //    MessageBox.Show("Eklendi !");
        //}
        private void btnUyeOl_Click(object sender, EventArgs e)
        {
            string  IbanOlustur = "1515";
            Musteri musteri     = new Musteri();

            musteri.KimlikNo        = txtTcNo.Text;
            musteri.Ad              = txtAd.Text;
            musteri.Soyad           = txtSoyad.Text;
            musteri.Mail            = txtMail.Text;
            musteri.TelefonNumarasi = txtTelefon.Text;
            musteri.Sehir           = Convert.ToInt32(cmbSehir.SelectedValue.ToString());
            musteri.Sifre           = txtSifre.Text;
            musteri.Aktif           = true;


            m.Musteri.Add(musteri);
            m.SaveChanges();

            var degerler = m.Musteri.Where(x => x.KimlikNo == txtTcNo.Text).FirstOrDefault();

            Random rnd = new Random();

            for (int i = 0; i < 5; i++)
            {
                int sayi = rnd.Next(1000, 9999);


                IbanOlustur += sayi.ToString();
            }

            Hesap hesap = new Hesap();

            hesap.MusteriId = degerler.Id;
            hesap.IBAN      = IbanOlustur;
            hesap.Bakiye    = 0;
            hesap.HesapAdi  = "Ana Hesap";
            hesap.Aktif     = true;

            m.Hesap.Add(hesap);
            m.SaveChanges();


            MessageBox.Show("Yeni Üyelik Başarıyla Oluşturuldu", "Bilgi");
            this.Hide();
            FrmLogin frm = new FrmLogin();

            frm.Show();
        }
Пример #28
0
        public HesapDTO Map(Hesap ent)
        {
            var hesap = new HesapDTO();

            hesap.hesapNo           = ent.hesapNo;
            hesap.musteriNo         = ent.musteriNo;
            hesap.ad                = ent.Musteri.ad;
            hesap.soyad             = ent.Musteri.soyad;
            hesap.hesapAcilisTarihi = ent.hesapAcilisTarihi;
            hesap.bakiye            = ent.bakiye;
            hesap.ekNo              = ent.ekNo;
            hesap.acilisPlatformID  = ent.acilisPlatformID;
            hesap.acilisPlatformAdi = ent.AcilisPlatformu.acilisPlatformAdi;

            return(hesap);
        }
Пример #29
0
 public ActionResult Kayit(Hesap Hesap)
 {
     using (BankaEntities db = new BankaEntities())
     {
         if (Hesap.Id == 0)//ekleme
         {
             db.Hesaps.Add(Hesap);
         }
         else //güncelle
         {
             db.Entry(Hesap).State = System.Data.Entity.EntityState.Modified;
         }
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
 }
Пример #30
0
        public void ParaCekme_DogruMiktarla_BakiyeGunceller()
        {
            // arrange: test ön hazýrlýk
            decimal baslangicBakiye = 76.40m;
            decimal cekilecekTutar  = 19.63m;
            decimal beklenen        = 56.77m;
            Hesap   hesap           = new Hesap("Ali Yýlmaz", baslangicBakiye);

            // act: eylem
            hesap.ParaCek(cekilecekTutar);

            // assert: iddia
            decimal gercek = hesap.Bakiye;

            Assert.AreEqual(beklenen, gercek, "Para doðru çekilemedi.");
        }