コード例 #1
0
        protected void grdBirim_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals("del"))
            {
                string        confirmValue = Request.Form["confirm_value3"];
                List <string> liste        = confirmValue.Split(new char[] { ',' }).ToList();
                int           sayimiz      = liste.Count - 1;
                string        deger        = liste[sayimiz];

                if (deger == "Yes")
                {
                    int code2 = Int32.Parse(e.CommandArgument.ToString().Trim());

                    using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
                    {
                        AyarIslemleri ayarlar = new AyarIslemleri(dc);
                        ayarlar.birim_sil(code2);;

                        grdBirim.DataSource = ayarlar.birimler();
                        grdBirim.DataBind();

                        System.Text.StringBuilder sb = new System.Text.StringBuilder();
                        sb.Append(@"<script type='text/javascript'>");
                        sb.Append(" alertify.success('Kayıt silindi!');");

                        sb.Append(@"</script>");
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditHideModalScriptTip", sb.ToString(), false);
                    }
                }
            }
        }
コード例 #2
0
        private void SmsYolla(string tip, string gonderen, string mesaj)
        {
            using (radiusEntities dc = MyContext.Context(firma))
            {
                SmsIslemleri  sms      = new SmsIslemleri(dc);
                AyarIslemleri ayarimiz = new AyarIslemleri(dc);


                if (tip == "gnltp")
                {
                    //genel mesaj
                    if (Session["teller"] != null)
                    {
                        string s = Session["teller"].ToString();
                        if (!String.IsNullOrEmpty(s))
                        {
                            string[] teller       = s.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                            string   mesaj_sonucu = sms.SmsGenel(ayarimiz, mesaj, teller);
                            Session["mesele"] = sms.MesajSonucu(mesaj_sonucu);
                            sms.CariMesajKaydet(teller);
                            Response.Redirect("/Sonuc");
                        }
                    }
                    else
                    {
                        Session["mesele"] = "Oturumunuz zaman aşımına uğradı. Lütfen tekrar liste oluşturunuz!";
                        Response.Redirect("/Sonuc");
                    }
                }
            }
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!User.Identity.IsAuthenticated)
            {
                System.Web.HttpContext.Current.Response.Redirect("/Account/Giris.aspx");
            }

            kullanici_repo kullanici = KullaniciIslem.currentKullanici();

            string firma = kullanici.Firma;

            using (radiusEntities dc = MyContext.Context(firma))
            {
                AyarCurrent ay = new AyarCurrent(dc);
                if (ay.lisansKontrol() == false)
                {
                    Response.Redirect("/LisansError");
                }
                AyarIslemleri ayarimiz = new AyarIslemleri(dc);
                if (!IsPostBack)
                {
                    gosterHepsi(kullanici, dc);
                }
            }
        }
コード例 #4
0
        protected void grdTipM_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals("detail"))
            {
                int code2 = Int32.Parse(e.CommandArgument.ToString().Trim());
                using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
                {
                    AyarIslemleri ayarlar = new AyarIslemleri(dc);
                    DetailsViewTipM.DataSource = ayarlar.masrafListesiTekliR(code2);
                    DetailsViewTipM.DataBind();
                    System.Text.StringBuilder sb = new System.Text.StringBuilder();
                    sb.Append(@"<script type='text/javascript'>");
                    sb.Append("$('#detailModalTipM').modal('show');");
                    sb.Append(@"</script>");
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "DetailModalScriptTip", sb.ToString(), false);
                }
            }
            else if (e.CommandName.Equals("del"))
            {
                string confirmValue = Request.Form["confirm_value"];
                if (confirmValue == "Yes")
                {
                    int code2 = Int32.Parse(e.CommandArgument.ToString().Trim());

                    using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
                    {
                        AyarIslemleri ayarlar = new AyarIslemleri(dc);
                        ayarlar.masrafSilR(code2);;

                        masrafGoster(ayarlar);

                        System.Text.StringBuilder sb = new System.Text.StringBuilder();
                        sb.Append(@"<script type='text/javascript'>");
                        sb.Append(" alertify.success('Kayıt silindi!');");

                        sb.Append(@"</script>");
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditHideModalScriptTipM", sb.ToString(), false);
                    }
                }
            }
            else if (e.CommandName.Equals("editRecord"))
            {
                int         index = Convert.ToInt32(e.CommandArgument);
                GridViewRow gvrow = grdTipM.Rows[index];

                LinkButton link = gvrow.Cells[2].Controls[1] as LinkButton;

                hdnTipIDM.Value       = HttpUtility.HtmlDecode(gvrow.Cells[1].Text);
                txtTipAdM.Text        = HttpUtility.HtmlDecode(link.Text);
                txtTipAciklamaM.Text  = HttpUtility.HtmlDecode(gvrow.Cells[3].Text);
                txtCssGuncelleM.Value = HttpUtility.HtmlDecode(gvrow.Cells[4].Text);

                Label2.Visible = false;
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script type='text/javascript'>");
                sb.Append("$('#editModalTipM').modal('show');");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditModalScriptTip2M", sb.ToString(), false);
            }
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!User.Identity.IsAuthenticated)
            {
                System.Web.HttpContext.Current.Response.Redirect("/Account/Giris.aspx");
            }

            using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
            {
                if (!IsPostBack)
                {
                    AyarCurrent ay = new AyarCurrent(dc);
                    if (ay.lisansKontrol() == false)
                    {
                        Response.Redirect("/LisansError");
                    }
                    AyarIslemleri servis = new AyarIslemleri(dc);
                    List <Radius.service_tips> tipler = servis.tipListesiR();
                    if (tipler != null)
                    {
                        drdTip.AppendDataBoundItems = true;
                        drdTip.DataSource           = tipler;
                        drdTip.DataValueField       = "tip_id";
                        drdTip.DataTextField        = "tip_ad";
                        drdTip.DataBind();
                    }



                    txtKimlikNo.Value = AletEdavat.KimlikUret(10);
                }
                if (User.IsInRole("Admin") || User.IsInRole("mudur"))
                {
                    kullaniciSecim.Visible = true;
                    if (!IsPostBack)
                    {
                        drdKullanici.AppendDataBoundItems = true;

                        drdKullanici.DataSource     = KullaniciIslem.firmaKullanicilari();
                        drdKullanici.DataValueField = "id";
                        drdKullanici.DataTextField  = "userName";
                        drdKullanici.DataBind();
                    }
                }

                string s = txtAra.Value;

                if (!String.IsNullOrEmpty(s))
                {
                    MusteriIslemleri m = new MusteriIslemleri(dc);

                    GridView1.DataSource = m.musteriAraR2(s, "musteri");

                    GridView1.SelectedIndex = 0;
                    GridView1.DataBind();
                }
            }
        }
コード例 #6
0
        private void SmsAyarGoster(AyarIslemleri ayarlar)
        {
            Radius.ayar mail_ayar = ayarlar.SmsAyarR();
            if (mail_ayar != null)
            {
                txtMailKimden2.Text    = mail_ayar.Mail_Kimden;
                txtMailKullanici2.Text = mail_ayar.Mail_UserName;

                drdSaglayici.SelectedValue = mail_ayar.Mail_Server;
                txtMailSifre2.Text         = mail_ayar.Mail_PW;
                txtSmsAktif.Text           = mail_ayar.aktif_adres;
            }
        }
コード例 #7
0
        protected void btnAddRecord_Click(object sender, EventArgs e)
        {
            string dur = rdDurumYeni.SelectedValue;

            string durum = txtAddDurum.Text;
            bool   sms   = chcAddSMS.Checked;
            bool   mail  = chcAddMail.Checked;
            bool   what  = chcAddWhat.Checked;


            bool baslangic = false;
            bool son       = false;
            bool karar     = false;
            bool onay      = false;

            if (String.Equals(dur, "baslangic"))
            {
                baslangic = true;
            }
            else if (String.Equals(dur, "son"))
            {
                son = true;
            }
            else if (String.Equals(dur, "karar"))
            {
                karar = true;
            }
            else if (String.Equals(dur, "onay"))
            {
                onay = true;
            }

            using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
            {
                AyarIslemleri ayarlar = new AyarIslemleri(dc);
                bool          oldumu  = ayarlar.servisDurumEkleR(durum, sms, mail, what, baslangic, son, karar, onay);
                if (oldumu == true)
                {
                    durumGoster(ayarlar);

                    System.Text.StringBuilder sb = new System.Text.StringBuilder();
                    sb.Append(@"<script type='text/javascript'>");
                    sb.Append(" alertify.success('Kayıt yapıldı!');");
                    // sb.Append(alert);
                    sb.Append("$('#addModal').modal('hide');");
                    sb.Append(@"</script>");
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AddHideModalScript2", sb.ToString(), false);
                }
            }
        }
コード例 #8
0
 private void MailAyarGoster(AyarIslemleri ayarlar)
 {
     //AyarIslemleri ayarlarimiz = new AyarIslemleri(firma);
     Radius.ayar mail_ayar = ayarlar.MailAyarR();
     if (mail_ayar != null)
     {
         txtMailKimden.Text    = mail_ayar.Mail_Kimden;
         txtMailKullanici.Text = mail_ayar.Mail_UserName;
         txtMailPort.Text      = mail_ayar.Mail_Port.ToString();
         txtMailServer.Value   = mail_ayar.Mail_Server;
         txtMailSifre.Text     = mail_ayar.Mail_PW;
         txtMailAktif.Text     = mail_ayar.aktif_adres;
     }
 }
コード例 #9
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            int    id    = Int32.Parse(lblID.Value);
            string durum = txtDurum.Text;
            bool   sms   = chcSMS.Checked;
            bool   mail  = chcMail.Checked;
            bool   what  = chcWhat.Checked;
            string dur   = rdDurum.SelectedValue;

            bool baslangic = false;
            bool son       = false;
            bool karar     = false;
            bool onay      = false;

            if (String.Equals(dur, "baslangic"))
            {
                baslangic = true;
            }
            else if (String.Equals(dur, "son"))
            {
                son = true;
            }
            else if (String.Equals(dur, "karar"))
            {
                karar = true;
            }
            else if (String.Equals(dur, "onay"))
            {
                onay = true;
            }

            using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
            {
                AyarIslemleri ayarlar = new AyarIslemleri(dc);
                bool          oldumu  = ayarlar.servisDurumGuncelleR(id, durum, sms, mail, what, baslangic, son, karar, onay);

                if (oldumu == true)
                {
                    durumGoster(ayarlar);

                    System.Text.StringBuilder sb = new System.Text.StringBuilder();
                    sb.Append(@"<script type='text/javascript'>");
                    sb.Append(" alertify.success('Durum güncelleme yapıldı!');");
                    sb.Append("$('#editModal').modal('hide');");
                    sb.Append(@"</script>");
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditHideModalScript", sb.ToString(), false);
                }
            }
        }
コード例 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!User.Identity.IsAuthenticated)
            {
                System.Web.HttpContext.Current.Response.Redirect("/Account/Giris.aspx");
            }
            if (!IsPostBack)
            {
                hdnKul.Value = User.Identity.Name;
                using (Radius.radiusEntities dc = Radius.MyContext.Context(KullaniciIslem.firma()))
                {
                    AyarIslemleri islem = new AyarIslemleri(dc);
                    drdDurum.DataSource     = islem.durumListesiR();
                    drdDurum.DataTextField  = "Durum";
                    drdDurum.DataValueField = "Durum_ID";
                    drdDurum.DataBind();
                }

                string id     = Request.QueryString["durum"];
                string atanan = Request.QueryString["atanan"];
                if (!String.IsNullOrEmpty(id))
                {
                    drdDurum.SelectedValue = id;
                }
                //baslikDetay.InnerText += "-" + atanan;
                if (HttpContext.Current.User.IsInRole("Admin") || User.IsInRole("mudur"))
                {
                    kullaniciSecim.Visible = true;
                    if (!IsPostBack)
                    {
                        drdKullanici.AppendDataBoundItems = true;

                        drdKullanici.DataSource = KullaniciIslem.firmaKullanicilari();

                        drdKullanici.DataValueField = "id";
                        drdKullanici.DataTextField  = "userName";
                        drdKullanici.DataBind();

                        if (!String.IsNullOrEmpty(atanan))
                        {
                            drdKullanici.SelectedValue = atanan;
                        }
                    }
                }
            }
        }
コード例 #11
0
        protected void btnSmsKaydet_Click(object sender, EventArgs e)
        {
            string saglayici = drdSaglayici.SelectedValue;
            string gonderen  = txtMailKimden2.Text;

            string kull  = txtMailKullanici2.Text;
            string sifre = txtMailSifre2.Text;
            string aktif = txtSmsAktif.Text;

            if (!String.IsNullOrEmpty(saglayici))
            {
                using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
                {
                    AyarIslemleri ayarlar = new AyarIslemleri(dc);
                    ayarlar.SmsAyarKaydetR(saglayici, gonderen, kull, sifre, aktif);
                }
            }
        }
コード例 #12
0
        protected void btnDelTipM_Click(object sender, EventArgs e)
        {
            int code2 = Int32.Parse(hdnTipIDM.Value);

            using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
            {
                AyarIslemleri ayarlar = new AyarIslemleri(dc);
                ayarlar.masrafSilR(code2);;

                masrafGoster(ayarlar);

                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script type='text/javascript'>");
                sb.Append(" alertify.success('Kayıt silindi!');");
                sb.Append("$('#editModalTipM').modal('hide');");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditHideModalScriptTipM", sb.ToString(), false);
            }
        }
コード例 #13
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);
        }
コード例 #14
0
        protected void btnMailKaydet_Click(object sender, EventArgs e)
        {
            //AyarIslemleri ayarimiz = new AyarIslemleri(firma);
            string serverimiz = txtMailServer.Value;
            string kimden     = txtMailKimden.Text;
            int    port       = Int32.Parse(txtMailPort.Text);
            string username   = txtMailKullanici.Text;
            string pw         = txtMailSifre.Text;
            string adres      = txtMailAktif.Text;
            string aktif      = txtMailAktif.Text;

            if (!String.IsNullOrEmpty(serverimiz))
            {
                using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
                {
                    AyarIslemleri ayarlar = new AyarIslemleri(dc);
                    ayarlar.MailAyarKaydetR(serverimiz, kimden, port, username, pw, aktif);
                }
            }
        }
コード例 #15
0
        protected void btnAddRecordBirim_Click(object sender, EventArgs e)
        {
            //int id = Int32.Parse(txtTipIDGoster.Text);
            string ad = txtBirimAdGoster.Text;

            using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
            {
                AyarIslemleri ayarlar = new AyarIslemleri(dc);
                ayarlar.birim_ekle(ad);

                birimGoster(ayarlar);

                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script type='text/javascript'>");
                sb.Append(" alertify.success('Kayıt yapıldı!');");
                // sb.Append(alert);
                sb.Append("$('#addModalBirim').modal('hide');");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AddHideModalScriptTip2", sb.ToString(), false);
            }
        }
コード例 #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!User.Identity.IsAuthenticated)
            {
                System.Web.HttpContext.Current.Response.Redirect("/Account/Giris.aspx");
            }

            if (!IsPostBack)
            {
                using (radiusEntities dc = MyContext.Context(firma))
                {
                    AyarIslemleri islem = new AyarIslemleri(dc);

                    drdDurum.AppendDataBoundItems = true;
                    drdDurum.DataSource           = islem.durumListesiR().Where(x => x.baslangicmi == false && x.sonmu == false && x.onaymi == false && x.kararmi == false).ToList();
                    drdDurum.DataTextField        = "Durum";
                    drdDurum.DataValueField       = "Durum_ID";
                    drdDurum.DataBind();
                }
            }
        }
コード例 #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!User.Identity.IsAuthenticated)
            {
                System.Web.HttpContext.Current.Response.Redirect("/Account/Giris.aspx");
            }
            this.Master.servisarama = false;
            this.Master.kisiarama   = false;
            kullanici_repo kullanici = KullaniciIslem.currentKullanici();

            string firma = kullanici.Firma;

            using (radiusEntities dc = MyContext.Context(firma))
            {
                AyarCurrent ay = new AyarCurrent(dc);
                if (ay.lisansKontrol() == false)
                {
                    Response.Redirect("/LisansError");
                }
                AyarIslemleri ayarimiz = new AyarIslemleri(dc);
                if (!IsPostBack)
                {
                    List <Radius.service_tips> tipler = ayarimiz.tipListesiR();
                    drdTip.AppendDataBoundItems = true;
                    drdTip.DataSource           = ayarimiz.tipListesiR();
                    drdTip.DataValueField       = "tip_id";
                    drdTip.DataTextField        = "tip_ad";
                    drdTip.DataBind();


                    drdTipSec.AppendDataBoundItems = true;
                    drdTipSec.DataSource           = ayarimiz.tipListesiR();
                    drdTipSec.DataValueField       = "tip_id";
                    drdTipSec.DataTextField        = "tip_ad";
                    drdTipSec.DataBind();

                    gosterHepsi(kullanici, dc);
                }
            }
        }
コード例 #18
0
        protected void btnSaveTipM_Click(object sender, EventArgs e)
        {
            int    id       = Int32.Parse(hdnTipIDM.Value);
            string ad       = txtTipAdM.Text;
            string aciklama = txtTipAciklamaM.Text;
            string css      = txtCssGuncelleM.Value.Trim();

            using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
            {
                AyarIslemleri ayarlar = new AyarIslemleri(dc);
                ayarlar.masrafGuncelleR(id, ad, aciklama, css);

                masrafGoster(ayarlar);

                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script type='text/javascript'>");
                sb.Append(" alertify.success('Kaydedildi!');");
                sb.Append("$('#editModalTipM').modal('hide');");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditHideModalScriptTipM", sb.ToString(), false);
            }
        }
コード例 #19
0
        private void MesajGonder(radiusEntities dc, TeknikServis.Radius.customer musteri_bilgileri)
        {
            //if (chcMail.Checked == true)
            //{

            //    //ServisDAL.MailIslemleri mi = new MailIslemleri(KullaniciIslem.kullanici_convert(kullanici));
            //    //string ekMesaj = "Geçerlilik Tarihi: <b> " + Convert.ToDateTime(yuklendi.gecerlilik).ToShortDateString();// +"</b> Kullanıcı adı: <b> " + yuklendi.kullaniciAdi + "</b> Şifreniz: <b> " + yuklendi.sifre + "</b>";

            //    //mi.SendingMail(musteri_bilgileri.email, musteri_bilgileri.Ad, "", -1, "kredi", ekMesaj);

            //}

            if (chcSms.Checked == true)
            {
                //SMS gönderme izni
                string ekMesajSms = "Geçerlilik Tarihi: " + Convert.ToDateTime(musteri_bilgileri.expire).ToShortDateString();// +"</b> Kullanıcı adı: " + yuklendi.kullaniciAdi + "</b> Şifreniz:" + yuklendi.sifre;
                ekMesajSms += "Krediniz yüklendi.";
                ServisDAL.SmsIslemleri sms      = new ServisDAL.SmsIslemleri(dc);
                AyarIslemleri          ayarimiz = new AyarIslemleri(dc);
                sms.SmsKredi(ayarimiz, ekMesajSms, new string[] { musteri_bilgileri.telefon });
                //Response.Redirect("/Sonuc.aspx");
            }
        }
コード例 #20
0
        protected void btnAddRecordTipM_Click(object sender, EventArgs e)
        {
            //int id = Int32.Parse(txtTipIDGoster.Text);
            string ad       = txtTipAdGosterM.Text;
            string aciklama = txtTipAciklamaGosterM.Text;
            string css      = txtCssM.Value.Trim();

            using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
            {
                AyarIslemleri ayarlar = new AyarIslemleri(dc);
                ayarlar.masrafEkleR(ad, aciklama, css);

                masrafGoster(ayarlar);

                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script type='text/javascript'>");
                sb.Append(" alertify.success('Kayıt yapıldı!');");
                // sb.Append(alert);
                sb.Append("$('#addModalTipM').modal('hide');");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AddHideModalScriptTip2M", sb.ToString(), false);
            }
        }
コード例 #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!User.Identity.IsAuthenticated || !User.IsInRole("Admin"))
            {
                System.Web.HttpContext.Current.Response.Redirect("/Account/Giris");
            }


            using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
            {
                AyarIslemleri ayarlar = new AyarIslemleri(dc);
                if (!IsPostBack)
                {
                    MailAyarGoster(ayarlar);
                    SmsAyarGoster(ayarlar);
                }


                tipGoster(ayarlar);
                durumGoster(ayarlar);
                masrafGoster(ayarlar);
            }
        }
コード例 #22
0
 private void durumGoster(AyarIslemleri ayarlar)
 {
     GridView1.DataSource = ayarlar.durumListesiR();
     GridView1.DataBind();
 }
コード例 #23
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);
            }
        }
コード例 #24
0
        private void kaydet()
        {
            string secilen = drdDurum.SelectedValue;
            int    index   = drdDurum.SelectedIndex;

            if (index > 0 && index < 6)
            {
                using (radiusEntities dc = MyContext.Context(firma))
                {
                    Radius.mail_ayars ayarimiz = dc.mail_ayars.Where(x => x.tur == secilen).FirstOrDefault();
                    if (ayarimiz == null)
                    {
                        Radius.mail_ayars ayar = new Radius.mail_ayars();
                        ayar.tur        = secilen;
                        ayar.Firma      = firma;
                        ayar.gonderen   = txtGonderen.Text;
                        ayar.durum      = secilen;
                        ayar.iliski_id  = -1;
                        ayar.body_mesaj = txtMesaj.Text;

                        ayar.resim_yol = "";//kullanicinin resim yolunu atalım
                        ayar.Telefon   = txtTelefon.Text;
                        ayar.url       = txtUrl.Text;
                        ayar.konu      = txtKonu.Text;
                        ayar.FirmaTam  = txtFirmaTam.Text;
                        ayar.Adres     = txtAdres.Text;
                        if (chcAktif.Checked == true)
                        {
                            ayar.aktif = chcAktif.Checked;
                        }
                        dc.mail_ayars.Add(ayar);
                    }
                    else
                    {
                        ayarimiz.gonderen   = txtGonderen.Text;
                        ayarimiz.iliski_id  = -1;
                        ayarimiz.body_mesaj = txtMesaj.Text;
                        ayarimiz.resim_yol  = "";//kullanicinin resim yolunu atalım
                        ayarimiz.Telefon    = txtTelefon.Text;
                        ayarimiz.url        = txtUrl.Text;
                        ayarimiz.konu       = txtKonu.Text;
                        ayarimiz.FirmaTam   = txtFirmaTam.Text;
                        ayarimiz.Adres      = txtAdres.Text;
                        if (chcAktif.Checked == true)
                        {
                            ayarimiz.aktif = chcAktif.Checked;
                        }
                    }

                    dc.SaveChanges();
                    System.Text.StringBuilder sb = new System.Text.StringBuilder();
                    sb.Append(@"<script type='text/javascript'>");
                    sb.Append(" alertify.success('Kaydedildi!');");
                    sb.Append(@"</script>");

                    System.Web.UI.ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditHideModalScript", sb.ToString(), false);
                }
            }
            else
            {
                int id = Convert.ToInt32(drdDurum.SelectedValue);
                //string mesele = id.ToString();
                //durumun pozisyonuna bakalım
                using (radiusEntities dc = MyContext.Context(firma))
                {
                    AyarIslemleri ay = new AyarIslemleri(dc);
                    TeknikServis.Radius.service_durums durum = ay.tekDurumR(id);

                    Radius.mail_ayars ayarimiz = dc.mail_ayars.Where(x => x.iliski_id == id).FirstOrDefault();


                    if (ayarimiz == null)
                    {
                        //mesele += " Ayarımız nullmuş";
                        Radius.mail_ayars ayar = new Radius.mail_ayars();
                        ayar.tur        = durum.Durum;
                        ayar.Firma      = firma;
                        ayar.gonderen   = txtGonderen.Text;
                        ayar.iliski_id  = id;
                        ayar.durum      = durum.Durum;
                        ayar.body_mesaj = txtMesaj.Text;


                        ayar.resim_yol = "";//kullanicinin resim yolunu atalım
                        ayar.Telefon   = txtTelefon.Text;
                        ayar.url       = txtUrl.Text;
                        ayar.konu      = txtKonu.Text;
                        ayar.FirmaTam  = txtFirmaTam.Text;
                        ayar.Adres     = txtAdres.Text;
                        if (chcAktif.Checked == true)
                        {
                            ayar.aktif = chcAktif.Checked;
                        }

                        dc.mail_ayars.Add(ayar);

                        dc.SaveChanges();
                    }
                    else
                    {
                        //mesele += " Ayarımız bulduk";
                        //mesele += " " + ayarimiz.ID.ToString();
                        ayarimiz.gonderen   = txtGonderen.Text;
                        ayarimiz.iliski_id  = id;
                        ayarimiz.body_mesaj = txtMesaj.Text;
                        ayarimiz.durum      = durum.Durum;

                        ayarimiz.resim_yol = "";//kullanicinin resim yolunu atalım
                        ayarimiz.Telefon   = txtTelefon.Text;
                        ayarimiz.url       = txtUrl.Text;
                        ayarimiz.konu      = txtKonu.Text;
                        ayarimiz.FirmaTam  = txtFirmaTam.Text;
                        if (chcAktif.Checked == true)
                        {
                            ayarimiz.aktif = chcAktif.Checked;
                        }
                        dc.SaveChanges();
                    }



                    System.Text.StringBuilder sb = new System.Text.StringBuilder();
                    sb.Append(@"<script type='text/javascript'>");
                    sb.Append(" alertify.success('Kaydedildi!');");
                    sb.Append(@"</script>");

                    System.Web.UI.ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditHideModalScript", sb.ToString(), false);
                }
                //Session["mesele"] = mesele;
                //Response.Redirect("/Sonuc");
            }
        }
コード例 #25
0
        private void goster()
        {
            if (drdDurum.SelectedValue != null)
            {
                string secilen = drdDurum.SelectedValue;

                int secilenIndex = drdDurum.SelectedIndex;

                string gonderen = "";
                string mesaj    = "";
                string firmaTam = "";
                string telefon  = "";
                string url      = "";
                string konu     = "";
                string adres    = "";
                string kritik   = "";

                if (secilenIndex > 0 && secilenIndex < 6)
                {
                    //secilen.Equals("yaklasan_taksit") || secilen.Equals("genel")
                    //ön tanımlı durumların hepsi için türü arayacaz
                    using (radiusEntities dc = MyContext.Context(firma))
                    {
                        Radius.mail_ayars ayar = dc.mail_ayars.Where(x => x.tur == secilen).FirstOrDefault();
                        if (ayar != null)
                        {
                            gonderen = ayar.gonderen;
                            mesaj    = ayar.body_mesaj;
                            firmaTam = ayar.FirmaTam;
                            telefon  = ayar.Telefon;
                            url      = ayar.url;
                            konu     = ayar.konu;
                            adres    = ayar.Adres;

                            if (ayar.aktif == true)
                            {
                                chcAktif.Checked = true;
                            }
                            else
                            {
                                chcAktif.Checked = false;
                            }
                        }
                        else
                        {
                            AyarCurrent cur   = new AyarCurrent(dc);
                            var         genel = cur.get();

                            gonderen = genel.adi;

                            firmaTam = genel.adi;
                            telefon  = genel.tel;

                            url = genel.web;

                            adres = genel.adres;
                        }
                    }
                }
                else if (secilen.Equals("sec"))
                {
                    chcAktif.Checked = false;
                }
                else
                {
                    int id = Convert.ToInt32(drdDurum.SelectedValue);


                    //durumun pozisyonuna bakalım
                    using (radiusEntities dc = MyContext.Context(firma))
                    {
                        AyarIslemleri ay = new AyarIslemleri(dc);
                        TeknikServis.Radius.service_durums durum = ay.tekDurumR(id);

                        Radius.mail_ayars ayar = dc.mail_ayars.Where(x => x.iliski_id == id).FirstOrDefault();
                        if (ayar != null)
                        {
                            gonderen = ayar.gonderen;
                            mesaj    = ayar.body_mesaj;
                            firmaTam = ayar.FirmaTam;
                            telefon  = ayar.Telefon;
                            url      = ayar.url;
                            konu     = ayar.konu;
                            adres    = ayar.Adres;
                            kritik   = ayar.kritik_gun.ToString();
                            if (ayar.aktif == true)
                            {
                                chcAktif.Checked = true;
                            }
                            else
                            {
                                chcAktif.Checked = false;
                            }
                        }
                        else
                        {
                            AyarCurrent cur   = new AyarCurrent(dc);
                            var         genel = cur.get();

                            gonderen = genel.adi;

                            firmaTam = genel.adi;
                            telefon  = genel.tel;

                            url = genel.web;

                            adres = genel.adres;
                        }
                    }
                }
                txtMesaj.Text    = mesaj;
                txtGonderen.Text = gonderen;
                txtAdres.Text    = adres;
                txtFirmaTam.Text = firmaTam;
                txtKonu.Text     = konu;
                txtTelefon.Text  = telefon;
                txtUrl.Text      = url;
            }
        }
コード例 #26
0
        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);
            }
        }
コード例 #27
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals("detail"))
            {
                int code2 = Int32.Parse(e.CommandArgument.ToString().Trim());
                using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
                {
                    AyarIslemleri ayarlar = new AyarIslemleri(dc);
                    DetailsView1.DataSource = ayarlar.durumListesiTekliR(code2);
                    DetailsView1.DataBind();
                    System.Text.StringBuilder sb = new System.Text.StringBuilder();
                    sb.Append(@"<script type='text/javascript'>");
                    sb.Append("$('#detailModal').modal('show');");
                    sb.Append(@"</script>");
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "DetailModalScript2", sb.ToString(), false);
                }
            }
            else if (e.CommandName.Equals("del"))
            {
                string confirmValue = Request.Form["confirm_value"];
                if (confirmValue == "Yes")
                {
                    int code2 = Int32.Parse(e.CommandArgument.ToString().Trim());

                    using (radiusEntities dc = MyContext.Context(KullaniciIslem.firma()))
                    {
                        AyarIslemleri ayarlar = new AyarIslemleri(dc);
                        ayarlar.durumSilR(code2);;

                        GridView1.DataSource = ayarlar.durumListesiR();
                        GridView1.DataBind();

                        System.Text.StringBuilder sb = new System.Text.StringBuilder();
                        sb.Append(@"<script type='text/javascript'>");
                        sb.Append(" alertify.success('Kayıt silindi!');");

                        sb.Append(@"</script>");
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditHideModalScript3", sb.ToString(), false);
                    }
                }
            }
            else if (e.CommandName.Equals("editRecord"))
            {
                int         index = Convert.ToInt32(e.CommandArgument);
                GridViewRow gvrow = GridView1.Rows[index];

                LinkButton link = gvrow.Cells[2].Controls[1] as LinkButton;


                lblID.Value = HttpUtility.HtmlDecode(gvrow.Cells[1].Text);

                txtDurum.Text = HttpUtility.HtmlDecode(link.Text);


                chcSMS.Checked  = (gvrow.Cells[3].Controls[0] as CheckBox).Checked;
                chcMail.Checked = (gvrow.Cells[4].Controls[0] as CheckBox).Checked;
                chcWhat.Checked = (gvrow.Cells[5].Controls[0] as CheckBox).Checked;

                if ((gvrow.Cells[6].Controls[0] as CheckBox).Checked)
                {
                    rdDurum.SelectedValue = "son";
                }
                else if ((gvrow.Cells[7].Controls[0] as CheckBox).Checked)
                {
                    rdDurum.SelectedValue = "baslangic";
                }
                else if ((gvrow.Cells[8].Controls[0] as CheckBox).Checked)
                {
                    rdDurum.SelectedValue = "karar";
                }
                else if ((gvrow.Cells[9].Controls[0] as CheckBox).Checked)
                {
                    rdDurum.SelectedValue = "onay";
                }
                else
                {
                    rdDurum.SelectedIndex = -1;
                }


                lblResult.Visible = false;
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script type='text/javascript'>");
                sb.Append("$('#editModal').modal('show');");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditModalScript", sb.ToString(), false);
            }
        }
コード例 #28
0
 private void birimGoster(AyarIslemleri ayarlar)
 {
     grdBirim.DataSource = ayarlar.birimler();
     grdBirim.DataBind();
 }
コード例 #29
0
 private void masrafGoster(AyarIslemleri ayarlar)
 {
     grdTipM.DataSource = ayarlar.masrafListesiGrid();
     grdTipM.DataBind();
 }
コード例 #30
0
 private void tipGoster(AyarIslemleri ayarlar)
 {
     grdTip.DataSource = ayarlar.tipListesiGrid();
     grdTip.DataBind();
 }