protected void Page_Load(object sender, EventArgs e) { //SessionCreator(); if (Session["username"] == null && Session["password"] == null) { Response.Redirect("SignIn.aspx"); } if (Session["username"].ToString() != "admin") { Response.Redirect("SignIn.aspx"); } if (!IsPostBack) { SetFilterValue(); if (Request.QueryString["conf"] != null) { if (Request.QueryString["conf"] == "1") { CatalogFRVN.GenerateDataPresensiWgCs(); Session["info"] = "C1"; Response.Redirect("Peserta.aspx"); } else if (Request.QueryString["conf"] == "2") { CatalogFRVN.ResetDoorprizePeserta(); VendorGatheringData.GenerateDataPresensi(); Session["info"] = "C2"; Response.Redirect("Peserta.aspx"); } } if (Request.QueryString["act"] != null) { if (Request.QueryString["act"] == "1") { string recordID = Cryptography.Blowfish.DecryptCBC(Request.QueryString["recid"]); CatalogFRVN.DelimitPesertaFRVNByRecid(recordID, "admin"); Session["info"] = "A1"; Response.Redirect("Peserta.aspx"); } else if (Request.QueryString["act"] == "3") { string kodeRegistrasi = Cryptography.Blowfish.DecryptCBC(Request.QueryString["regcd"]); DataTable peserta = VendorGatheringData.GetPeserta(kodeRegistrasi); DataTable perusahaan = VendorGatheringData.GetPerusahaan(peserta.Rows[0]["KodePerusahaan"].ToString()); string jenisKelamin = peserta.Rows[0]["JenisKelamin"].ToString() == "1" ? "Laki-laki" : "Perempuan"; //Deleting old ticket FileManager.DeleteFile(Server.MapPath("../Gallery/Ticket/" + kodeRegistrasi + ".PNG")); CreateImageFileWithBarcode(CreateTicketDesignWithBarcode(kodeRegistrasi, peserta.Rows[0]["NamaPeserta"].ToString(), perusahaan.Rows[0]["NamaPerusahaan"].ToString(), string.Empty, string.Empty), kodeRegistrasi, kodeRegistrasi); //sending new ticket same code try { string _namaPeserta2 = peserta.Rows[0]["NamaPeserta2"].ToString(); string _email2 = peserta.Rows[0]["Email2"].ToString(); string _namaJabatan2 = peserta.Rows[0]["NamaJabatan2"].ToString(); string _phone2 = peserta.Rows[0]["Phone2"].ToString(); FRLNBus.Notification.Email.SendRegistrationNotification(peserta.Rows[0]["Email"].ToString(), kodeRegistrasi, peserta.Rows[0]["NamaPeserta"].ToString(), jenisKelamin, peserta.Rows[0]["NamaJabatan"].ToString(), peserta.Rows[0]["Email"].ToString(), peserta.Rows[0]["Phone"].ToString(), peserta.Rows[0]["Catatan"].ToString(), perusahaan.Rows[0]["NamaPerusahaan"].ToString(), perusahaan.Rows[0]["Email"].ToString(), perusahaan.Rows[0]["Alamat"].ToString(), perusahaan.Rows[0]["NamaKota"].ToString(), perusahaan.Rows[0]["KodePos"].ToString(), perusahaan.Rows[0]["Telpon"].ToString(), perusahaan.Rows[0]["Fax"].ToString(), _namaPeserta2, _email2, _namaJabatan2, _phone2, Server.MapPath("../Gallery/Ticket/" + kodeRegistrasi + ".PNG")); } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal({title: 'Terjadi kegagalan pengiriman email!', type: 'warning'});", true); } Session["info"] = "A6"; Response.Redirect("Peserta.aspx"); } } } if (Session["info"] != null) { if (Session["info"].ToString() == "C2") { ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal({title: 'Update peserta ke sistem presensi berhasil!', type: 'success'});", true); } else if (Session["info"].ToString() == "A1") { ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal({title: 'Peserta berhasil dihapus dari sistem', type: 'warning'});", true); } else if (Session["info"].ToString() == "A3") { ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal({title: 'Update data peserta berhasil!', type: 'success'});", true); } else if (Session["info"].ToString() == "A6") { ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal({title: 'Pengiriman email notifikasi berhasil!', type: 'success'});", true); } else { } Session["info"] = null; } }
protected void Page_Load(object sender, EventArgs e) { //SessionCreator(); if (Session["username"] == null && Session["password"] == null) { Response.Redirect("SignIn.aspx"); } if (Session["username"].ToString() != "admin") { Response.Redirect("SignIn.aspx"); } if (!IsPostBack) { SetFilterValue(); if (Request.QueryString["conf"] != null) { if (Request.QueryString["conf"] == "1") { CatalogFRVN.GenerateDataPresensiWgCs(); Session["info"] = "C1"; Response.Redirect("Certificate.aspx"); } else if (Request.QueryString["conf"] == "2") { CatalogFRVN.ResetDoorprizePeserta(); VendorGatheringData.GenerateDataPresensi(); Session["info"] = "C2"; Response.Redirect("Certificate.aspx"); } } if (Request.QueryString["act"] != null) { if (Request.QueryString["act"] == "1") { string recordID = Cryptography.Blowfish.DecryptCBC(Request.QueryString["recid"]); CatalogFRVN.DelimitPesertaFRVNByRecid(recordID, "admin"); Session["info"] = "A1"; Response.Redirect("Certificate.aspx"); } else if (Request.QueryString["act"] == "3") { string regCode = Cryptography.Blowfish.DecryptCBC(Request.QueryString["regcd"]); DataTable data = VendorGatheringData.GetPresensiPeserta(regCode); string _namaPerusahaan = data.Rows[0]["NamaPerusahaan"].ToString(); string _alamat = data.Rows[0]["Alamat"].ToString(); string _email = data.Rows[0]["Email"].ToString(); try { //Delete last certificate FileManager.DeleteFile(Server.MapPath("../Gallery/Certificate/" + regCode + ".PNG")); //Create new certificate CreateCertificate(CreateName(_namaPerusahaan, _alamat), regCode); if (!VendorGatheringData.IsDownloadedSKT(Filtering.FilterValidSqlQuery(regCode))) { VendorGatheringData.InsertDownloadedSKT(regCode, "admin"); } FRLNBus.Notification.Email.SendEmailAsAttachedCertificate(_email, _namaPerusahaan, Server.MapPath("../Gallery/Certificate/" + regCode + ".PNG")); Session["info"] = "A6"; } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal({title: 'Terjadi kegagalan pengiriman email!', type: 'warning'});", true); } Response.Redirect("Certificate.aspx"); } } } if (Session["info"] != null) { if (Session["info"].ToString() == "C2") { ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal({title: 'Update peserta ke sistem presensi berhasil!', type: 'success'});", true); } else if (Session["info"].ToString() == "A1") { ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal({title: 'Peserta berhasil dihapus dari sistem', type: 'warning'});", true); } else if (Session["info"].ToString() == "A3") { ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal({title: 'Update data peserta berhasil!', type: 'success'});", true); } else if (Session["info"].ToString() == "A6") { ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal({title: 'Pengiriman email notifikasi unduh sertifikat berhasil!', type: 'success'});", true); } else if (Session["info"].ToString() == "A7") { ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "swal({title: 'Terjadi kegagalan pengiriman email!', type: 'warning'});", true); } Session["info"] = null; } }