protected void Button2_Click(object sender, EventArgs e) { if (TextBox3.Text.Length == 0 || TextBox4.Text.Length == 0 || TextBox5.Text.Length == 0 || TextBox6.Text.Length == 0 || TextBox7.Text.Length == 0 || TextBox8.Text.Length == 0 || TextBox9.Text.Length == 0 || TextBox10.Text.Length == 0 || TextBox11.Text.Length == 0 || TextBox16.Text.Length == 0 || TextBox17.Text.Length == 0 || TextBox18.Text.Length == 0 || TextBox22.Text.Length == 0 || DropDownList1.SelectedValue == "0") { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Ελλειπή Στοιχεία!!!!');", true); } else { if ((string)Session["New_Apoleies_DT"] == "0") { Apoleies.Insert(); } else { Apoleies.Update(); } if ((string)Session["Return_TO_Ap_FD"] == "0") { Response.Redirect("Apoleies_Kinisis.aspx"); } else { Response.Redirect("Apoleies_Kinisis_FD.aspx"); } } }
protected void Button15_Click(object sender, EventArgs e) { TextBox174.Text = "1"; ABE_Update_Desc.Update(); Apoleies.Update(); Button15.Enabled = false; ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Επιτυχής Αποθήκευση !');", true); }
protected void Button11_Click(object sender, EventArgs e) { xrisi(); TextBox160.Text = "1"; if (TextBox13.Text.Length == 0 || TextBox138.Text.Length == 0 || TextBox139.Text.Length == 0 || TextBox140.Text.Length == 0 || TextBox141.Text.Length == 0 || TextBox142.Text.Length == 0 || TextBox143.Text.Length == 0 || TextBox161.Text.Length == 0 || TextBox162.Text.Length == 0 || TextBox163.Text.Length == 0 || TextBox164.Text.Length == 0 || TextBox165.Text.Length == 0 || TextBox166.Text.Length == 0 || TextBox167.Text.Length == 0 || TextBox168.Text.Length == 0 || TextBox155.Text.Length == 0) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Ελλειπή Στοιχεία!!!!');", true); } else { if (TextBox150.Text == "0") { TextBox160.Text = "2"; Reservations.Insert(); ABE_KINISI.Insert(); Kinisis_Pass_PTE_S.Insert(); string path_return = (string)Session["Return_Path_for_Personel_Tameio_diav"]; String x = "<script type='text/javascript'>window.opener.location.href='" + path_return + "';self.close();</script>"; ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "script", x, false); } else { TextBox160.Text = "2"; Pass_kinisi_for_Grid_Update.Update(); Kinisis_Pass_PTE_S.Update(); Kinisis_Pass_PTE_S.Insert(); TextBox174.Text = "0"; Apoleies.Update(); // string path_return = (string)Session["Return_Path_for_Personel_Tameio_diav"]; // String x = "<script type='text/javascript'>window.opener.location.href='" + path_return + "';self.close();</script>"; // ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "script", x, false); } ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Επιτυχής Αποθήκευση !');", true); TextBox174.Text = "1"; Button1.Enabled = true; } }
protected void DropDownList10_SelectedIndexChanged(object sender, EventArgs e) { string Before_Politis_Select; Before_Politis_Select = DropDownList9.SelectedValue; TextBox25.Text = DropDownList10.SelectedValue; Apoleies.DataBind(); GridView1.DataBind(); DropDownList2.SelectedValue = "2"; DropDownList2_SelectedIndexChanged(null, null); DropDownList9.SelectedValue = Before_Politis_Select; TextBox2.Text = ""; TextBox1.Text = DateTime.Today.ToString("dd/MM/yyyy"); }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { int rowIndex = Convert.ToInt32(e.CommandArgument); GridViewRow row = GridView1.Rows[rowIndex]; TextBox1.Text = row.Cells[12].Text; Apoleies_Report.DataBind(); GridView1.SelectedIndex = -1; if (e.CommandName == "SelectCH") { ReportViewer1.LocalReport.DataSources.Clear(); ReportDataSource rds1 = new ReportDataSource(); rds1.Name = "DataSet1"; rds1.Value = Apoleies_Report; ReportViewer1.LocalReport.DataSources.Add(rds1); ReportViewer1.LocalReport.Refresh(); Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; // Setup the report viewer object and get the array of bytes ReportViewer viewer = ReportViewer1; viewer.ProcessingMode = ProcessingMode.Local; if (row.Cells[13].Text == "True") { viewer.LocalReport.ReportPath = "Apoleies/Apoleies_DAT.rdlc"; } else { viewer.LocalReport.ReportPath = "Apoleies/Apoleies_Pass.rdlc"; } byte[] bytes = viewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); // Now that you have all the bytes representing the PDF report, buffer it and send it to the client. Response.Buffer = true; Response.Clear(); Response.ContentType = mimeType; Response.AddHeader("content-disposition", "attachment; filename=PDF" + "." + extension); Response.BinaryWrite(bytes); // create the file Response.Flush(); // send it to the client to download Response.End(); } else if (e.CommandName == "SelectPTE") { if (FINANCIAL_MANAGEMENT.App_Code.xrisi.Status_For_Apoleies(row.Cells[12].Text) == "False") { if (row.Cells[18].Text == "0") { Reservations.Insert(); TextBox2.Text = (FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_MAX_Reservation() - 1).ToString(); Session["Passport_Person_Kiosk_PTE"] = (FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_MAX_Reservation() - 1).ToString(); Kinisis_Pass_PTE_S.Insert(); Apoleies.Update(); } else { Session["Passport_Person_Kiosk_PTE"] = row.Cells[18].Text; } Session["Return_Path_for_Personel_Tameio_diav"] = "/Apoleies/Apoleies_Kinisis.aspx"; Session["Edit_YN_Pass_PTE"] = "0"; Session["Apoleies_ID_For_Update"] = row.Cells[12].Text; ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "var Mleft = (screen.width/2)-(690/2);var Mtop = (screen.height-500)/2;window.open( '/Kiosk/Kinisis_Pass_PTE.aspx', null, 'height=800,width=1300,directories=no,titlebar=no,status=no,toolbar=no,scrollbars=no,menubar=no,location=no, left=\'+Mleft+\'' );", true); } else { TextBox2.Text = row.Cells[18].Text.ToString(); ReportViewer1.LocalReport.DataSources.Clear(); ReportDataSource rds1 = new ReportDataSource(); rds1.Name = "DataSet1"; rds1.Value = PTE_Report_Data; ReportViewer1.LocalReport.DataSources.Add(rds1); ReportViewer1.LocalReport.Refresh(); Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; // Setup the report viewer object and get the array of bytes ReportViewer viewer = ReportViewer1; viewer.ProcessingMode = ProcessingMode.Local; viewer.LocalReport.ReportPath = "Kiosk/PTE.rdlc"; byte[] bytes = viewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); // Now that you have all the bytes representing the PDF report, buffer it and send it to the client. Response.Buffer = true; Response.Clear(); Response.ContentType = mimeType; Response.AddHeader("content-disposition", "attachment; filename=PDF" + "." + extension); Response.BinaryWrite(bytes); // create the file Response.Flush(); // send it to the client to download Response.End(); } } else if (e.CommandName == "SelectCHDESC") { int check1 = 0; int check2 = 0; if (row.Cells[21].Text == "ΑΠ") { check1 = 0; } else { check1 = 1; } if (FINANCIAL_MANAGEMENT.App_Code.xrisi.Status_For_Apoleies(row.Cells[12].Text) == "False") { check2 = 0; } else { check2 = 1; } if (check1 + check2 == 2)// edit or not pte and diavatirio taytotita ekthothike { Session["Edit_YN_Apoleies"] = "1"; } else { Session["Edit_YN_Apoleies"] = "0"; } Session["New_Apoleies_DT"] = row.Cells[12].Text; Session["Return_TO_Ap_FD"] = "0"; Response.Redirect("Apoleia.aspx"); } else if (e.CommandName == "SelectAP") { if (row.Cells[21].Text == "ΑΠ") { Session["Return_Path_for_Apoleies_AP"] = "Apoleies_Kinisis.aspx"; Session["Apoleies_AP_DESC"] = row.Cells[14].Text + " " + row.Cells[15].Text + ", του " + row.Cells[8].Text; Session["Apoleies_AP_ID"] = row.Cells[12].Text; ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "var Mleft = (screen.width/2)-(450/2);var Mtop = (screen.height-500)/2;window.open( 'AP_Apoleies.aspx', null, 'height=310,width=475,directories=no,titlebar=no,status=no,toolbar=no,scrollbars=no,menubar=no,location=no, left=\'+Mleft+\'' );", true); } else { GridView1.DataBind(); } } }
protected void Button1_Click(object sender, EventArgs e) { xrisi(); if ((string)Session["Update_ABE_WAIT_pass_Schedule"] == "0") { TextBox9.Text = TextBox13.Text + " " + TextBox138.Text; } Find_Date(); if (TextBox9.Text.Length == 0 || TextBox13.Text.Length == 0 || TextBox138.Text.Length == 0 || TextBox139.Text.Length == 0 || TextBox140.Text.Length == 0 || TextBox141.Text.Length == 0 || TextBox142.Text.Length == 0 || TextBox143.Text.Length == 0 || TextBox167.Text.Length == 0 || TextBox168.Text.Length == 0 || TextBox165.Text.Length == 0 || TextBox166.Text.Length == 0 || TextBox161.Text.Length == 0 || TextBox162.Text.Length == 0 || TextBox163.Text.Length == 0 || TextBox164.Text.Length == 0) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Ελλειπή Στοιχεία!!!!');", true); } else { TextBox148.Text = DateTime.ParseExact(TextBox140.Text, "dd/MM/yyyy", null).ToString(); TextBox12.Text = DateTime.Parse(TextBox8.Text).Year.ToString(); // TextBox150.Text = FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_MAX_Reservation().ToString(); xrisi(); TextBox160.Text = "5"; if (TextBox171.Text.Length == 0) { TextBox171.Text = "0"; } if (Convert.ToInt16(TextBox171.Text) == 0 || Convert.ToInt16(TextBox171.Text) == 1 || Convert.ToInt16(TextBox171.Text) == 2 || Convert.ToInt16(TextBox171.Text) == 3) { //Reservations.Insert(); Pass_kinisi_for_Grid_Update.Update(); if (TextBox150.Text == "0") { TextBox150.Text = FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_MAX_Reservation().ToString(); Reservations.Insert(); ABE_KINISI.Insert(); } ABE_KINISI_GET_ABE.Insert(); Kinisis_Pass_PTE_S.Update(); Kinisis_Pass_PTE_S.Insert(); ABE_KINISI.Delete(); } Apoleies.Update(); ReportViewer1.LocalReport.DataSources.Clear(); ReportDataSource rds1 = new ReportDataSource(); rds1.Name = "DataSet1"; rds1.Value = PTE_Report_Data; ReportViewer1.LocalReport.DataSources.Add(rds1); ReportViewer1.LocalReport.Refresh(); Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; // Setup the report viewer object and get the array of bytes ReportViewer viewer = ReportViewer1; viewer.ProcessingMode = ProcessingMode.Local; viewer.LocalReport.ReportPath = "Kiosk/PTE.rdlc"; byte[] bytes = viewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); // Now that you have all the bytes representing the PDF report, buffer it and send it to the client. Response.Buffer = true; Response.Clear(); Response.ContentType = mimeType; Response.AddHeader("content-disposition", "attachment; filename=PDF" + "." + extension); Response.BinaryWrite(bytes); // create the file Response.Flush(); // send it to the client to download Response.End(); } }