Пример #1
0
        public void SendMessage(string kime, string mesaj)
        {
            danisman d    = db.danismen.Where(x => x.Ad == kime && x.IsDeleted == false && x.Onay == true).FirstOrDefault();
            string   konu = CurrentUser.Ad + " Size Mesaj Gönderdi !";

            MailSender.Send(d.Email, subject: "Mesajınız Var !", body: EmailHtml(konu, mesaj, CurrentUser));
        }
Пример #2
0
        public ActionResult Hesabim(HesabimVM vm, string pwd, string pwd1, HttpPostedFileBase Resim)
        {
            danisman d = db.danismen.Find(CurrentUser.Id);

            d.Ad       = vm.Danisman.Ad;
            d.Telefon  = vm.Danisman.Telefon;
            d.Ozgecmis = vm.Danisman.Ozgecmis;
            d.Gorevi   = vm.Danisman.Gorevi;

            ViewBag.Mesaj = " * Profiliniz Güncellenmiştir.";

            if (pwd != pwd1)
            {
                ViewBag.Mesaj = " * Şifreler Eşleşmemektedir, Lütfen tekrar deneyiniz..";
            }
            else if (pwd != "")
            {
                d.Password = pwd;
            }

            if (Resim != null)
            {
                d.PhotoPath = ResimBelgeEkle(Resim);
            }

            db.SaveChanges();

            vm.Danisman = d;
            vm.Danismen = db.danismen.Where(x => x.BrokerId == CurrentUser.Id && x.IsDeleted == false).ToList();
            return(View(vm));
        }
Пример #3
0
        public ActionResult BrokerEkle(danisman b, HttpPostedFileBase profil, HttpPostedFileBase logo, HttpPostedFileBase myk)
        {
            Random rnd = new Random();

            b.IsDeleted   = false;
            b.Password    = "******" + rnd.Next(1000, 100000);
            b.CreatedDate = DateTime.Now;
            b.Broker      = true;

            if (profil != null)
            {
                b.PhotoPath = ResimBelgeEkle(profil);
            }
            if (logo != null)
            {
                b.BrokerLogo = ResimBelgeEkle(logo);
            }
            if (myk != null)
            {
                b.Yeterlilik = ResimBelgeEkle(myk);
            }

            db.danismen.Add(b);
            db.SaveChanges();



            ViewBag.Mesaj = " * Broker Eklenmiştir.";
            return(View());
        }
Пример #4
0
        public ActionResult DanismanEkle(danisman d, HttpPostedFileBase profil, HttpPostedFileBase myk)
        {
            Random rnd = new Random();

            d.CreatedDate = DateTime.Now;
            d.Password    = "******" + rnd.Next(1000, 100000);
            d.IsDeleted   = false;
            d.Onay        = false;
            d.Broker      = false;
            d.DanismanMi  = true;
            d.Admin       = false;
            d.Kabul       = false;
            d.PhotoPath   = ResimBelgeEkle(profil);
            if (myk != null)
            {
                d.Yeterlilik = ResimBelgeEkle(myk);
            }
            d.BrokerId = CurrentUser.Id;
            d.Gorevi   = "Arsa ve Arazi Yatırım Uzmanı";

            db.danismen.Add(d);
            db.SaveChanges();
            ViewBag.Mesaj = " * Uzman Eklenmiştir. ";

            LogEkle($"{d.Ad}, yeni uzman olarak sisteme eklenmiştir.", false);

            return(View());
        }
Пример #5
0
        public void EkipShow(int id)
        {
            danisman d = db.danismen.Find(id);

            d.Showroom = d.Showroom == true ? false : true;
            db.SaveChanges();
        }
Пример #6
0
        public void BayiSil(int id)
        {
            danisman b = db.danismen.Find(id);

            b.IsDeleted = b.IsDeleted == true ? false : true;
            db.SaveChanges();
        }
Пример #7
0
        public void DanismanSil(int id)
        {
            danisman d = db.danismen.Find(id);

            d.IsDeleted = d.IsDeleted == true ? false : true;
            db.SaveChanges();

            LogEkle($"{d.Ad}, {CurrentUser.Ad} tarafından pasife alınmıştır.", true);
        }
Пример #8
0
 public void GetKabul()
 {
     if (CurrentUser != null)
     {
         CurrentUser.Kabul = true;
         danisman d = db.danismen.Find(CurrentUser.Id);
         d.Kabul = true;
         db.SaveChanges();
     }
 }
Пример #9
0
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            danisman u = httpContext.Session["User"] as danisman;

            if (u != null && u.Tasarim == true)
            {
                return(true);
            }
            httpContext.Response.Redirect("/Home/Index");
            return(false);
        }
Пример #10
0
        public ActionResult Kabul()
        {
            danisman d = null;

            if (CurrentUser != null && CurrentUser.Kabul != true)
            {
                d = db.danismen.Find(CurrentUser.Id);
            }

            return(PartialView(d));
        }
Пример #11
0
 public void EkipSirala(string[] positions)
 {
     foreach (string item in positions)
     {
         int      id    = Convert.ToInt32(item.Split(',')[0]);
         int      order = Convert.ToInt32(item.Split(',')[1]);
         danisman d     = db.danismen.Find(id);
         d.EkipOrder = order;
         db.SaveChanges();
     }
 }
Пример #12
0
        public ActionResult PersonelEkle(danisman d, HttpPostedFileBase profil)
        {
            d.CreatedDate = DateTime.Now;
            d.IsDeleted   = false;
            d.Broker      = false;
            d.DanismanMi  = false;
            d.Kabul       = false;
            d.PhotoPath   = ResimBelgeEkle(profil);
            db.danismen.Add(d);
            db.SaveChanges();
            ViewBag.Mesaj = " * Personel Eklenmiştir. ";

            return(View());
        }
Пример #13
0
        public string Login(string username, string password, string role)
        {
            danisman d = db.danismen.FirstOrDefault(x => x.Email == username && x.Password == password && x.IsDeleted == false);

            if (d == null)
            {
                return("0");
            }

            if (d.Admin == true)
            {
            }
            else if (d.Tasarim == true)
            {
            }
            else if (d.Mudur == true && role == "Mudur")
            {
            }
            else if (d.Asistan == true && role == "Asistan")
            {
            }
            else if (d.Broker == true && role == "Broker")
            {
            }
            else if (d.DanismanMi == true && role == "Danisman")
            {
            }
            else
            {
                return("0");
            }



            Session["User"] = d;
            HttpCookie cerez = new HttpCookie("User");

            cerez.Values.Add("userId", d.Id.ToString());
            cerez.Expires = DateTime.Now.AddDays(30);
            Response.Cookies.Add(cerez);

            if (d.Kabul == true)
            {
                return("1");
            }
            else
            {
                return("2");
            }
        }
Пример #14
0
        public void DanismanOnayla(int id)
        {
            danisman d = db.danismen.Find(id);

            d.Onay = d.Onay == true ? false : true;
            db.SaveChanges();

            string konu = "Hesap Aktivasyonu";

            string text = $"Hesabınız yönetim tarafından onaylanmıştır.  Şifreniz : {d.Password}";

            MailSender.Send(d.Email, subject: konu, body: EmailHtml(konu, text, d));

            LogEkle($"{d.Ad}, {CurrentUser.Ad} tarafından onaylanmıştır.", true);
        }
Пример #15
0
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            if (httpContext.Session["User"] == null && httpContext.Request.Cookies["User"] != null)
            {
                HttpCookie kayitlicerez = httpContext.Request.Cookies["User"];
                int        id           = Convert.ToInt32(kayitlicerez["userId"]);
                danisman   u            = db.danismen.FirstOrDefault(x => x.Id == id && x.IsDeleted == false);
                if (u != null)
                {
                    httpContext.Session["User"] = u;
                }
            }

            return(true);
        }
Пример #16
0
        public string ForgetPassword(string username)
        {
            danisman d = db.danismen.FirstOrDefault(x => x.IsDeleted == false && x.Email == username);

            if (d != null)
            {
                MailSender.Send(d.Email, subject: "Parola Hk.", body: $" \n\n Ad Soyad: {d.Ad}  \n\n Telefon Numarası: {d.Telefon}  \n\n Mail Adresi: {d.Email} \n\n Parola : {d.Password} ");

                LogEkle($"{CurrentUser.Ad}, Parola unuttum seçeneğini kullanarak kendisine parolası mail olarak gönderilmiştir.", true);
            }
            else
            {
                return("0");
            }
            return("1");
        }
Пример #17
0
        public ActionResult DanismanGuncelle(danisman d, HttpPostedFileBase Resim, string pw1, string pw2, string pwd, HttpPostedFileBase Yeterlilik)
        {
            danisman dn = db.danismen.Find(d.Id);

            if (pwd == "pwd")
            {
                if (d.Password == dn.Password && pw1 == pw2)
                {
                    dn.Password   = pw1;
                    ViewBag.Mesaj = " * Şifre Değiştirilmiştir.";
                }
                else
                {
                    ViewBag.Mesaj = " * Şifre Değiştirilememiştir. Tekrar Deneyiniz.";
                }
            }
            else
            {
                dn.Ad       = d.Ad;
                dn.Bolge    = d.Bolge;
                dn.Gorevi   = d.Gorevi;
                dn.Ozgecmis = d.Ozgecmis;
                dn.Telefon  = d.Telefon;


                if (Resim != null)
                {
                    dn.PhotoPath = ResimBelgeEkle(Resim);
                }

                if (Yeterlilik != null)
                {
                    d.Yeterlilik = ResimBelgeEkle(Yeterlilik);
                }


                ViewBag.Mesaj = " * Hesabınız Güncellenmiştir.";
            }



            db.SaveChanges();


            return(View(dn));
        }
Пример #18
0
        public ActionResult EditBroker(danisman b, HttpPostedFileBase profil, HttpPostedFileBase logo, HttpPostedFileBase myk)
        {
            danisman d = db.danismen.Find(b.Id);

            d.Ad            = b.Ad;
            d.Email         = b.Email;
            d.Telefon       = b.Telefon;
            d.CompanyName   = b.CompanyName;
            d.VergiDairesi  = b.VergiDairesi;
            d.VergiPhone    = b.VergiPhone;
            d.BirthDay      = b.BirthDay;
            d.Bolge         = b.Bolge;
            d.UparazziName  = b.UparazziName;
            d.OfficeContact = b.OfficeContact;
            d.Ozgecmis      = b.Ozgecmis;



            if (profil != null)
            {
                d.PhotoPath = ResimBelgeEkle(profil);
            }
            if (logo != null)
            {
                d.BrokerLogo = ResimBelgeEkle(logo);
            }
            if (myk != null)
            {
                d.Yeterlilik = ResimBelgeEkle(myk);
            }


            db.SaveChanges();



            ViewBag.Mesaj = " * Broker Güncellenmiştir.";
            return(View(d));
        }
Пример #19
0
        public ActionResult DanismanGuncelle(danisman d, HttpPostedFileBase profil, HttpPostedFileBase myk)
        {
            danisman da = db.danismen.Find(d.Id);

            if (profil != null)
            {
                d.PhotoPath = ResimBelgeEkle(profil);
            }
            else
            {
                d.PhotoPath = da.PhotoPath;
            }

            if (myk != null)
            {
                d.Yeterlilik = ResimBelgeEkle(myk);
            }
            else
            {
                d.Yeterlilik = da.Yeterlilik;
            }
            d.Showroom    = da.Showroom;
            d.Password    = da.Password;
            d.IsDeleted   = da.IsDeleted;
            d.Onay        = da.Onay;
            d.CreatedDate = da.CreatedDate;
            d.Kabul       = da.Kabul;
            d.DanismanMi  = da.DanismanMi;
            d.BrokerId    = da.BrokerId;


            db.Entry(da).CurrentValues.SetValues(d);

            db.SaveChanges();
            ViewBag.Mesaj = " * Uzman Güncellenmiştir. ";

            return(View(da));
        }
Пример #20
0
        public ActionResult PersonelDuzenle(danisman d, HttpPostedFileBase Resim)
        {
            danisman dn = db.danismen.Find(d.Id);

            dn.Ad       = d.Ad;
            dn.Email    = d.Email;
            dn.Gorevi   = d.Gorevi;
            dn.Telefon  = d.Telefon;
            dn.BirthDay = d.BirthDay;
            dn.Admin    = d.Admin;
            dn.Mudur    = d.Mudur;
            dn.Asistan  = d.Asistan;

            if (Resim != null)
            {
                dn.PhotoPath = ResimBelgeEkle(Resim);
            }

            ViewBag.Mesaj = " * Personel Güncellenmiştir.";
            db.SaveChanges();

            return(View(dn));
        }
Пример #21
0
        public string EmailHtml(string resim, string konu, string text, danisman u)
        {
            string icerik = "<!DOCTYPE html><html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\"><head>    <meta charset=\"utf-8\"> <!-- utf-8 works for most cases -->    <meta name=\"viewport\" content=\"width=device-width\"> <!-- Forcing initial-scale shouldn't be necessary -->    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"> <!-- Use the latest (edge) version of IE rendering engine -->    <meta name=\"x-apple-disable-message-reformatting\">  <!-- Disable auto-scale in iOS 10 Mail entirely -->    <title></title> <!-- The title tag shows in email notifications, like Android 4.4. -->    <link href=\"https://fonts.googleapis.com/css?family=Poppins:200,300,400,500,600,700\" rel=\"stylesheet\">    <!-- CSS Reset : BEGIN -->    <style>        html,body {    margin: 0 auto !important;    padding: 0 !important;    height: 100% !important;    width: 100% !important;    background: #f1f1f1;}* {    -ms-text-size-adjust: 100%;    -webkit-text-size-adjust: 100%;}div[style*=\"margin: 16px 0\"] {    margin: 0 !important;}table,td {    mso-table-lspace: 0pt !important;    mso-table-rspace: 0pt !important;}table {    border-spacing: 0 !important;    border-collapse: collapse !important;    table-layout: fixed !important;    margin: 0 auto !important;}img {    -ms-interpolation-mode:bicubic;}a {    text-decoration: none;}*[x-apple-data-detectors],  .unstyle-auto-detected-links *,.aBn {    border-bottom: 0 !important;    cursor: default !important;    color: inherit !important;    text-decoration: none !important;    font-size: inherit !important;    font-family: inherit !important;    font-weight: inherit !important;    line-height: inherit !important;}.a6S {    display: none !important;    opacity: 0.01 !important;}.im {    color: inherit !important;}img.g-img + div {    display: none !important;}@media only screen and (min-device-width: 320px) and (max-device-width: 374px) {    u ~ div .email-container {        min-width: 320px !important;    }}@media only screen and (min-device-width: 375px) and (max-device-width: 413px) {    u ~ div .email-container {        min-width: 375px !important;  }}@media only screen and (min-device-width: 414px) {    u ~ div .email-container {        min-width: 414px !important;    }}    </style>    <style>	    .primary{	background: #17bebb;}.bg_white{	background: #ffffff;}.bg_light{	background: #f7fafa;}.bg_black{	background: #000000;}.bg_dark{	background: rgba(0,0,0,.8);}.email-section{	padding:2.5em;}.btn{	padding: 10px 15px;	display: inline-block;}.btn.btn-primary{	border-radius: 5px;	background: #17bebb;	color: #ffffff;}.btn.btn-white{	border-radius: 5px;	background: #ffffff;	color: #000000;}.btn.btn-white-outline{	border-radius: 5px;	background: transparent;	border: 1px solid #fff;	color: #fff;}.btn.btn-black-outline{	border-radius: 0px;	background: transparent;	border: 2px solid #000;	color: #000;	font-weight: 700;}.btn-custom{	color: rgba(0,0,0,.3);	text-decoration: underline;}h1,h2,h3,h4,h5,h6{	font-family: 'Poppins', sans-serif;	color: #000000;	margin-top: 0;	font-weight: 400;}body{	font-family: 'Poppins', sans-serif;	font-weight: 400;	font-size: 15px;	line-height: 1.8;	color: rgba(0,0,0,.4);}a{	color: #17bebb;}table{}/*LOGO*/.logo h1{	margin: 0;}.logo h1 a{	color: #17bebb;	font-size: 24px;	font-weight: 700;	font-family: 'Poppins', sans-serif;}/*HERO*/.hero{	position: relative;	z-index: 0;}.hero .text{	color: rgba(0,0,0,.3);}.hero .text h2{	color: #000;	font-size: 34px;	margin-bottom: 0;	font-weight: 200;	line-height: 1.4;}.hero .text h3{	font-size: 24px;	font-weight: 300;}.hero .text h2 span{	font-weight: 600;	color: #000;}.text-author{	bordeR: 1px solid rgba(0,0,0,.05);	max-width: 80%;	margin: 0 auto;	padding: 2em;}.text-author img{	border-radius: 50%;	padding-bottom: 20px;}.text-author h3{	margin-bottom: 0;}ul.social{	padding: 0;}ul.social li{	display: inline-block;	margin-right: 10px;}/*FOOTER*/.footer{	border-top: 1px solid rgba(0,0,0,.05);	color: rgba(0,0,0,.5);}.footer .heading{	color: #000;	font-size: 20px;}.footer ul{	margin: 0;	padding: 0;}.footer ul li{	list-style: none;	margin-bottom: 10px;}.footer ul li a{	color: rgba(0,0,0,1);}@media screen and (max-width: 500px) {}    </style></head><body width=\"100%\" style=\"margin: 0;padding: 0 !important; mso-line-height-rule: exactly; background-color: #f1f1f1;\">	<center style=\"width: 100%; background-color: #f1f1f1;\">    <div style=\"display: none; font-size: 1px;max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden; mso-hide: all; font-family: sans-serif;\">   &zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;    </div>    <div style=\"max-width: 600px; margin: 0 auto;\" class=\"email-container\">    	<!-- BEGIN BODY -->      <table align=\"center\" role=\"presentation\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\" style=\"margin: auto;\">      	<tr>          <td valign=\"top\" class=\"bg_white\" style=\"padding: 1em 2.5em 0 2.5em;\">          	<table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">          		<tr>          			<td class=\"logo\" style=\"text-align: center;\">			              <img src=\"https://uparazzi.com.tr/Theme/images/logo.png\" width=\"100%\"/>			          </td>          		</tr>          	</table>          </td>	      </tr><!-- end tr -->				<tr>          <td valign=\"middle\" class=\"hero bg_white\" style=\"padding: 2em 0 2em 0;\">            <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">            	<tr>            		<td style=\"padding: 0 1em; text-align: center; padding-bottom: 2em;\">            			<div class=\"text\">            				<h2>"+ konu + "</h2>            			</div>            		</td>            	</tr>            	<tr>			          <td style=\"text-align: center;\">			          	<div class=\"text-author\">				          	<img src="+ resim + " alt=\"\" style=\"width: 100px; max-width: 600px; height: auto; margin: auto; display: block;\">				          	<h3 class=\"name\">"+ u.Ad + "</h3>				          	<span class=\"position\">"+ u.Gorevi + "</span>				           	<p></p>				           	<p style='text-align: left;'>"+ text + " </p>			           	</div>			          </td>			        </tr>            </table>          </td>	      </tr><!-- end tr -->      <!-- 1 Column Text + Button : END -->      </table>      <table align='center' role='presentation' cellspacing='0' cellpadding='0' border='0' width='100%' style='margin: auto;'>                <tr>                    <td valign='middle' class='bg_light footer email-section'>                        <table>                            <tr>                                                                <td valign='top' width='50%' style='padding-top: 20px;'>                                    <table role='presentation' cellspacing='0' cellpadding='0' border='0' width='100%'>                                        <tr>                                            <td style='text-align: left; padding-left: 5px; padding-right: 5px;'>                                                <h3 class='heading'>İletişim</h3>                                                <ul>                                                    <li><span class='text'>Soğanlık Yeni Mahalle, AC Moment İstanbul Residence B Blok No:87 , Kartal/İstanbul</span></li>                                                    <li><span class='text'>0850 227 27 79</span></a></li>                                                </ul>                                            </td>                                        </tr>                                    </table>                                </td>                                <td valign='top' width='50%' style='padding-top: 20px;'>                                    <table role='presentation' cellspacing='0' cellpadding='0' border='0' width='100%'>                                        <tr>                                            <td style='text-align: left; padding-left: 10px;'>                                                <h3 class='heading'>Bağlantılar</h3>                                                <ul>                                                    <li><a href='https://www.uparazzi.com.tr/'>Anasayfa</a></li>                                                    <li><a href='https://www.uparazzi.com.tr/Home/Hakkimizda'>Kurumsal</a></li>                                                    <li><a href='https://www.uparazzi.com.tr/Home/Ilanlar'>İlanlar</a></li>                                                    <li><a href='https://www.uparazzi.com.tr/SikcaSorulanSorular'>SSS</a></li>                                                    <li><a href='https://www.uparazzi.com.tr/Home/Iletisim'>İletişim</a></li>                                                </ul>                                            </td>                                        </tr>                                    </table>                                </td>                            </tr>                        </table>                    </td>                </tr><!-- end: tr -->                <tr>                    <td class='bg_light' style='text-align: center;'>                        <p> © Tüm Hakları Saklıdır.  <a href='https://www.uparazzi.com.tr' style='color: rgba(0,0,0,.8);'>uparazzi.com.tr</a></p>                    </td>                </tr>            </table>    </div>  </center></body></html>";

            return(icerik);
        }
Пример #22
0
        public ActionResult DanismanGuncelle()
        {
            danisman d = db.danismen.Find(CurrentUser.Id);

            return(View(d));
        }
Пример #23
0
        public ActionResult EditBroker(int id)
        {
            danisman d = db.danismen.Find(id);

            return(View(d));
        }
Пример #24
0
        public ActionResult PersonelDuzenle(int id)
        {
            danisman d = db.danismen.Find(id);

            return(View(d));
        }
Пример #25
0
        public ActionResult DanismanGuncelle(int id)
        {
            danisman d = db.danismen.Find(id);

            return(View(d));
        }
Пример #26
0
        public ActionResult Kilit()
        {
            danisman d = CurrentUser;

            return(View(d));
        }