public JsonResult newKullanici(string password, string password_control, string mail_permission, string sms_permission)
        {
            try
            {
                if (password.Equals(string.Empty))
                {
                    return(Json(JsonSonuc.sonucUret(false, "Şifre alanı boş bırakılamaz."), JsonRequestBehavior.AllowGet));
                }
                if (!password.Equals(password_control))
                {
                    return(Json(JsonSonuc.sonucUret(false, "Girdiğiniz şifreler eşleşmiyor. Lütfen şifrelerinizi kontrol edip tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
                }

                kullaniciIslemleri mic   = new kullaniciIslemleri();
                string             sonuc = mic.yeniKullanici(password, password_control, mail_permission, sms_permission, Request);
                if (sonuc.Equals("") || sonuc.Equals("email_unique") ||
                    sonuc.Equals("username_unique") || sonuc.Equals("kullanici_sayisi_hatasi"))
                {
                    if (sonuc.Equals("email_unique"))
                    {
                        return(Json(JsonSonuc.sonucUret(false, "Girdiğiniz e-Mail adresini başka bir kullanıcı kullanmaktadır. Lütfen farklı bir e-Mail adresi deneyiniz."), JsonRequestBehavior.AllowGet));
                    }
                    else if (sonuc.Equals("username_unique"))
                    {
                        return(Json(JsonSonuc.sonucUret(false, "Girdiğiniz kullanıcı adını başka bir kullanıcı kullanmaktadır. Lütfen farklı bir kullanıcı adı deneyiniz."), JsonRequestBehavior.AllowGet));
                    }
                    else if (sonuc.Equals("kullanici_sayisi_hatasi"))
                    {
                        return(Json(JsonSonuc.sonucUret(false, "Bu firmaya başka kullanıcı eklenemez."), JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        return(Json(JsonSonuc.sonucUret(false, "Bir hata oluştu. Lütfen daha sonra tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
                    }
                }

                return(Json(JsonSonuc.sonucUret(true, sonuc), JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                if (e.InnerException != null && e.InnerException.ToString().Contains("email_unique"))
                {
                    return(Json(JsonSonuc.sonucUret(false, "Girdiğiniz e-Mail adresini başka bir kullanıcı kullanmaktadır. Lütfen farklı bir e-Mail adresi deneyiniz."), JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(JsonSonuc.sonucUret(false, "Bir hata oluştu. Lütfen daha sonra tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
                }
            }
        }
Exemple #2
0
        public JsonSonuc projeYuzdesiDuzenle(int proje_id)
        {
            try
            {
                LoggedUserModel    lgm            = GetCurrentUser.GetUser();
                vrlfgysdbEntities  db             = new vrlfgysdbEntities();
                proje_surec        prj            = db.proje_surec.Where(e => e.id == proje_id).FirstOrDefault();
                List <gorev_proje> projeGorevList = db.gorev_proje.Where(e => e.proje_id == proje_id && e.flag == durumlar.aktif).ToList();

                int toplam        = 0;
                int aktifGorevler = 0;
                foreach (gorev_proje pg in projeGorevList)
                {
                    if (pg.gorevler.flag == durumlar.aktif)
                    {
                        toplam += pg.gorevler.yuzde;
                        aktifGorevler++;
                    }
                }

                if (aktifGorevler != 0)
                {
                    prj.yuzde = toplam / aktifGorevler;
                }
                else
                {
                    prj.yuzde = toplam;
                }

                prj.durum = TamamlamaDurumlari.basladi;

                db.Entry(prj).State = EntityState.Modified;
                db.SaveChanges();

                if (prj.yuzde == 100)
                {
                    List <kullanicilar> yetkiliList = db.kullanicilar.Where(e => e.flag == durumlar.aktif && e.firma_id == lgm.firma_id && e.kullanici_turu <= KullaniciTurleri.firma_yetkili).ToList();
                    foreach (kullanicilar usr in yetkiliList)
                    {
                        bildirimIslemleri.yeniBildirim(usr.id, BildirimTurleri.proje, prj.id, "", prj.isim + " isimli proje tamamlandı ve onayınızı bekliyor.");
                    }
                }

                return(JsonSonuc.sonucUret(true, prj.yuzde));
            }
            catch (Exception e)
            {
                return(JsonSonuc.sonucUret(false, "Proje yüzdesini düzenlerken bir hata oluştu."));
            }
        }
Exemple #3
0
        public static JsonSonuc okunduIsaretle(string url)
        {
            try
            {
                vrlfgysdbEntities db = new vrlfgysdbEntities();

                string queryGorevCount = "update mesajlar set flag = " + durumlar.aktif + " where parent_url = '" + url + "'";
                db.Database.ExecuteSqlCommand(queryGorevCount);

                return(JsonSonuc.sonucUret(true, "Mesaj Gönderildi."));
            }
            catch (Exception e)
            {
                return(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."));
            }
        }
 public JsonResult mesajGonder(string url)
 {
     try
     {
         mesajIslemleri mic   = new mesajIslemleri();
         JsonSonuc      sonuc = mic.yeniMesaj(Request);
         if (sonuc.Equals("") || sonuc.Equals("proje_sayisi_hatasi"))
         {
             return(Json(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
         }
         return(Json(JsonSonuc.sonucUret(true, sonuc), JsonRequestBehavior.AllowGet));
     }
     catch (Exception e)
     {
         return(Json(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
     }
 }
        public JsonResult YardimDuzenle(string url, string icerik)
        {
            try
            {
                yardim yrd     = db.yardim.Where(e => e.url.Equals(url)).FirstOrDefault();
                string tempUrl = yrd.url;
                foreach (var property in yrd.GetType().GetProperties())
                {
                    try
                    {
                        var response = Request[property.Name];
                        if (response == null)
                        {
                            if (response == null)
                            {
                                continue;
                            }
                        }
                        else
                        {
                            PropertyInfo propertyS = yrd.GetType().GetProperty(property.Name);
                            if (property.PropertyType == typeof(decimal))
                            {
                                propertyS.SetValue(yrd, Convert.ChangeType(Decimal.Parse(response.Replace('.', ',')), property.PropertyType), null);
                            }
                            else
                            {
                                propertyS.SetValue(yrd, Convert.ChangeType(response, property.PropertyType), null);
                            }
                        }
                    }
                    catch (Exception)
                    { }
                }
                yrd.url             = tempUrl;
                yrd.icerik          = icerik;
                db.Entry(yrd).State = EntityState.Modified;
                db.SaveChanges();

                return(Json(JsonSonuc.sonucUret(true, yrd.url), JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                return(Json(JsonSonuc.sonucUret(false, "Bir hata oluştu. Lütfen tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
            }
        }
        public async Task <JsonResult> mesajList(string url, string son_tarih, int once1Sonra2)
        {
            try
            {
                DateTime        dt              = DateTime.Parse(son_tarih);
                LoggedUserModel lgm             = GetCurrentUser.GetUser();
                string          queryGorevCount = "";
                if (once1Sonra2 == 1)
                {
                    queryGorevCount = "select m.* "
                                      + "from mesajlar as m "
                                      + "where m.flag != " + durumlar.silindi + " and m.date < DATE_FORMAT('" + dt.ToString("yyyy-MM-dd HH:mm:ss") + " ','%Y-%m-%d %H:%i:%s') and m.parent_url = '" + url + "' and m.firma_id = " + lgm.firma_id + " and (m.alan_id = " + lgm.id + " or m.gonderen_id = " + lgm.id + ") order by m.date desc Limit " + mesajSize.ToString() + ";";
                }
                else
                {
                    queryGorevCount = "select m.* "
                                      + "from mesajlar as m "
                                      + "where m.flag != " + durumlar.silindi + " and m.date > DATE_FORMAT('" + dt.ToString("yyyy-MM-dd HH:mm:ss") + " ','%Y-%m-%d %H:%i:%s') and m.parent_url = '" + url + "' and m.firma_id = " + lgm.firma_id + " and (m.alan_id = " + lgm.id + " or m.gonderen_id = " + lgm.id + ") order by m.date;";
                }

                var m = db.Database.SqlQuery <MesajlarDetayModel>(queryGorevCount).ToListAsync();

                await Task.WhenAll(m);

                List <MesajlarDetayModel> mesajList = m.Result;

                if (mesajList.Count != 0 && mesajList[0].alan_id == lgm.id)
                {
                    mesajIslemleri.okunduIsaretle(mesajList[0].parent_url);
                }

                if (once1Sonra2 == 1)
                {
                    return(Json(JsonSonuc.sonucUret(true, mesajList), JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(JsonSonuc.sonucUret(true, mesajList.OrderBy(e => e.date).ToList()), JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception e)
            {
                return(Json(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
            }
        }
        public async Task <JsonResult> getFirmaMusteri(string firma_id)
        {
            try
            {
                string queryGorevCount = "select * from musteriler where flag = " + durumlar.aktif.ToString() + " and firma_id = " + firma_id + ";";

                var m = db.Database.SqlQuery <MusterilerModel>(queryGorevCount).ToListAsync();

                await Task.WhenAll(m);

                List <MusterilerModel> musteriList = m.Result;
                return(Json(JsonSonuc.sonucUret(true, musteriList.OrderBy(e => e.date).ToList()), JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                return(Json(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
            }
        }
Exemple #8
0
        public static JsonSonuc bildirimDuzenle(int vid, int firma_id, HttpRequestBase Request)
        {
            try
            {
                vrlfgysdbEntities db = new vrlfgysdbEntities();

                sistem_bildirimleri dbPrj = db.sistem_bildirimleri.Where(e => e.vid.Equals(vid) && e.flag != durumlar.silindi).FirstOrDefault();

                db.Entry(dbPrj).State = EntityState.Modified;
                db.SaveChanges();

                return(JsonSonuc.sonucUret(true, dbPrj.ilgili_url));
            }
            catch (Exception e)
            {
                return(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."));
            }
        }
Exemple #9
0
        public JsonResult editFirmaMusavir(string url)
        {
            try
            {
                firmaMusavirIslemleri mic = new firmaMusavirIslemleri();
                string sonuc = mic.firmaMusavirDuzenle(url, Request);
                if (sonuc.Equals(""))
                {
                    return(Json(JsonSonuc.sonucUret(false, "Bir hata oluştu. Lütfen daha sonra tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
                }

                return(Json(JsonSonuc.sonucUret(true, sonuc), JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                return(Json(JsonSonuc.sonucUret(false, "Bir hata oluştu. Lütfen daha sonra tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
            }
        }
        public JsonSonuc yapilacakAktiflestir(string url)
        {
            try
            {
                vrlfgysdbEntities db    = new vrlfgysdbEntities();
                yapilacaklar      yplck = db.yapilacaklar.Where(e => e.url.Equals(url)).FirstOrDefault();
                int eskiYuzde           = yplck.gorevler.yuzde;
                yplck.durum           = YapilacaklarDurum.beklemede;
                db.Entry(yplck).State = EntityState.Modified;
                db.SaveChanges();

                return(JsonSonuc.sonucUret(true, "Yapılacaklar listesi düzenlendi."));
            }
            catch (Exception e)
            {
                return(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."));
            }
        }
Exemple #11
0
        public JsonSonuc silProje(string url, int firma_id)
        {
            try
            {
                vrlfgysdbEntities db  = new vrlfgysdbEntities();
                proje_surec       prj = null;
                if (firma_id != 0)
                {
                    prj = db.proje_surec.Where(e => e.url.Equals(url) && e.firma_id == firma_id).FirstOrDefault();
                }
                else
                {
                    prj = db.proje_surec.Where(e => e.url.Equals(url)).FirstOrDefault();
                }
                if (prj == null)
                {
                    return(JsonSonuc.sonucUret(false, "Proje bulunamadı."));
                }
                //prj.flag = durumlar.silindi;
                prj.durum           = TamamlamaDurumlari.pasif;
                db.Entry(prj).State = EntityState.Modified;
                db.SaveChanges();

                List <gorev_proje> projeGorevList = db.gorev_proje.Where(e => e.flag == durumlar.aktif && e.proje_id == prj.id).ToList();
                gorevIslemleri     gis            = new gorevIslemleri();
                foreach (gorev_proje gp in projeGorevList)
                {
                    if (gp.gorevler != null)
                    {
                        //gis.silGorev(gp.gorevler.url);
                        gp.gorevler.durum           = TamamlamaDurumlari.pasif;
                        db.Entry(gp.gorevler).State = EntityState.Modified;
                    }
                }

                db.SaveChanges();
            }
            catch (Exception)
            {
                return(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."));
            }
            return(JsonSonuc.sonucUret(true, "Proje pasif edildi."));
        }
 public JsonResult silMusteri(string id)
 {
     try
     {
         musteriler mstr = db.musteriler.Where(e => e.url.Equals(id)).FirstOrDefault();
         if (mstr == null)
         {
             return(Json(JsonSonuc.sonucUret(false, "Müşteri/Mükellef bulunamadı."), JsonRequestBehavior.AllowGet));
         }
         mstr.flag            = durumlar.silindi;
         db.Entry(mstr).State = EntityState.Modified;
         db.SaveChanges();
     }
     catch (Exception)
     {
         return(Json(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
     }
     return(Json(JsonSonuc.sonucUret(true, "Müşteri/Mükellef silindi."), JsonRequestBehavior.AllowGet));
 }
Exemple #13
0
 public static JsonSonuc bildirimOkundu(int vid)
 {
     try
     {
         vrlfgysdbEntities          db        = new vrlfgysdbEntities();
         List <sistem_bildirimleri> bldrmList = db.sistem_bildirimleri.Where(e => e.vid.Equals(vid)).ToList();
         foreach (sistem_bildirimleri bldrm in bldrmList)
         {
             bldrm.okundu          = bildirimOkunmaDurum.okundu;
             bldrm.okunma_tarihi   = DateTime.Now;
             db.Entry(bldrm).State = EntityState.Modified;
         }
         db.SaveChanges();
     }
     catch (Exception e)
     {
         return(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."));
     }
     return(JsonSonuc.sonucUret(true, "Başarılı."));
 }
Exemple #14
0
        public static JsonSonuc bildirimleriGetir(string gorev_url)
        {
            try
            {
                vrlfgysdbEntities db = new vrlfgysdbEntities();
                //gorevler gorev = db.gorevler.Where(e => e.flag == durumlar.aktif && e.url.Equals(gorev_url)).FirstOrDefault();

                string queryGorevCount = "select y.* from yapilacaklar as y "
                                         + "inner join gorevler as g on g.id = y.gorev_id and g.flag = " + durumlar.aktif + " and g.url = '" + gorev_url + "' "
                                         + "where y.flag = " + durumlar.aktif;
                List <GorevlerModel> gorevList = db.Database.SqlQuery <GorevlerModel>(queryGorevCount).ToList();

                JsonSonuc sonuc = JsonSonuc.sonucUret(true, gorevList);
                return(sonuc);
            }
            catch (Exception e)
            {
                return(JsonSonuc.sonucUret(false, "Bildirimler getirilirken bir hata oluştu. Lütfen tekrar deneyiniz."));
            }
        }
Exemple #15
0
 public JsonSonuc projeMusterisiSil(int proje_id)
 {
     try
     {
         vrlfgysdbEntities db = new vrlfgysdbEntities();
         //kullanicilar usr = db.kullanicilar.Where(e => e.url.Equals(url)).FirstOrDefault();
         List <proje_musteri> pmList = db.proje_musteri.Where(e => e.flag == durumlar.aktif && e.proje_id.Equals(proje_id)).ToList();
         foreach (proje_musteri pm in pmList)
         {
             pm.flag            = durumlar.silindi;
             db.Entry(pm).State = EntityState.Modified;
         }
         db.SaveChanges();
     }
     catch (Exception)
     {
         return(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."));
     }
     return(JsonSonuc.sonucUret(true, "Kullanıcı silindi."));
 }
 public JsonResult smsGonder(string[] kullaniciList)
 {
     try
     {
         string icerik  = Request["icerik"];
         int    groupId = SendSms.getGroupId();
         if (icerik.Length > 160)
         {
             return(Json(JsonSonuc.sonucUret(false, "Sms mesajı en fazla 160 karakter olabilir. Lütfen mesajı kısaltıp tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
         }
         List <string>       numaraList = new List <string>();
         List <kullanicilar> userList   = new List <kullanicilar>();
         foreach (string str in kullaniciList)
         {
             int          userId = Convert.ToInt32(str);
             kullanicilar usr    = db.kullanicilar.Where(e => e.id == userId).FirstOrDefault();
             if (usr != null && usr.sms_permission == Permissions.granted)
             {
                 numaraList.Add(usr.tel);
                 userList.Add(usr);
             }
         }
         LoggedUserModel lgm   = GetCurrentUser.GetUser();
         SendSms         sms   = new SendSms();
         sistem_ayarlari sa    = db.sistem_ayarlari.Where(e => e.flag == durumlar.aktif).FirstOrDefault();
         bool            sonuc = sms.SendSMS(numaraList.ToArray(), icerik, sa.sms_header, "_admin_");
         if (!sonuc)
         {
             return(Json(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
         }
         foreach (kullanicilar usr in userList)
         {
             SendSms.smsKaydet(icerik, durumlar.aktif, MailHedefTur.kullanici, usr.id, usr.tel, lgm.id, groupId);
         }
         return(Json(JsonSonuc.sonucUret(true, "Sms Gönderildi."), JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
     }
 }
        public JsonSonuc silYapilacak(string url)
        {
            try
            {
                vrlfgysdbEntities db    = new vrlfgysdbEntities();
                yapilacaklar      yplck = db.yapilacaklar.Where(e => e.url.Equals(url)).FirstOrDefault();
                int eskiYuzde           = yplck.gorevler.yuzde;
                yplck.flag            = durumlar.silindi;
                db.Entry(yplck).State = EntityState.Modified;
                db.SaveChanges();
                gorevIslemleri gis   = new gorevIslemleri();
                JsonSonuc      sonuc = gis.gorevYuzdesiDuzenle(yplck.gorev_id);
                gorevIslemleri.logEkle(yplck.gorevler, "Görev tamamlama yüzdesi " + eskiYuzde + "'den " + sonuc.Message + "e getirildi. \"" + yplck.isim + "\" işlemi görevden silindi.", GetCurrentUser.GetUser());

                return(JsonSonuc.sonucUret(true, "Yapılacaklar listesi düzenlendi."));
            }
            catch (Exception e)
            {
                return(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."));
            }
        }
 public JsonSonuc musteriKullanicisiSil(int id)
 {
     try
     {
         LoggedUserModel   lgm = GetCurrentUser.GetUser();
         vrlfgysdbEntities db  = new vrlfgysdbEntities();
         kullanici_musteri km  = db.kullanici_musteri.Where(e => e.id.Equals(id)).FirstOrDefault();
         km.flag            = durumlar.silindi;
         db.Entry(km).State = EntityState.Modified;
         if (km.musteriler != null)
         {
             bildirimIslemleri.yeniBildirim(km.kullanici_id, BildirimTurleri.musteri, km.musteri_id, "", km.musteriler.firma_adi + " firma isimli müşteri sizden alındı. İşlemi yapan yetkili " + lgm.ad + " " + lgm.soyad + ".");
         }
         db.SaveChanges();
     }
     catch (Exception)
     {
         return(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."));
     }
     return(JsonSonuc.sonucUret(true, "Kullanıcı silindi."));
 }
 public JsonResult musteriProjeGorevleri(string musteriUrl)
 {
     try
     {
         LoggedUserModel lgm = GetCurrentUser.GetUser();
         string          projeSurecGorevQuery = "select id, oncelik, isim, DATE_FORMAT(baslangic_tarihi, '%d.%m.%Y') as baslangic_tarihi, DATE_FORMAT(bitis_tarihi, '%d.%m.%Y') as bitis_tarihi, yuzde, flag, tur, url, durum from ( "
                                                + "(select ps.id, 1 as oncelik, ps.isim, ps.baslangic_tarihi, ps.bitis_tarihi, ps.yuzde, ps.flag, ps.tur, ps.url, ps.durum from proje_surec as ps "
                                                + "inner join firma_musavir as fm on fm.id = ps.firma_id and fm.flag = " + durumlar.aktif + " "
                                                + "where ps.flag = " + durumlar.aktif + " and fm.url = '" + musteriUrl + "')"
                                                + " union "
                                                + "(select g.id, 1 as oncelik, g.isim, g.baslangic_tarihi, g.bitis_tarihi, g.yuzde, g.flag, 3 as tur, g.url, g.durum from gorevler as g "
                                                + "inner join firma_musavir as fm on fm.id = g.firma_id and fm.flag = " + durumlar.aktif + " "
                                                + "where g.flag = " + durumlar.aktif + " and fm.url = '" + musteriUrl + "')) as tbl";
         List <GorevVeProjeSurecOzetModel> psg = db.Database.SqlQuery <GorevVeProjeSurecOzetModel>(projeSurecGorevQuery).ToList();
         return(Json(JsonSonuc.sonucUret(true, psg), JsonRequestBehavior.AllowGet));
     }
     catch (Exception)
     {
         return(Json(JsonSonuc.sonucUret(false, "Kullanıcı görevleri getirilemedi. Lütfen tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
     }
 }
 public JsonResult mailGonder(string[] kullaniciList)
 {
     try
     {
         string icerik  = Request.Unvalidated["icerik"];
         string konu    = Request["konu"];
         int    groupId = EmailFunctions.getGroupId();
         foreach (string str in kullaniciList)
         {
             int          userId = Convert.ToInt32(str);
             kullanicilar usr    = db.kullanicilar.Where(e => e.id == userId).FirstOrDefault();
             if (usr != null && usr.mail_permission == Permissions.granted)
             {
                 bool mailSonuc = EmailFunctions.sendEmailGmail(icerik, konu, usr.email, MailHedefTur.kullanici, usr.id, EmailFunctions.mailAdresi, 0, "", "", "", "", groupId);
             }
         }
         return(Json(JsonSonuc.sonucUret(true, "Mail Gönderildi."), JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
     }
 }
 public JsonResult ayarlarKaydet(string mail_permission, string sms_permission)
 {
     try
     {
         kullaniciIslemleri mic   = new kullaniciIslemleri();
         string             sonuc = mic.kullaniciDuzenle(GetCurrentUser.GetUser().url, "", "", mail_permission, sms_permission, Request);
         if (sonuc.Equals("") || sonuc.Equals("email_unique") || sonuc.Equals("username_unique"))
         {
             if (sonuc.Equals("email_unique"))
             {
                 return(Json(JsonSonuc.sonucUret(false, "Girdiğiniz e-Mail adresini başka bir kullanıcı kullanmaktadır. Lütfen farklı bir e-Mail adresi deneyiniz."), JsonRequestBehavior.AllowGet));
             }
             else if (sonuc.Equals("username_unique"))
             {
                 return(Json(JsonSonuc.sonucUret(false, "Girdiğiniz kullanıcı adını başka bir kullanıcı kullanmaktadır. Lütfen farklı bir kullanıcı adı deneyiniz."), JsonRequestBehavior.AllowGet));
             }
             else
             {
                 return(Json(JsonSonuc.sonucUret(false, "Bir hata oluştu. Lütfen daha sonra tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
             }
         }
         return(Json(JsonSonuc.sonucUret(true, "Bilgileriniz Güncellendi."), JsonRequestBehavior.AllowGet));
     }
     catch (Exception e)
     {
         if (e.InnerException != null && e.InnerException.ToString().Contains("unique_email"))
         {
             //return Json(FormReturnTypes.unique_email, JsonRequestBehavior.AllowGet);
             return(Json(JsonSonuc.sonucUret(false, "Girdiğiniz e-Mail adresini başka bir kullanıcı kullanmaktadır. Lütfen farklı bir e-Mail adresi deneyiniz."), JsonRequestBehavior.AllowGet));
         }
         else
         {
             //return Json(FormReturnTypes.basarisiz, JsonRequestBehavior.AllowGet);
             return(Json(JsonSonuc.sonucUret(false, "Bir hata oluştu. Lütfen daha sonra tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
         }
     }
 }
Exemple #22
0
 public JsonSonuc projeSurecMusterisiKullaniciGorevlendir(int id, string kullanici)
 {
     try
     {
         vrlfgysdbEntities db  = new vrlfgysdbEntities();
         kullanicilar      usr = db.kullanicilar.Where(e => e.flag == durumlar.aktif && e.url.Equals(kullanici)).FirstOrDefault();
         proje_musteri     pm  = db.proje_musteri.Where(e => e.id.Equals(id)).FirstOrDefault();
         if (usr == null)
         {
             pm.kullanici_id = 0;
         }
         else
         {
             pm.kullanici_id = usr.id;
         }
         db.Entry(pm).State = EntityState.Modified;
         db.SaveChanges();
     }
     catch (Exception)
     {
         return(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."));
     }
     return(JsonSonuc.sonucUret(true, "Kullanıcı yetkilendirildi."));
 }
Exemple #23
0
        public JsonSonuc projeSurecTamamlandi(string url)
        {
            try
            {
                vrlfgysdbEntities db  = new vrlfgysdbEntities();
                LoggedUserModel   lgm = GetCurrentUser.GetUser();
                proje_surec       ps  = db.proje_surec.Where(e => e.url.Equals(url)).FirstOrDefault();
                if (ps == null)
                {
                    return(JsonSonuc.sonucUret(false, "Proje/Süreç bulunamadı."));
                }
                if (ps.yuzde != 100)
                {
                    return(JsonSonuc.sonucUret(false, "Proje/Süreç yüzdesi %100 değil."));
                }
                ps.durum             = TamamlamaDurumlari.tamamlandi;
                ps.onaylayan_yetkili = lgm.id;
                ps.tamamlanma_tarihi = DateTime.Now;

                List <gorev_proje> projeGorevList = db.gorev_proje.Where(e => e.proje_id == ps.id && e.flag == durumlar.aktif && e.gorevler.flag == durumlar.aktif).ToList();

                foreach (gorev_proje gp in projeGorevList)
                {
                    gp.gorevler.durum  = TamamlamaDurumlari.tamamlandi;
                    db.Entry(gp).State = EntityState.Modified;
                }

                db.Entry(ps).State = EntityState.Modified;
                db.SaveChanges();
            }
            catch (Exception)
            {
                return(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."));
            }
            return(JsonSonuc.sonucUret(true, "Proje/Süreç durumu güncellendi."));
        }
        public JsonResult YardimEkle(string icerik)
        {
            try
            {
                int vid = 1;
                if (db.yardim.Count() != 0)
                {
                    vid = db.yardim.Max(e => e.vid) + 1;
                }
                int sort = 1;
                if (db.yardim.Count() != 0)
                {
                    sort = db.yardim.Max(e => e.sort) + 1;
                }

                yardim yrd = new yardim();
                foreach (var property in yrd.GetType().GetProperties())
                {
                    try
                    {
                        var response2 = Request[property.Name];
                        if (response2 == null && property.PropertyType != typeof(int))
                        {
                            if (response2 == null)
                            {
                                continue;
                            }
                        }
                        else
                        {
                            PropertyInfo propertyS = yrd.GetType().GetProperty(property.Name);
                            if (property.PropertyType == typeof(decimal))
                            {
                                propertyS.SetValue(yrd, Convert.ChangeType(Decimal.Parse(response2.Replace('.', ',')), property.PropertyType), null);
                            }
                            else if (property.PropertyType == typeof(int))
                            {
                                if (response2 == null)
                                {
                                    propertyS.SetValue(yrd, Convert.ChangeType(0, property.PropertyType), null);
                                }
                                else
                                {
                                    propertyS.SetValue(yrd, Convert.ChangeType(Decimal.Parse(response2.Replace('.', ',')), property.PropertyType), null);
                                }
                            }
                            else
                            {
                                propertyS.SetValue(yrd, Convert.ChangeType(response2, property.PropertyType), null);
                            }
                        }
                    }
                    catch (Exception)
                    { }
                }

                string strImageName = StringFormatter.OnlyEnglishChar(yrd.baslik);

                string createdUrl = strImageName;
                string tempUrl    = createdUrl;
                bool   bulundu    = false;
                int    i          = 0;
                yardim pg         = new yardim();
                do
                {
                    pg = db.yardim.Where(e => e.url.Equals(tempUrl)).FirstOrDefault();
                    if (pg != null)
                    {
                        tempUrl = tempUrl + i.ToString();
                    }
                    else
                    {
                        createdUrl = tempUrl;
                        bulundu    = true;
                    }
                    i++;
                } while (!bulundu);
                yrd.url = createdUrl;

                yrd.icerik  = icerik;
                yrd.flag    = durumlar.aktif;
                yrd.vid     = vid;
                yrd.date    = DateTime.Now;
                yrd.sort    = sort;
                yrd.ekleyen = GetCurrentUser.GetUser().id;

                db.yardim.Add(yrd);
                db.SaveChanges();

                return(Json(JsonSonuc.sonucUret(true, yrd.url), JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                return(Json(JsonSonuc.sonucUret(false, "Bir hata oluştu. Lütfen tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
            }
        }
        public JsonSonuc yeniYapilacak(int firma_id, HttpRequestBase Request)
        {
            try
            {
                vrlfgysdbEntities db = new vrlfgysdbEntities();

                yapilacaklar yplck = new yapilacaklar();
                foreach (var property in yplck.GetType().GetProperties())
                {
                    try
                    {
                        var response = Request[property.Name];
                        if (response == null && property.PropertyType != typeof(int))
                        {
                            if (response == null)
                            {
                                continue;
                            }
                        }
                        else
                        {
                            PropertyInfo propertyS = yplck.GetType().GetProperty(property.Name);
                            if (property.PropertyType == typeof(decimal))
                            {
                                propertyS.SetValue(yplck, Convert.ChangeType(Decimal.Parse(response.Replace('.', ',')), property.PropertyType), null);
                            }
                            else if (property.PropertyType == typeof(int))
                            {
                                if (response == null)
                                {
                                    propertyS.SetValue(yplck, Convert.ChangeType(0, property.PropertyType), null);
                                }
                                else
                                {
                                    propertyS.SetValue(yplck, Convert.ChangeType(Decimal.Parse(response.Replace('.', ',')), property.PropertyType), null);
                                }
                            }
                            else
                            {
                                propertyS.SetValue(yplck, Convert.ChangeType(response, property.PropertyType), null);
                            }
                        }
                    }
                    catch (Exception)
                    { }
                }


                yplck.firma_id          = firma_id;
                yplck.tamamlanma_tarihi = DateTime.Now;
                yplck.flag    = durumlar.aktif;
                yplck.date    = DateTime.Now;
                yplck.ekleyen = GetCurrentUser.GetUser().id;
                yplck.durum   = YapilacaklarDurum.beklemede;

                return(yapilacakEkle(yplck));
            }
            catch (Exception e)
            {
                return(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."));
            }
        }
Exemple #26
0
        public JsonSonuc yeniMesaj(HttpRequestBase Request)
        {
            try
            {
                LoggedUserModel lgm = GetCurrentUser.GetUser();

                vrlfgysdbEntities db = new vrlfgysdbEntities();

                int vid = 1;
                if (db.kullanici_proje.Count() != 0)
                {
                    vid = db.kullanici_proje.Max(e => e.vid) + 1;
                }
                int sort = 1;
                if (db.kullanici_proje.Count() != 0)
                {
                    sort = db.kullanici_proje.Max(e => e.sort) + 1;
                }

                mesajlar msj = new mesajlar();
                foreach (var property in msj.GetType().GetProperties())
                {
                    try
                    {
                        var response = Request[property.Name];
                        if (response == null && property.PropertyType != typeof(int))
                        {
                            if (response == null)
                            {
                                continue;
                            }
                        }
                        else
                        {
                            PropertyInfo propertyS = msj.GetType().GetProperty(property.Name);
                            if (property.PropertyType == typeof(decimal))
                            {
                                propertyS.SetValue(msj, Convert.ChangeType(Decimal.Parse(response.Replace('.', ',')), property.PropertyType), null);
                            }
                            else if (property.PropertyType == typeof(int))
                            {
                                if (response == null)
                                {
                                    propertyS.SetValue(msj, Convert.ChangeType(0, property.PropertyType), null);
                                }
                                else
                                {
                                    propertyS.SetValue(msj, Convert.ChangeType(Decimal.Parse(response.Replace('.', ',')), property.PropertyType), null);
                                }
                            }
                            else
                            {
                                propertyS.SetValue(msj, Convert.ChangeType(response, property.PropertyType), null);
                            }
                        }
                    }
                    catch (Exception)
                    { }
                }

                string   strImageName = StringFormatter.OnlyEnglishChar(OurFunctions.ourSubString(msj.mesaj, 20));
                string   createdUrl   = strImageName;
                string   tempUrl      = createdUrl;
                bool     bulundu      = false;
                int      i            = 0;
                mesajlar pg           = new mesajlar();
                do
                {
                    pg = db.mesajlar.Where(e => e.url.Equals(tempUrl)).FirstOrDefault();
                    if (pg != null)
                    {
                        tempUrl = tempUrl + i.ToString();
                    }
                    else
                    {
                        createdUrl = tempUrl;
                        bulundu    = true;
                    }
                    i++;
                } while (!bulundu);
                msj.url = createdUrl;

                msj.flag        = durumlar.bekliyor;
                msj.date        = DateTime.Now;
                msj.vid         = vid;
                msj.sort        = sort;
                msj.gonderen_id = lgm.id;
                msj.firma_id    = lgm.firma_id;

                if (msj.parent_url.Equals(string.Empty))
                {
                    msj.parent_url = msj.url;
                }

                db.mesajlar.Add(msj);
                db.SaveChanges();


                mesajlar dbMsj = db.mesajlar.Where(e => e.vid == msj.vid).FirstOrDefault();
                if (dbMsj != null)
                {
                    bildirimIslemleri.yeniBildirim(dbMsj.alan_id, BildirimTurleri.mesaj, dbMsj.id, dbMsj.url, lgm.ad + " " + lgm.soyad + " isimli isimli kullanıcıdan yeni bir mesajınız var.");
                }

                return(JsonSonuc.sonucUret(true, "Mesaj Gönderildi."));
            }
            catch (Exception e)
            {
                return(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."));
            }
        }
Exemple #27
0
        public JsonResult ayarlariKaydet()
        {
            try
            {
                LoggedUserModel lgm = GetCurrentUser.GetUser();
                int             vid = 1;
                if (db.sistem_ayarlari.Count() != 0)
                {
                    vid = db.sistem_ayarlari.Max(e => e.vid) + 1;
                }
                int sort = 1;
                if (db.sistem_ayarlari.Count() != 0)
                {
                    sort = db.sistem_ayarlari.Max(e => e.sort) + 1;
                }
                sistem_ayarlari sa = new sistem_ayarlari();
                foreach (var property in sa.GetType().GetProperties())
                {
                    try
                    {
                        var response = Request[property.Name];
                        if (response == null)
                        {
                            if (response == null)
                            {
                                continue;
                            }
                        }
                        else
                        {
                            PropertyInfo propertyS = sa.GetType().GetProperty(property.Name);
                            if (property.PropertyType == typeof(decimal))
                            {
                                propertyS.SetValue(sa, Convert.ChangeType(Decimal.Parse(response.Replace('.', ',')), property.PropertyType), null);
                            }
                            else
                            {
                                propertyS.SetValue(sa, Convert.ChangeType(response, property.PropertyType), null);
                            }
                        }
                    }
                    catch (Exception)
                    { }
                }
                sa.vid     = vid;
                sa.date    = DateTime.Now;
                sa.ekleyen = lgm.id;
                sa.sort    = sort;
                sa.flag    = durumlar.aktif;

                List <sistem_ayarlari> saList = db.sistem_ayarlari.Where(e => e.flag == durumlar.aktif).ToList();
                foreach (sistem_ayarlari dbSa in saList)
                {
                    dbSa.flag            = durumlar.silindi;
                    db.Entry(dbSa).State = EntityState.Modified;
                }

                db.sistem_ayarlari.Add(sa);
                db.SaveChanges();

                return(Json(JsonSonuc.sonucUret(true, "Ayarlar kaydedildi."), JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                return(Json(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."), JsonRequestBehavior.AllowGet));
            }
        }
Exemple #28
0
        public static JsonSonuc yeniBildirim(int kullanici_id, int bildirim_turu, int ilgili_id, string ilgili_url, string mesaj)
        {
            try
            {
                vrlfgysdbEntities db = new vrlfgysdbEntities();

                int vid = 1;
                if (db.sistem_bildirimleri.Count() != 0)
                {
                    vid = db.sistem_bildirimleri.Max(e => e.vid) + 1;
                }
                int sort = 1;
                if (db.sistem_bildirimleri.Count() != 0)
                {
                    sort = db.sistem_bildirimleri.Max(e => e.sort) + 1;
                }

                sistem_bildirimleri bldrm = new sistem_bildirimleri();

                bldrm.kullanici_id  = kullanici_id;
                bldrm.flag          = durumlar.aktif;
                bldrm.date          = DateTime.Now;
                bldrm.vid           = vid;
                bldrm.ekleyen       = GetCurrentUser.GetUser().id;
                bldrm.sort          = sort;
                bldrm.okundu        = bildirimOkunmaDurum.beklemede;
                bldrm.bildirim_turu = bildirim_turu;
                bldrm.ilgili_id     = ilgili_id;
                bldrm.ilgili_url    = "";
                bldrm.mesaj         = mesaj;
                if (bildirim_turu == BildirimTurleri.gorev)
                {
                    bldrm.ilgili_url = "Gorev/" + ilgili_url;
                }
                else if (bildirim_turu == BildirimTurleri.proje)
                {
                    bldrm.ilgili_url = "Proje/" + ilgili_url;
                }
                else if (bildirim_turu == BildirimTurleri.surec)
                {
                    bldrm.ilgili_url = "Surec/" + ilgili_url;
                }
                else if (bildirim_turu == BildirimTurleri.musteri)
                {
                    bldrm.ilgili_url = "Musteri/" + ilgili_url;
                }
                else if (bildirim_turu == BildirimTurleri.mesaj)
                {
                    bldrm.ilgili_url = "Mesaj/" + ilgili_url;
                }
                else
                {
                    bldrm.ilgili_url = ilgili_url;
                }

                db.sistem_bildirimleri.Add(bldrm);
                db.SaveChanges();

                kullanicilar dbUsr = db.kullanicilar.Where(e => e.id == bldrm.kullanici_id).FirstOrDefault();
                if (dbUsr != null)
                {
                    if (dbUsr.mail_permission == Permissions.granted)
                    {
                        string emailMesaj = bldrm.mesaj + " </br>İlgili bağlantı için <a href='" + Tools.config.url + bldrm.ilgili_url + "'>tıklayınız.</a>";
                        EmailFunctions.sendEmailGmail(emailMesaj, config.projeİsmi + " - Bildirim", dbUsr.email, MailHedefTur.kullanici, bldrm.kullanici_id, "", 0, "", "", "", "", 0);
                    }
                    if (dbUsr.sms_permission == Permissions.granted)
                    {
                        List <string> numaraList = new List <string>();
                        numaraList.Add(dbUsr.tel);
                        SendSms         sms = new SendSms();
                        sistem_ayarlari sa  = db.sistem_ayarlari.Where(e => e.flag == durumlar.aktif).FirstOrDefault();

                        LoggedUserModel lgm        = GetCurrentUser.GetUser();
                        string          musteri_no = "";
                        if (lgm.fm != null)
                        {
                            musteri_no = lgm.fm.musteri_no;
                        }
                        bool sonuc = sms.SendSMS(numaraList.ToArray(), bldrm.mesaj, sa.sms_header, musteri_no);
                        if (sonuc == false)
                        {
                            return(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."));
                        }
                    }
                }

                return(JsonSonuc.sonucUret(true, bldrm.ilgili_url));
            }
            catch (Exception e)
            {
                return(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."));
            }
        }
        public JsonSonuc yenimusteriKullanicisi(HttpRequestBase Request)
        {
            try
            {
                vrlfgysdbEntities db = new vrlfgysdbEntities();

                LoggedUserModel lgm = GetCurrentUser.GetUser();

                int vid = 1;
                if (db.kullanici_proje.Count() != 0)
                {
                    vid = db.kullanici_proje.Max(e => e.vid) + 1;
                }
                int sort = 1;
                if (db.kullanici_proje.Count() != 0)
                {
                    sort = db.kullanici_proje.Max(e => e.sort) + 1;
                }

                kullanici_musteri km = new kullanici_musteri();
                foreach (var property in km.GetType().GetProperties())
                {
                    try
                    {
                        var response = Request[property.Name];
                        if (response == null && property.PropertyType != typeof(int))
                        {
                            if (response == null)
                            {
                                continue;
                            }
                        }
                        else
                        {
                            PropertyInfo propertyS = km.GetType().GetProperty(property.Name);
                            if (property.PropertyType == typeof(decimal))
                            {
                                propertyS.SetValue(km, Convert.ChangeType(Decimal.Parse(response.Replace('.', ',')), property.PropertyType), null);
                            }
                            else if (property.PropertyType == typeof(int))
                            {
                                if (response == null)
                                {
                                    propertyS.SetValue(km, Convert.ChangeType(0, property.PropertyType), null);
                                }
                                else
                                {
                                    propertyS.SetValue(km, Convert.ChangeType(Decimal.Parse(response.Replace('.', ',')), property.PropertyType), null);
                                }
                            }
                            else
                            {
                                propertyS.SetValue(km, Convert.ChangeType(response, property.PropertyType), null);
                            }
                        }
                    }
                    catch (Exception)
                    { }
                }

                km.flag    = durumlar.aktif;
                km.date    = DateTime.Now;
                km.vid     = vid;
                km.sort    = sort;
                km.ekleyen = lgm.id;

                kullanici_musteri dbKm = db.kullanici_musteri.Where(e => e.flag == durumlar.aktif && e.musteri_id == km.musteri_id && e.kullanici_id == km.kullanici_id).FirstOrDefault();
                if (dbKm != null)
                {
                    return(JsonSonuc.sonucUret(true, "Kullanıcı Eklendi."));
                }

                db.kullanici_musteri.Add(km);
                db.SaveChanges();

                musteriler mstr = db.musteriler.Where(e => e.id == km.musteri_id).FirstOrDefault();
                if (mstr != null)
                {
                    bildirimIslemleri.yeniBildirim(km.kullanici_id, BildirimTurleri.musteri, km.musteri_id, mstr.url, mstr.firma_adi + " firma isimli müşteri ilgilenmeniz için size yönlendirildi. Yönlendiren yetkili " + lgm.ad + " " + lgm.soyad + ".");
                }

                return(JsonSonuc.sonucUret(true, "Kullanıcı Eklendi."));
            }
            catch (Exception e)
            {
                return(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."));
            }
        }
Exemple #30
0
        public JsonSonuc yeniProjeMusterisi(HttpRequestBase Request, string[] musteriList)
        {
            try
            {
                vrlfgysdbEntities db = new vrlfgysdbEntities();

                foreach (string str in musteriList)
                {
                    int vid = 1;
                    if (db.proje_musteri.Count() != 0)
                    {
                        vid = db.proje_musteri.Max(e => e.vid) + 1;
                    }
                    int sort = 1;
                    if (db.proje_musteri.Count() != 0)
                    {
                        sort = db.proje_musteri.Max(e => e.sort) + 1;
                    }

                    proje_musteri pm = new proje_musteri();
                    foreach (var property in pm.GetType().GetProperties())
                    {
                        try
                        {
                            var response = Request[property.Name];
                            if (response == null && property.PropertyType != typeof(int))
                            {
                                if (response == null)
                                {
                                    continue;
                                }
                            }
                            else
                            {
                                PropertyInfo propertyS = pm.GetType().GetProperty(property.Name);
                                if (property.PropertyType == typeof(decimal))
                                {
                                    propertyS.SetValue(pm, Convert.ChangeType(Decimal.Parse(response.Replace('.', ',')), property.PropertyType), null);
                                }
                                else if (property.PropertyType == typeof(int))
                                {
                                    if (response == null)
                                    {
                                        propertyS.SetValue(pm, Convert.ChangeType(0, property.PropertyType), null);
                                    }
                                    else
                                    {
                                        propertyS.SetValue(pm, Convert.ChangeType(Decimal.Parse(response.Replace('.', ',')), property.PropertyType), null);
                                    }
                                }
                                else
                                {
                                    propertyS.SetValue(pm, Convert.ChangeType(response, property.PropertyType), null);
                                }
                            }
                        }
                        catch (Exception)
                        { }
                    }

                    pm.flag       = durumlar.aktif;
                    pm.date       = DateTime.Now;
                    pm.vid        = vid;
                    pm.sort       = sort;
                    pm.ekleyen    = GetCurrentUser.GetUser().id;
                    pm.musteri_id = Convert.ToInt32(str);

                    proje_musteri dbPm = db.proje_musteri.Where(e => e.flag == durumlar.aktif && e.proje_id == pm.proje_id && e.musteri_id == pm.musteri_id).FirstOrDefault();
                    if (dbPm != null)
                    {
                        continue;
                        //return JsonSonuc.sonucUret(true, "Müşteri Eklendi.");
                    }

                    db.proje_musteri.Add(pm);
                    db.SaveChanges();
                }

                return(JsonSonuc.sonucUret(true, "Müşteri Eklendi."));
            }
            catch (Exception e)
            {
                return(JsonSonuc.sonucUret(false, "İşlem sırasında bir hata oluştu. Lütfen tekrar deneyiniz."));
            }
        }