Ejemplo n.º 1
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (DropDownList2.SelectedValue == "0" || TextBox1.Text.Length == 0 || TextBox4.Text.Length == 0)
     {
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                 "alertMessage",
                                                 "alert(' Ελλειπή Στοιχεία !!!!');", true);
     }
     else
     {
         if ((FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_Isotimia() == 0 && !(String.IsNullOrEmpty(TextBox5.Text)) && (Convert.ToDecimal(GridView1.Rows[0].Cells[2].Text) - Convert.ToDecimal(TextBox5.Text) >= 0)) || (FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_Isotimia() == 1 && (Convert.ToDecimal(GridView2.Rows[0].Cells[2].Text) - Convert.ToDecimal(TextBox6.Text) >= 0)))
         {
             Eggrafo_Aitima.Update();
             Work.Insert();
             Exoda_Arxis.Insert();
             Kin_Logariasmon.Insert();
             TextBox11.Text = "1";
             Work.Update();
             Sinola_ES_EX.DataBind();
             GridView1.DataBind();
             GridView2.DataBind();
             TextBox5.Text = "0";
             TextBox6.Text = "0";
             DropDownList2.SelectedValue = "0";
             TextBox4.Text = DateTime.Today.ToString("dd/MM/yyyy");
             TextBox4_TextChanged(null, null);
         }
         else
         {
             ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                     "alertMessage",
                                                     "alert('Το υπόλοιπο δεν επαρκεί - Το ποσό της Δαπάνης δεν μπορεί να υπερβένει το ποσό της Εκγρίσεως !!!!!!');", true);
         }
     }
 }
        protected void Button14_Click(object sender, EventArgs e)
        {
            if ((string)Session["Works_Ait_Dap"] == "0")
            {
                if ((string)Session["Works_id_Aitima"] == "0")
                {
                    Eggrafo_Aitima.Insert();

                    TextBox30.Text = DropDownList3.SelectedValue;
                    Aitima_Dnsi.Insert();
                    TextBox30.Text = DropDownList4.SelectedValue;
                    Aitima_Dnsi.Insert();
                    TextBox30.Text = DropDownList5.SelectedValue;
                    Aitima_Dnsi.Insert();
                    TextBox30.Text = DropDownList12.SelectedValue;
                    Aitima_Dnsi.Insert();
                }
                else
                {
                    Eggrafo_Rep.Update();

                    Aitima_Dnsi.Delete();
                    TextBox30.Text = DropDownList3.SelectedValue;
                    Aitima_Dnsi.Insert();
                    TextBox30.Text = DropDownList4.SelectedValue;
                    Aitima_Dnsi.Insert();
                    TextBox30.Text = DropDownList5.SelectedValue;
                    Aitima_Dnsi.Insert();
                    TextBox30.Text = DropDownList12.SelectedValue;
                    Aitima_Dnsi.Insert();
                }
            }
            else
            {
                if ((string)Session["Works_id_Aitima"] == "0")
                {
                    Eggrafo_Aitima_UPDATE.Insert();
                    Eggrafo_Aitima.Update();
                }
                else
                {
                    Eggrafo_Aitima_UPDATE.Update();
                    Aitima_Dnsi.Update();
                }
            }
            Response.Redirect("Works.aspx");
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (DropDownList2.Items.Count == 1)
            {
                if (!CheckBox1.Checked & !CheckBox2.Checked)
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                            "alertMessage",
                                                            "alert('Δεν έχει επιλεγεί τρόπος ανάληψης δαπάνης !!!!');", true);
                }
                else
                {
                    if (CheckBox1.Checked)
                    {
                        TextBox7.Text = "999999";
                    }
                    else
                    {
                        TextBox7.Text = DropDownList3.SelectedValue;
                    }

                    Eggrafo_Aitima.Update();

                    Aitima_Dnsi.Update();

                    Eggrafo_Aitima.DataBind();
                    GridView1.DataBind();
                }
            }
            else
            {
                Aitima_Dnsi.Update();

                Eggrafo_Aitima.DataBind();
                GridView1.DataBind();
            }
            if (DropDownList1.SelectedValue == "0")
            {
                string path_return = "Works.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);
            }
        }