private void MailYolla(string tip, string gonderen, string mesaj)
        {
            //toplu mail apisi kullanıldığı zaman eklenecek
            using (radiusEntities dc = MyContext.Context(firma))
            {
                MailIslemleri m = new MailIslemleri(dc);

                if (tip == "gnltp")
                {
                    //genel Mail

                    if (Session["mailler"] != null)
                    {
                        string s = Session["mailler"].ToString();
                        if (!String.IsNullOrEmpty(s))
                        {
                            m.MailToplu("genel", gonderen, mesaj, s, "");
                        }
                    }
                    else
                    {
                        MusteriIslemleri musteri = new MusteriIslemleri(dc);

                        m.MailToplu("genel", gonderen, mesaj, musteri.mailListesiR(), "");
                        //Response.Redirect("/Deneme.aspx");
                    }
                }
            }
        }
Example #2
0
        protected void btnOnay_Click(object sender, EventArgs e)
        {
            kullanici_repo rep = KullaniciIslem.currentKullanici();

            string id       = txtServisID.Value;
            int    servisid = Int32.Parse(id);
            int    custID   = Int32.Parse(hdnCustID.Value);

            string firma    = rep.Firma;
            string kimlikNo = Request.QueryString["kimlik"];

            using (radiusEntities dc = MyContext.Context(firma))
            {
                ServisIslemleri ser      = new ServisIslemleri(dc);
                int             durum_id = ser.servisKapatR(servisid, User.Identity.Name);
                if (custID != -99)
                {
                    if (chcMail.Checked == true)
                    {
                        TeknikServis.Radius.customer musteri_bilgileri = dc.customers.Where(p => p.CustID == custID).FirstOrDefault();

                        ServisDAL.MailIslemleri mi = new MailIslemleri(dc);
                        mi.SendingMail(musteri_bilgileri.email, musteri_bilgileri.Ad, kimlikNo, "sonlanma", "");
                    }

                    if (chcSms.Checked == true)
                    {
                        TeknikServis.Radius.customer musteri_bilgileri = dc.customers.Where(p => p.CustID == custID).FirstOrDefault();
                        AyarIslemleri ayarimiz = new AyarIslemleri(dc);

                        string ekMesaj             = "Servis No: " + kimlikNo;
                        ServisDAL.SmsIslemleri sms = new ServisDAL.SmsIslemleri(dc);
                        sms.SmsGonder("durum", durum_id, ayarimiz, musteri_bilgileri.telefon, ekMesaj);
                    }
                }
            }


            //kapatma belgesi yazdırılacak/yada burada olmadan yazdırılabilir.
            string url = "/TeknikTeknik/ServisDetayList.aspx?kimlik=" + kimlikNo;

            Response.Redirect(url);
        }
Example #3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            kullanici_repo kullanici     = KullaniciIslem.currentKullanici();
            string         kimlik        = txtKimlikNo.Value;
            Servis_Baslama servisBilgisi = null;

            using (radiusEntities dc = MyContext.Context(kullanici.Firma))
            {
                ServisIslemleri servis = new ServisIslemleri(dc);

                string kullaniciID = kullanici.id;
                string aciklama    = txtServisAciklama.Text;
                //int urunID =Convert.ToInt32(GridView2.SelectedValue);
                int    index    = Convert.ToInt32(GridView2.SelectedIndex);
                int    tipID    = Convert.ToInt32(drdTip.SelectedValue);
                string atananID = "0";

                if (User.IsInRole("Admin") || User.IsInRole("mudur"))
                {
                    atananID = drdKullanici.SelectedValue;
                }
                int?musID = null;
                if (GridView1.SelectedIndex >= 0)
                {
                    musID = Convert.ToInt32(GridView1.SelectedValue);
                }
                string baslik = txtBaslik.Text;
                string firma  = kullanici.Firma;

                int id = Convert.ToInt32(GridView1.SelectedValue);
                UrunAra(id, dc);
                int?urunID = null;
                if (Session["secilenUrun"] != null)
                {
                    urunID = Convert.ToInt32(Session["secilenUrun"]);
                }
                DateTime acilma_zamani = DateTime.Now;
                string   zamanS        = tarih2.Value;
                if (!String.IsNullOrEmpty(zamanS))
                {
                    acilma_zamani = DateTime.Parse(zamanS);
                }
                int servis_paket = Int32.Parse(drdPaketler.SelectedValue);
                if (servis_paket > -1)
                {
                    int durum_id = servis.servisEklePaketli(servis_paket, musID, kullaniciID, aciklama, urunID, tipID, atananID, kimlik, baslik, acilma_zamani, User.Identity.Name);

                    if (chcMail.Checked == true || chcSms.Checked == true)
                    {
                        MusteriIslemleri musteri           = new MusteriIslemleri(dc);
                        Radius.customer  musteri_bilgileri = musteri.musteriTekR(id);
                        if (chcMail.Checked == true)
                        {
                            ServisDAL.MailIslemleri mi = new MailIslemleri(dc);
                            mi.SendingMail(musteri_bilgileri.email, musteri_bilgileri.Ad, kimlik, "baslangic", "");
                        }
                        if (chcSms.Checked == true)
                        {
                            ServisDAL.SmsIslemleri sms      = new ServisDAL.SmsIslemleri(dc);
                            AyarIslemleri          ayarimiz = new AyarIslemleri(dc);
                            string ekMesaj = "Servis No: " + kimlik;
                            sms.SmsGonder("durum", durum_id, ayarimiz, musteri_bilgileri.telefon, ekMesaj);
                        }
                    }
                }
                else
                {
                    int durum_id = servis.servisEkleGorevliR(musID, kullaniciID, aciklama, urunID, tipID, atananID, kimlik, baslik, acilma_zamani, User.Identity.Name);
                    //int durum_id = servis.servisEkleGorevliR(musID, kullaniciID, aciklama, urunID, tipID, atananID, kimlik, baslik, "sube", acilma_zamani);
                    if (chcMail.Checked == true || chcSms.Checked == true)
                    {
                        MusteriIslemleri musteri           = new MusteriIslemleri(dc);
                        Radius.customer  musteri_bilgileri = musteri.musteriTekR(id);
                        if (chcMail.Checked == true)
                        {
                            ServisDAL.MailIslemleri mi = new MailIslemleri(dc);
                            mi.SendingMail(musteri_bilgileri.email, musteri_bilgileri.Ad, kimlik, "baslangic", "");
                        }
                        if (chcSms.Checked == true)
                        {
                            ServisDAL.SmsIslemleri sms      = new ServisDAL.SmsIslemleri(dc);
                            AyarIslemleri          ayarimiz = new AyarIslemleri(dc);
                            string ekMesaj = "Servis No: " + kimlik;
                            sms.SmsGonder("durum", durum_id, ayarimiz, musteri_bilgileri.telefon, ekMesaj);
                        }
                    }
                }

                Session["secilenUrun"] = null;

                if (cbYazdir.Checked == true)
                {
                    FaturaBas   bas = new FaturaBas(dc);
                    AyarCurrent ay  = new AyarCurrent(dc);
                    servisBilgisi             = bas.ServisBilgileri(kimlik, ay.get());
                    Session["Servis_Baslama"] = servisBilgisi;
                }
            }



            Session["secilenUrun"] = null;

            if (cbYazdir.Checked == true && servisBilgisi != null)
            {
                string uri = "/Baski.aspx?tip=baslama";
                Response.Redirect(uri);
            }
            else
            {
                Response.Redirect("/TeknikTeknik/ServisDetayList.aspx?kimlik=" + kimlik);
            }
        }
        protected void btnOnay_Click(object sender, EventArgs e)
        {
            string hesapS = hdnHesapID.Value;

            string musteriID = hdnMusteriID.Value.Trim();
            int    custid    = Int32.Parse(musteriID);
            int    hesapID   = Int32.Parse(hesapS);

            using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
            {
                ServisIslemleri ser = new ServisIslemleri(dc);

                if (musteriID != "-99")
                {
                    //burada cariyi çekecez
                    musteri_bilgileri musteri_bilgileri = ser.servisKararOnayR(hesapID, User.Identity.Name);
                    //karar onayında stok kontrolü yapılıyor
                    //eğer stok yoksa müşteri bilgileri boş döndürülüyor
                    if (!string.IsNullOrEmpty(musteri_bilgileri.ad))
                    {
                        //FaturaIslemleri fat = new FaturaIslemleri(dc);
                        //fat.FaturaOdeCariEntegre(custid, DateTime.Now, musteri_bilgileri.caribakiye,User.Identity.Name);

                        if (chcMail.Checked == true || chcSms.Checked == true)
                        {
                            int            servisid = Int32.Parse(hdnServisIDD.Value);
                            string         islem    = hdnIslemm.Value;
                            string         yekun    = hdnYekunn.Value;
                            Radius.service serr     = ser.servisTekR(servisid);
                            if (chcMail.Checked == true)
                            {
                                string ekMesaj             = "Yapılacak işlem: <b>" + islem + "</b><br/>" + "Tutar :<b>" + yekun + "TL";
                                ServisDAL.MailIslemleri mi = new MailIslemleri(dc);
                                mi.SendingMail(musteri_bilgileri.email, musteri_bilgileri.ad, serr.Servis_Kimlik_No, "karar_onaylandi", ekMesaj);
                            }
                            if (chcSms.Checked == true)
                            {
                                string ekMesajSms               = "ServisNo: " + serr.Servis_Kimlik_No + "İşlem: " + islem + "Tutar: " + yekun + " TL";
                                ServisDAL.SmsIslemleri sms      = new ServisDAL.SmsIslemleri(dc);
                                AyarIslemleri          ayarimiz = new AyarIslemleri(dc);
                                sms.SmsGonder("durum", (int)serr.durum_id, ayarimiz, musteri_bilgileri.tel, ekMesajSms);
                            }
                        }
                        System.Text.StringBuilder sb = new System.Text.StringBuilder();
                        sb.Append(@"<script type='text/javascript'>");

                        sb.Append("$('#onayModal').modal('hide');");

                        sb.Append("alertify.success('Hesap onaylandı!');");
                        sb.Append(@"</script>");
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "OnayHideModalScript", sb.ToString(), false);
                    }
                    else
                    {
                        System.Text.StringBuilder sb = new System.Text.StringBuilder();
                        sb.Append(@"<script type='text/javascript'>");

                        sb.Append("$('#onayModal').modal('hide');");

                        sb.Append("alertify.error('Cihaz stoğu sıfır görünüyor!');");
                        sb.Append(@"</script>");
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "OnayHideModalScript", sb.ToString(), false);
                    }
                }
                else
                {
                    musteri_bilgileri bil = ser.servisKararOnayNoMusteri(hesapID, User.Identity.Name);
                    if (!string.IsNullOrEmpty(bil.ad))
                    {
                        //FaturaIslemleri fat = new FaturaIslemleri(dc);
                        //fat.FaturaOdeCariEntegre(custid, DateTime.Now, bil.caribakiye,User.Identity.Name);
                        //Response.Redirect("/Deneme.aspx?felan=" + musteriID);
                        System.Text.StringBuilder sb = new System.Text.StringBuilder();
                        sb.Append(@"<script type='text/javascript'>");
                        sb.Append("$('#onayModal').modal('hide');");
                        sb.Append("alertify.success('Hesap onaylandı!');");
                        sb.Append(@"</script>");
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "OnayHideModalScript", sb.ToString(), false);
                    }
                    else
                    {
                        System.Text.StringBuilder sb = new System.Text.StringBuilder();
                        sb.Append(@"<script type='text/javascript'>");

                        sb.Append("$('#onayModal').modal('hide');");

                        sb.Append("alertify.error('Cihaz stoğu sıfır görünüyor!');");
                        sb.Append(@"</script>");
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "OnayHideModalScript", sb.ToString(), false);
                    }
                }

                goster(dc);
            }
        }
Example #5
0
        private void MesajGonder(string kimlikNo, string durum, string eski_durum, string servis_id, string smsQ, string mailQ, radiusEntities dc)
        {
            if (!String.IsNullOrEmpty(smsQ) && !String.IsNullOrEmpty(mailQ))
            {
                if (smsQ == "1" || mailQ == "1")
                {
                    if (!String.IsNullOrEmpty(durum) && !String.IsNullOrEmpty(eski_durum))
                    {
                        int durum_id      = Int32.Parse(durum);
                        int eski_durum_id = Int32.Parse(eski_durum);

                        if (durum_id != eski_durum_id)
                        {
                            int servisid = Int32.Parse(servis_id);

                            string firma = KullaniciIslem.firma();

                            AyarIslemleri ayarimiz = new AyarIslemleri(dc);
                            //daha önceki durum değimiş mi ona göre mail atma kararı verilecek
                            //aynı durumda yeni bir şey ekleniyorsa mail atılmayacak
                            TeknikServis.Radius.service_durums durum_ayar = ayarimiz.tekDurumR(durum_id);

                            int custID = Int32.Parse(hdnCustID.Value);
                            TeknikServis.Radius.customer musteri_bilgileri = dc.customers.Where(p => p.CustID == custID).FirstOrDefault();

                            if (mailQ == "1")
                            {
                                if (durum_ayar.Mail == true)
                                {
                                    //mail gönder

                                    string mail = musteri_bilgileri.email;

                                    //bu bilgileri mail temasına kendileri koysun
                                    string adres    = ""; // rep.Adres;
                                    string tel      = ""; // rep.Telefon;
                                    string eposta   = ""; //  rep.Eposta;
                                    string FirmaTam = ""; //  rep.FirmaTam;
                                    string web      = ""; // rep.Web;
                                    //EPosta.SendingMail(ayarimiz, firma, mail, konu, musteri_bilgileri.Ad, FirmaTam, adres, tel, web, durum_ayar.Durum, kimlikNo, "bayi", "tema");
                                    ServisDAL.MailIslemleri mi = new MailIslemleri(dc);

                                    //Response.Redirect("/Default.aspx?id=" + gonder);
                                    if (!String.IsNullOrEmpty(mail))
                                    {
                                        if (durum_ayar.sonmu == true)
                                        {
                                            //servis kapatma maili gönderilecek
                                            mi.SendingMail(musteri_bilgileri.email, musteri_bilgileri.Ad, kimlikNo, "sonlanma", "");
                                        }
                                        else if (durum_ayar.kararmi == true)
                                        {
                                            //Servis kararı için mail atılacak
                                            mi.SendingMail(musteri_bilgileri.email, musteri_bilgileri.Ad, kimlikNo, "karar_bekleniyor", "");
                                        }
                                        else if (durum_ayar.onaymi == true)
                                        {
                                            mi.SendingMail(musteri_bilgileri.email, musteri_bilgileri.Ad, kimlikNo, "karar_onaylandi", "");
                                        }
                                        else if (durum_ayar.baslangicmi == true)
                                        {
                                            mi.SendingMail(musteri_bilgileri.email, musteri_bilgileri.Ad, kimlikNo, "baslangic", "");
                                        }
                                        else
                                        {
                                            mi.SendingMailDurum(musteri_bilgileri.email, musteri_bilgileri.Ad, kimlikNo, durum_id, "");
                                        }
                                    }
                                }
                            }

                            if (smsQ == "1" && durum_ayar.SMS == true)
                            {
                                string ekMesaj             = "Servis No: " + kimlikNo + "Servis durumu: " + durum_ayar.Durum;
                                ServisDAL.SmsIslemleri sms = new ServisDAL.SmsIslemleri(dc);
                                string mesele = sms.SmsGonder("durum", durum_id, ayarimiz, musteri_bilgileri.telefon, ekMesaj);
                                //  Session["mesele"] = mesele;
                                //  Response.Redirect("/Deneme.aspx");
                            }
                        }
                    }
                }
            }
        }