Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string chldPage = Page.AppRelativeVirtualPath;
                if ((chldPage == "~/Uygunsuzluk.aspx"))
                {
                    Page.Title = "Uygunsuzluk";
                }
                if ((chldPage == "~/ISGBildirim.aspx"))
                {
                    Page.Title = "Seviye-1 ISG Bildirim";
                }
                if ((chldPage == "~/TANIM/Lokasyon.aspx"))
                {
                    Page.Title = "Lokasyon";
                }


                lblAd.Text = Session["FullName"].ToString();
                string   username = Session["UserName"].ToString();
                PERSONEL rolUser  = new PERSONEL();
                rolUser = db.PERSONEL.FirstOrDefault(i => i.KULLANICI_ADI == username);


                if (rolUser.Rol != "Admin")
                {
                    panel.Visible = false;
                }
            }
            catch (Exception)
            {
                Response.Redirect("~/giris.aspx");
            }
        }
Example #2
0
        protected void btn_sil_Click(object sender, EventArgs e)
        {
            try
            {
                LinkButton  linkbutton = (LinkButton)sender;                      // get the link button which trigger the event
                GridViewRow row        = (GridViewRow)linkbutton.NamingContainer; // get the GridViewRow that contains the linkbutton

                int      deleteID = Convert.ToInt32(linkbutton.CommandArgument);
                PERSONEL per      = new PERSONEL();
                per = db.PERSONEL.FirstOrDefault(i => i.PERSONEL_ID == deleteID);
                per.KULLANICI_ADI     = null;
                per.BIRIM_PERSONEL    = null;
                per.UNVAN_PERSONEL    = null;
                per.LOKASYON_PERSONEL = null;
                per.Rol = null;

                db.SaveChanges();
                Bind();
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Kullanıcı Silindi!','succsess');", true);
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Hay Aksi!  Beklenmedik bir hata oluştu :(','fail');", true);
            }
        }
Example #3
0
        protected void link_Click(object sender, EventArgs e)
        {
            try
            {
                LinkButton  linkbutton = (LinkButton)sender;                      // get the link button which trigger the event
                GridViewRow row        = (GridViewRow)linkbutton.NamingContainer; // get the GridViewRow that contains the linkbutton

                int      linkID = Convert.ToInt32(linkbutton.CommandArgument);
                PERSONEL per    = new PERSONEL();
                per = db.PERSONEL.FirstOrDefault(i => i.PERSONEL_ID == linkID);
                ddlPersonel_Edit.Text = per.PERSONEL_AD.ToUpper() + " " + per.PERSONEL_SOYAD.ToUpper();
                txtUserNameEdit.Text  = per.KULLANICI_ADI;
                ddlUnvanEdit.Text     = per.UNVAN_PERSONEL;
                ddlLokasyonEdit.Text  = per.LOKASYON_PERSONEL;
                ckblProfilEdit.Items.FindByValue(per.Rol).Selected           = true;
                ckblBirimEdit.Items.FindByValue(per.BIRIM_PERSONEL).Selected = true;

                ddlPersonel_Edit.Enabled = false;


                for (int i = 0; i < ckblBirimEdit.Items.Count; i++)
                {
                    ckblBirimEdit.Items[i].Attributes.Add("onclick", "MutExChkList(this)");
                }
                ScriptManager.RegisterStartupScript(this, GetType(), "serkan", "$('#myModal').modal()", true);//show the modal
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Hay Aksi!  Beklenmedik bir hata oluştu :(','fail');", true);
            }
        }
Example #4
0
        protected void btn_sil_Click(object sender, EventArgs e)
        {
            try
            {
                MODUL_MAILAYAR mailOnay = new MODUL_MAILAYAR();
                mailOnay = db.MODUL_MAILAYAR.FirstOrDefault(i => i.ID_MODUL == 1);
                MailSend     ms             = new MailSend();
                BILDIRIMLVL1 deleteBILDIRIM = new BILDIRIMLVL1();
                LinkButton   linkbutton     = (LinkButton)sender;                      // get the link button which trigger the event
                GridViewRow  row            = (GridViewRow)linkbutton.NamingContainer; // get the GridViewRow that contains the linkbutton
                                                                                       // get the first cell value of the row
                                                                                       // if you want to get controls in templatefield , just use row.FindControl
                int deleteID = Convert.ToInt32(linkbutton.CommandArgument);

                deleteBILDIRIM                = db.BILDIRIMLVL1.FirstOrDefault(i => i.ID_BILDIRIM == deleteID);
                deleteBILDIRIM.DURUM          = "Pasif";
                deleteBILDIRIM.BILDIRIM_DURUM = "Silinmiş";

                PERSONEL per    = new PERSONEL();
                string   fullad = deleteBILDIRIM.MUDAHIL_PERSONEL;
                string[] parce  = fullad.Split(' ');
                string   ad     = parce[0];

                per = db.PERSONEL.FirstOrDefault(i => i.PERSONEL_AD.ToUpper() == ad.ToUpper());
                string MudahilMail = per.EMAIL;



                if (db.SaveChanges() > 0)
                {
                    string c = "&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td align=&quot;center&quot; valign=&quot;top&quot; style=&quot;background-color: #f0f0f0; padding: 20px&quot;&gt; &lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;box-sizing: border-box;&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td style=&quot;background-color: #4791d2; border-bottom: 2px solid #367fbe; height: 6px;&quot;&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style=&quot;background-color: #fff; text-align: left; padding: 20px;&quot;&gt; &lt;p style=&quot;font-family: Tahoma; font-size: 12px&quot;&gt; Sayın " + deleteBILDIRIM.MUDAHIL_PERSONEL + " &quot;,&lt;br /&gt; Seviye 1 İSG Bildiriminde M&#252;dahil Personel Olarak Atandığınız Bildirim Silinmiştir. &lt;br/&gt; &lt;br/&gt;Silinen bildirimin detaylarını aşağıdaki tablodan inceleyebilirsiniz. &lt;/p&gt; &lt;table style=&quot;width: 100%; border-width: 1px; border-style: solid; border-collapse: collapse; font-size: 10pt; font-family: Tahoma;&quot; bordercolor=&quot;black&quot;&gt; &lt;tbody&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Tarih ve Saat&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + deleteBILDIRIM.TARIHSAAT + "&lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #F7FBFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Lokasyon&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + deleteBILDIRIM.LOKASYON + "&lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Birim&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + deleteBILDIRIM.BIRIM + "&lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #F7FBFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Kategori&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + deleteBILDIRIM.KATEGORI + "&lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Vardiya&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + ddlVardiya.Text + "&lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Bildiren Personel&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + deleteBILDIRIM.PERSONEL_AD + "&lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Bildirim Metni&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + deleteBILDIRIM.ACIKLAMA + "&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style=&quot;background-color: #4791d2; border-top: 2px solid #367fbe; height: 6px;&quot;&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;";

                    if (ms.MailGonder(mailOnay.SILME_KAYIT, MudahilMail, "Bildirim Silimi", HttpUtility.HtmlDecode(c).ToString()))
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Bildirim silindi! Bilgilendirme Maili Gönderildi','succsess');", true);
                    }



                    ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Bildirim silindi','succsess');", true);


                    bind();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "Myfunction('iş Tanımı silme işlemi sırasında Hata oluştu','fail');", true);
                    grdBILDIRIM.DataBind();
                }
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Hay Aksi!  Beklenmedik bir hata oluştu :(','fail');", true);
            }
        }
Example #5
0
        // POST api/<controller>
        public HttpResponseMessage Post(giris gr)
        {
            PERSONEL person = new PERSONEL();

            //person = db.PERSONEL.FirstOrDefault(i => i.KULLANICI_ADI == gr.nickname && i.SIFRE == gr.password);

            if (person == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound, "" + gr.nickname + "adlı kullanıcı bulunamadı."));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.OK, person));
            }
        }
Example #6
0
        protected void btnGiris_Click(object sender, EventArgs e)
        {
            PERSONEL enter = new PERSONEL();

            enter = db2.PERSONEL.FirstOrDefault(i => i.KULLANICI_ADI == txtKULLANICIADI.Text);
            if (enter != null && enter.SIFRE == txtPAROLA.Text)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + " Giriş başarılı... Hoşgeldin Serkan Entities " + txtKULLANICIADI.Text + "');", true);
                Session["UserName"] = txtKULLANICIADI.Text;
                Session["FullName"] = enter.PERSONEL_AD + " " + enter.PERSONEL_SOYAD;
                Response.Redirect("PERSONEL/PersonelPaneli.aspx");
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "Yanlış Kullanıcı Adı veya Şifre" + "');", true);
            }
        }
Example #7
0
        protected void btnUygunsuzlukSave_Click(object sender, EventArgs e)
        {
            try
            {
                UYGUNSUZLUK yeniUyg = new UYGUNSUZLUK();
                yeniUyg.TUR            = ddlTur.Text;
                yeniUyg.BIRIM          = ddlBirim.SelectedValue;
                yeniUyg.TESPIT_TARIH   = Convert.ToDateTime(dtpTespitTarih.Text);
                yeniUyg.UYGUNSUZ_DURUM = txtUygnsuzDurum.Text;
                yeniUyg.ONERI_AKSIYON  = txtAksiyon.Text;
                yeniUyg.TESPIT_EDEN_AD = ddlTespitEden.SelectedValue;
                yeniUyg.SORUMLU_AD     = ddlSorumlu.SelectedValue;
                yeniUyg.AKTIFLIK       = "Aktif";
                yeniUyg.TERMIN_TARIH   = Convert.ToDateTime(dateTerminTarihi.Text);
                db.UYGUNSUZLUK.Add(yeniUyg);
                if (db.SaveChanges() > 0)
                {
                    MODUL_MAILAYAR mailOnay = new MODUL_MAILAYAR();
                    mailOnay = db.MODUL_MAILAYAR.FirstOrDefault(i => i.ID_MODUL == 2);
                    MailSend ms     = new MailSend();
                    PERSONEL per    = new PERSONEL();
                    string   fullad = ddlSorumlu.Text;
                    string[] parce  = fullad.Split(' ');
                    string   ad     = parce[0];

                    per = db.PERSONEL.FirstOrDefault(i => i.PERSONEL_AD.ToUpper() == ad.ToUpper());
                    string MudahilMail = per.EMAIL;

                    string mail = "&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td align=&quot;center&quot; valign=&quot;top&quot; style=&quot;background-color: #f0f0f0; padding: 20px&quot;&gt; &lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;box-sizing: border-box;&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td style=&quot;background-color: #4791d2; border-bottom: 2px solid #367fbe; height: 6px;&quot;&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style=&quot;background-color: #fff; text-align: left; padding: 20px;&quot;&gt; &lt;p style=&quot;font-family: Tahoma; font-size: 12px&quot;&gt; Sayın " + ddlSorumlu.SelectedValue + ",&lt;br /&gt; &lt;br /&gt; Adınıza uygunsuzluk kaydı oluşturulmuştur. Aşağıdaki tablodan detayları inceleyebilirsiniz. &lt;/p&gt; &lt;table style=&quot;width: 100%; border-width: 1px; border-style: solid; border-collapse: collapse; font-size: 10pt; font-family: Tahoma;&quot; bordercolor=&quot;black&quot;&gt; &lt;tbody&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Tespit Tarihi&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt; " + dtpTespitTarih.Text + " &lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Termin Tarihi&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + dateTerminTarihi.Text + " &lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #F7FBFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Birim&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt; " + ddlBirim.SelectedValue + "&lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Uygunsuz Durum&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt; " + txtUygnsuzDurum.Text + " &lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #F7FBFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;&#214;nerilen Aksiyon &lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt; " + txtAksiyon.Text + " &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;T&#252;r&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + ddlTur.SelectedValue + " &lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Tespit Eden&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + ddlTespitEden.SelectedValue + "&lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Sorumlu&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + ddlSorumlu.Text + "&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style=&quot;background-color: #4791d2; border-top: 2px solid #367fbe; height: 6px;&quot;&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;";


                    ms.MailGonder(mailOnay.YENI_KAYIT, MudahilMail, "Uygunsuzluk Bildirim Maili", HttpUtility.HtmlDecode(mail).ToString());
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Uygunsuzluk Eklendi','succsess');", true);

                    bind();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Uygunsuzluk Kaydı Oluşturulamadı','fail');", true);
                }
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Hay Aksi!  Beklenmedik bir hata oluştu :(','fail');", true);
            }
        }
Example #8
0
        public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context)
        {
            serkanISGEntities1 db  = new serkanISGEntities1();
            PERSONEL           per = new PERSONEL();

            per = db.PERSONEL.FirstOrDefault(i => i.KULLANICI_ADI == context.UserName);



            if (per != null && per.KULLANICI_ADI.ToLower() == context.UserName.ToLower() && context.Password == per.SIFRE)
            {
                var identity = new ClaimsIdentity(context.Options.AuthenticationType);
                identity.AddClaim(new Claim("sub", context.UserName));
                identity.AddClaim(new Claim("role", "user"));
                context.Validated(identity);
            }
            else
            {
                context.SetError("Oturum Hatası", "Kullanıcı adı veya Şifre Hatalı");
            }
        }
Example #9
0
        protected void btnNewUser_Click(object sender, EventArgs e)
        {
            try
            {
                if (!db.PERSONEL.Any(i => i.KULLANICI_ADI == txtUsername.Text))
                {
                    string a = ddllist.Text;
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('" + a + "');", true);
                    PERSONEL per = new PERSONEL();
                    per = db.PERSONEL.FirstOrDefault(i => i.PERSONEL_AD + " " + i.PERSONEL_SOYAD == ddlPersonel.Text);
                    per.KULLANICI_ADI     = txtUsername.Text;
                    per.UNVAN_PERSONEL    = ddlUnvan.Text;
                    per.Rol               = ckblProfil.SelectedValue;
                    per.BIRIM_PERSONEL    = ckblBirim.SelectedValue;
                    per.LOKASYON_PERSONEL = ddlLokasyon.Text;

                    if (db.SaveChanges() > 0)
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Yeni Kullanıcı Eklendi!','succsess');", true);
                        Bind();
                        //grdKullanici.DataSource = db.PERSONEL.Where(i => i.Rol != null).ToList();
                        //grdKullanici.DataBind();
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Kayıt esnasında bir hata oluştu.','fail');", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Bu kullanıcı adına sahip kullanıcı halihazırda mevcut.','fail');", true);
                }
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Hay Aksi :( Beklenedik bir hata oluştu..','fail');", true);
            }
        }
Example #10
0
        protected void edit_Kaydet_Click(object sender, EventArgs e)
        {
            try
            {
                PERSONEL per = new PERSONEL();
                per = db.PERSONEL.FirstOrDefault(i => i.PERSONEL_AD.ToUpper() + " " + i.PERSONEL_SOYAD == ddlPersonel_Edit.Text.ToUpper());

                if (db.PERSONEL.FirstOrDefault(i => i.KULLANICI_ADI == per.KULLANICI_ADI) != null)
                {
                    per.KULLANICI_ADI     = txtUserNameEdit.Text;
                    per.UNVAN_PERSONEL    = ddlUnvanEdit.Text;
                    per.Rol               = ckblProfilEdit.SelectedValue;
                    per.BIRIM_PERSONEL    = ckblBirimEdit.SelectedValue;
                    per.LOKASYON_PERSONEL = ddlLokasyonEdit.Text;


                    if (db.SaveChanges() > 0)
                    {
                        grdKullanici.DataSource = db.PERSONEL.Where(i => i.Rol != null).ToList();
                        grdKullanici.DataBind();
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Kullanıcı Güncellendi!','succsess');", true);
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Güncelleme Yapılamadı!','fail');", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Güncellemeasdsadas Yapılamadı!','fail');", true);
                }
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Hay Aksi!  Beklenmedik bir hata oluştu :(','fail');", true);
            }
        }
Example #11
0
        protected void btnEKLE_Click(object sender, EventArgs e)
        {
            try
            {
                BILDIRIMLVL1 yeniBildirim = new BILDIRIMLVL1();

                string tarih = txtTarih.Text;
                string saat  = txtSaat.Text;
                string Date  = tarih + " " + saat;
                yeniBildirim.TARIHSAAT        = Date;
                yeniBildirim.VARDIYA          = ddlVardiya.Text;
                yeniBildirim.PERSONEL_AD      = ddlBildirimYapan.Text;
                yeniBildirim.BIRIM            = ddlBirim.Text;
                yeniBildirim.KATEGORI         = ddlKategori.Text;
                yeniBildirim.LOKASYON         = ddlLokasyon.Text;
                yeniBildirim.ONLEMBOOL        = ddlOnlemBool.Text;
                yeniBildirim.ACIKLAMA         = txtBildirimMetin.Text;
                yeniBildirim.AKSIYON          = txtAksiyon.Text;
                yeniBildirim.GORSEL           = imgBildirim.FileName.ToString();
                yeniBildirim.MUDAHIL_PERSONEL = ddlMudahilPerson.Text;
                yeniBildirim.DURUM            = "Aktif";
                yeniBildirim.BILDIRIM_DURUM   = "Onay Bekliyor";

                uygunsuzlukEkle(kontrol);


                imgBildirim.PostedFile.SaveAs(Server.MapPath("~/upload/") + imgBildirim.FileName.ToString());

                db.BILDIRIMLVL1.Add(yeniBildirim);
                if (db.SaveChanges() > 0)
                {
                    MODUL_MAILAYAR mailOnay = new MODUL_MAILAYAR();
                    mailOnay = db.MODUL_MAILAYAR.FirstOrDefault(i => i.ID_MODUL == 1);
                    MailSend ms     = new MailSend();
                    PERSONEL per    = new PERSONEL();
                    string   fullad = ddlMudahilPerson.Text;
                    string[] parce  = fullad.Split(' ');
                    string   ad     = parce[0];

                    per = db.PERSONEL.FirstOrDefault(i => i.PERSONEL_AD == ad);
                    string MudahilMail = per.EMAIL;


                    string c = "&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td align=&quot;center&quot; valign=&quot;top&quot; style=&quot;background-color: #f0f0f0; padding: 20px&quot;&gt; &lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;box-sizing: border-box;&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td style=&quot;background-color: #4791d2; border-bottom: 2px solid #367fbe; height: 6px;&quot;&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style=&quot;background-color: #fff; text-align: left; padding: 20px;&quot;&gt; &lt;p style=&quot;font-family: Tahoma; font-size: 12px&quot;&gt; Sayın " + ddlMudahilPerson.Text + ",&lt;br /&gt; Seviye 1 İSG Bildiriminde M&#252;dahil Personel Olarak Atandınız. &lt;/p&gt; &lt;table style=&quot;width: 100%; border-width: 1px; border-style: solid; border-collapse: collapse; font-size: 10pt; font-family: Tahoma;&quot; bordercolor=&quot;black&quot;&gt; &lt;tbody&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Tarih ve Saat&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + Date + "&lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #F7FBFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Lokasyon&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + ddlLokasyon.Text + "&lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Birim&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + ddlBirim.Text + "&lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #F7FBFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Kategori&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + ddlKategori.Text + "&lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Vardiya&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + ddlVardiya.Text + "&lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Bildiren Personel&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + ddlBildirimYapan.Text + "&lt;/td&gt; &lt;/tr&gt; &lt;tr style=&quot;width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;&quot;&gt; &lt;td style=&quot;width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;&quot;&gt;Bildirim Metni&lt;/td&gt; &lt;td style=&quot;width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;&quot;&gt;" + txtBildirimMetin.Text + "&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style=&quot;background-color: #4791d2; border-top: 2px solid #367fbe; height: 6px;&quot;&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;";



                    ms.MailGonder(mailOnay.YENI_KAYIT, MudahilMail, "Seviye-1 İSG Bildirimi", HttpUtility.HtmlDecode(c).ToString());



                    ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Bildirim Eklendi','succsess');", true);
                    bind();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction(Hay Aksi :('Bildirim Kaydı Oluşturulamadı'fail');", true);
                }
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction(Hay Aksi :(','fail');", true);
            }
        }