Пример #1
0
        protected void reload_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
                BILDIRIMLVL1 aktif      = new BILDIRIMLVL1();

                int aktifID = Convert.ToInt32(linkbutton.CommandArgument);
                aktif                = db.BILDIRIMLVL1.FirstOrDefault(i => i.ID_BILDIRIM == aktifID);
                aktif.DURUM          = "Aktif";
                aktif.BILDIRIM_DURUM = "Onay Bekliyor";
                if (db.SaveChanges() > 0)
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Kayıt başarıyla aktife alındı','succsess');", true);
                    bind();
                }
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "Myfunction('Aktife alma işlemi sırasında Hata oluştu','fail');", true);
                    bind();
                }
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Hay Aksi!  Beklenmedik bir hata oluştu :(','fail');", true);
            }
        }
Пример #2
0
        protected void btn_edit_link_Click(object sender, EventArgs e)
        {
            try
            {
                BILDIRIMLVL1 edit = 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

                int editID = Convert.ToInt32(linkbutton.CommandArgument);
                edit = db.BILDIRIMLVL1.FirstOrDefault(i => i.ID_BILDIRIM == editID);
                var      FullDate = edit.TARIHSAAT;
                string[] parce    = FullDate.Split(' ');



                IDsecret.Text                = Convert.ToString(edit.ID_BILDIRIM);
                txtTarih_Edit.Text           = parce[0];
                txtSaat_Edit.Text            = parce[1];
                ddlMudahilPersonel_edit.Text = edit.MUDAHIL_PERSONEL.ToUpper();
                ddlKategori_Edit.Text        = edit.KATEGORI;
                txtBildirimMetin_Edit.Text   = edit.ACIKLAMA;
                ddlOnlemBool_edit.Text       = edit.ONLEMBOOL;
                ddlBirim_Edit.Text           = edit.BIRIM;
                ddl_Lokasyon_Edit.Text       = edit.LOKASYON;
                ddlBildirimYapan_Edit.Text   = edit.PERSONEL_AD.ToUpper();
                ass.ImageUrl      = "~/Upload/" + edit.GORSEL.ToString();
                ddlDurumEdit.Text = edit.DURUM;
                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);
            }
        }
Пример #3
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 = "<table width="100%" border="0" cellspacing="0"> <tbody> <tr> <td align="center" valign="top" style="background-color: #f0f0f0; padding: 20px"> <table width="100%" border="0" cellspacing="0" style="box-sizing: border-box;"> <tbody> <tr> <td style="background-color: #4791d2; border-bottom: 2px solid #367fbe; height: 6px;"></td> </tr> <tr> <td style="background-color: #fff; text-align: left; padding: 20px;"> <p style="font-family: Tahoma; font-size: 12px"> Sayın " + deleteBILDIRIM.MUDAHIL_PERSONEL + " ",<br /> Seviye 1 İSG Bildiriminde Müdahil Personel Olarak Atandığınız Bildirim Silinmiştir. <br/> <br/>Silinen bildirimin detaylarını aşağıdaki tablodan inceleyebilirsiniz. </p> <table style="width: 100%; border-width: 1px; border-style: solid; border-collapse: collapse; font-size: 10pt; font-family: Tahoma;" bordercolor="black"> <tbody> <tr style="width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;"> <td style="width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;">Tarih ve Saat</td> <td style="width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;">" + deleteBILDIRIM.TARIHSAAT + "</td> </tr> <tr style="width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #F7FBFF;"> <td style="width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;">Lokasyon</td> <td style="width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;">" + deleteBILDIRIM.LOKASYON + "</td> </tr> <tr style="width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;"> <td style="width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;">Birim</td> <td style="width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;">" + deleteBILDIRIM.BIRIM + "</td> </tr> <tr style="width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #F7FBFF;"> <td style="width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;">Kategori</td> <td style="width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;">" + deleteBILDIRIM.KATEGORI + "</td> </tr> <tr style="width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;"> <td style="width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;">Vardiya</td> <td style="width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;">" + ddlVardiya.Text + "</td> </tr> <tr style="width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;"> <td style="width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;">Bildiren Personel</td> <td style="width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;">" + deleteBILDIRIM.PERSONEL_AD + "</td> </tr> <tr style="width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;"> <td style="width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;">Bildirim Metni</td> <td style="width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;">" + deleteBILDIRIM.ACIKLAMA + "</td> </tr> </tbody> </table> </td> </tr> <tr> <td style="background-color: #4791d2; border-top: 2px solid #367fbe; height: 6px;"></td> </tr> </tbody> </table> </td> </tr> </tbody> </table>";

                    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);
            }
        }
Пример #4
0
        protected void edit_Kaydet_Click(object sender, EventArgs e)
        {
            try
            {
                //
                BILDIRIMLVL1 edit = new BILDIRIMLVL1();

                int editID = Convert.ToInt32(IDsecret.Text);

                edit = db.BILDIRIMLVL1.FirstOrDefault(i => i.ID_BILDIRIM == editID);

                string tarih = txtTarih_Edit.Text;
                string saat  = txtSaat_Edit.Text;
                string Date  = tarih + " " + saat;
                edit.TARIHSAAT   = Date;
                edit.VARDIYA     = ddlVardiya_Edit.SelectedValue;
                edit.PERSONEL_AD = ddlBildirimYapan_Edit.SelectedValue;
                edit.BIRIM       = ddlBirim_Edit.SelectedValue;
                edit.KATEGORI    = ddlKategori_Edit.SelectedValue;
                edit.LOKASYON    = ddl_Lokasyon_Edit.SelectedValue;
                edit.ONLEMBOOL   = ddlOnlemBool_edit.SelectedValue;
                edit.DURUM       = ddlDurumEdit.SelectedValue;
                edit.ACIKLAMA    = txtBildirimMetin_Edit.Text;
                edit.AKSIYON     = txtAksiyon_Edit.Text;
                if (edit.GORSEL.ToUpper() == imgEdit.FileName.ToString())
                {
                    edit.GORSEL = imgEdit.FileName.ToString();
                }
                edit.MUDAHIL_PERSONEL = ddlMudahilPersonel_edit.SelectedValue;

                if (db.SaveChanges() > 0)
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Bildirim Güncellendi','succsess');", true);
                    bind();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Bildirim güncellenemedi','fail');", true);
                }
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "myFunction('Hay Aksi!  Beklenmedik bir hata oluştu :(','fail');", true);
            }
        }
Пример #5
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 = "<table width="100%" border="0" cellspacing="0"> <tbody> <tr> <td align="center" valign="top" style="background-color: #f0f0f0; padding: 20px"> <table width="100%" border="0" cellspacing="0" style="box-sizing: border-box;"> <tbody> <tr> <td style="background-color: #4791d2; border-bottom: 2px solid #367fbe; height: 6px;"></td> </tr> <tr> <td style="background-color: #fff; text-align: left; padding: 20px;"> <p style="font-family: Tahoma; font-size: 12px"> Sayın " + ddlMudahilPerson.Text + ",<br /> Seviye 1 İSG Bildiriminde Müdahil Personel Olarak Atandınız. </p> <table style="width: 100%; border-width: 1px; border-style: solid; border-collapse: collapse; font-size: 10pt; font-family: Tahoma;" bordercolor="black"> <tbody> <tr style="width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;"> <td style="width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;">Tarih ve Saat</td> <td style="width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;">" + Date + "</td> </tr> <tr style="width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #F7FBFF;"> <td style="width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;">Lokasyon</td> <td style="width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;">" + ddlLokasyon.Text + "</td> </tr> <tr style="width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;"> <td style="width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;">Birim</td> <td style="width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;">" + ddlBirim.Text + "</td> </tr> <tr style="width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #F7FBFF;"> <td style="width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;">Kategori</td> <td style="width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;">" + ddlKategori.Text + "</td> </tr> <tr style="width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;"> <td style="width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;">Vardiya</td> <td style="width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;">" + ddlVardiya.Text + "</td> </tr> <tr style="width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;"> <td style="width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;">Bildiren Personel</td> <td style="width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;">" + ddlBildirimYapan.Text + "</td> </tr> <tr style="width: 100%; border: 1px solid black; border-collapse: collapse; background-color: #FFFFFF;"> <td style="width: 20%; border: 1px solid black; border-collapse: collapse; text-align: left; font-weight: bold;">Bildirim Metni</td> <td style="width: 80%; border: 1px solid black; border-collapse: collapse; text-align: left;">" + txtBildirimMetin.Text + "</td> </tr> </tbody> </table> </td> </tr> <tr> <td style="background-color: #4791d2; border-top: 2px solid #367fbe; height: 6px;"></td> </tr> </tbody> </table> </td> </tr> </tbody> </table>";



                    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);
            }
        }