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 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();
            }
        }
Beispiel #3
0
        protected void Button11_Click(object sender, EventArgs e)
        {
            Session["Edit_YN_Pass_pliromi"] = "0";
            xrisi();
            DateTime bday;

            if (TextBox140.Text.Length > 0)
            {
                bday = Convert.ToDateTime(TextBox140.Text);
            }
            else
            {
                bday = DateTime.Today;
            }

            DateTime today = DateTime.Today;

            int age = today.Year - bday.Year;

            if (bday > today.AddYears(-age))
            {
                age--;
            }

            if (DropDownList7.SelectedValue != "0")
            {
                TextBox161.Text = DropDownList7.SelectedValue;
                TextBox162.Text = "2";
            }
            else
            {
                TextBox161.Text = null;
                TextBox162.Text = "0";
            }



            TextBox160.Text = "1";

            if (GridView1.Rows.Count > 0)
            {
                TextBox121.Text = ((Convert.ToDecimal(GridView1.Rows[0].Cells[0].Text))).ToString();
                if (TextBox128.Text == "1")
                {
                    TextBox130.Text = ((Convert.ToDecimal(GridView6.Rows[0].Cells[0].Text))).ToString();
                }
            }

            if (GridView2.Rows.Count > 0)
            {
                TextBox125.Text = ((Convert.ToDecimal(GridView2.Rows[0].Cells[0].Text))).ToString();

                if (TextBox128.Text == "1")
                {
                    TextBox131.Text = ((Convert.ToDecimal(GridView7.Rows[0].Cells[0].Text))).ToString();
                }
            }
            if (TextBox145.Text.Length == 0)
            {
                TextBox145.Text = "01/01/1900";
            }
            TextBox149.Text = DateTime.ParseExact(TextBox145.Text, "dd/MM/yyyy", null).ToString();

            if (TextBox150.Text == "0")
            {
                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 || DropDownList4.SelectedValue == "0")
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                            "alertMessage",
                                                            "alert('Ελλειπή Στοιχεία!!!!');", true);
                }
                else
                {
                    if ((DropDownList2.SelectedValue == "2" && age > 14) || (DropDownList2.SelectedValue == "1" && age <= 14))
                    {
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                                "alertMessage",
                                                                "alert('Λανθασμένη ημερομηνία γεννήσεως  / Τύπος Διαβατηρίου !!!!');", true);
                    }
                    else
                    {
                        Reservations.Insert();
                        ABE_KINISI.Insert();
                        string path_return = (string)Session["Return_Path_for_Personel_Tameio_diav"]; //"/Kiosk/Kinisis_Pass_Kiosk.aspx";

                        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
            {
                if ((DropDownList2.SelectedValue == "2" && age >= 14) || (DropDownList2.SelectedValue == "1" && age < 14))
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                            "alertMessage",
                                                            "alert('Λανθασμένη ημερομηνία γεννήσεως  / Τύπος Διαβατηρίου !!!!');", true);
                }
                else
                {
                    Pass_kinisi_for_Grid_Update.Update();
                    if ((string)Session["Edit_YN_Pass"] == "5")
                    {
                        ABE_KINISI.Update();
                    }
                    string path_return = (string)Session["Return_Path_for_Personel_Tameio_diav"];     //"/Kiosk/Kinisis_Pass_Kiosk.aspx";

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