protected void Button2_Click(object sender, EventArgs e)
 {
     TextBox29.Text = GridView1.SelectedRow.Cells[11].Text;
     Exoda_Metafora_Leit.Delete();
     Kin_Logariasmon.Delete();
     DS_Dapanes.Delete();
     GridView1.SelectedIndex = -1;
 }
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (TextBox1.Text.Length == 0 || TextBox3.Text.Length == 0 || (TextBox28.Text == "0" && TextBox4.Text.Length == 0) || (TextBox28.Text == "1" && (TextBox26.Text.Length == 0 && TextBox4.Text.Length == 0)) || DropDownList2.SelectedValue.Length == 0)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                        "alertMessage",
                                                        "alert('Δεν έχει συμπληρωθεί το Έτος ή Ημερομηνία ή Περιγραφή ή το Ποσό !!!!');", true);
            }
            else
            {
                if (Convert.ToDateTime(TextBox1.Text) <= Convert.ToDateTime(TextBox7.Text))
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                            "alertMessage",
                                                            "alert('Λανθασμένη επιλογή Ημερομηνίας - Η Περίοδος έχεις κλείσει. !!!!');", true);
                }
                else
                {
                    if (DropDownList2.Text == DateTime.Parse(TextBox1.Text).Year.ToString())
                    {
                        if (TextBox28.Text == "1")
                        {
                            TextBox4.Text = (Convert.ToDecimal(TextBox26.Text) / FINANCIAL_MANAGEMENT.App_Code.xrisi.DS_Isot(DateTime.Parse(TextBox1.Text).Year)).ToString();
                        }

                        DS_Dapanes.Insert();

                        if (TextBox31.Text.Length > 0)
                        {
                            Exoda_Metafora_Leit.Update();
                            Exoda_Metafora_Leit.Insert();
                        }
                        if (TextBox28.Text == "0")
                        {
                            if (GridView2.Rows.Count > 0)
                            {
                                if (string.IsNullOrEmpty(GridView2.Rows[0].Cells[4].Text as string) || GridView2.Rows[0].Cells[4].Text == "&nbsp;")
                                {
                                }
                                else
                                {
                                    TextBox10.Text = GridView2.Rows[0].Cells[4].Text;
                                    Kin_Logariasmon.Insert();
                                }
                            }
                        }
                        if (TextBox28.Text == "1")
                        {
                            if (GridView3.Rows.Count > 0)
                            {
                                if (string.IsNullOrEmpty(GridView3.Rows[0].Cells[4].Text as string) || GridView3.Rows[0].Cells[4].Text == "&nbsp;")
                                {
                                }
                                else
                                {
                                    TextBox10.Text = GridView3.Rows[0].Cells[4].Text;
                                    Kin_Logariasmon.Insert();
                                }
                            }
                        }


                        TextBox1.Text   = "";
                        TextBox2.Text   = "";
                        TextBox3.Text   = "";
                        TextBox4.Text   = "";
                        TextBox26.Text  = "";
                        Button1.Enabled = false;
                        Ypoloipa_DS.DataBind();
                        GridView2.DataBind();
                        GridView3.DataBind();
                    }
                    else
                    {
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                                "alertMessage",
                                                                "alert('Ημερομηνία δαπάνης (Έτος) δεν συμπίπτει με το Έτος Δημοσίων Σχέσεων !!!!');", true);
                    }
                }
            }
        }