protected void Button2_Click(object sender, EventArgs e) { Emvasmata_SE.Delete(); GR_Emvasmata_Poso_FPA.Delete(); Kin_Logariasmon.Delete(); Exoda_Arxis.Delete(); Response.Redirect("Emvasmata_Apo_A.aspx"); }
protected void Button1_Click(object sender, EventArgs e) { if (DropDownList14.SelectedValue == "0") { TextBox10.Text = TextBox22.Text; TextBox21.Text = DropDownList4.SelectedValue.ToString(); } else if (DropDownList14.SelectedValue == "1") { TextBox10.Text = DropDownList19.SelectedItem.ToString(); TextBox21.Text = DropDownList19.SelectedValue.ToString(); } else { if (GridView3.Rows.Count > 0 && GridView3.Rows[0].Cells[0].Text != "14") { TextBox10.Text = DropDownList19.SelectedItem.ToString(); TextBox21.Text = DropDownList19.SelectedValue.ToString(); } else { TextBox10.Text = TextBox22.Text; TextBox21.Text = DropDownList4.SelectedValue.ToString(); } } if (DateTime.Parse(TextBox8.Text).Month < Convert.ToInt16(DropDownList5.SelectedValue)) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Λανθασμένη επιλογή Ημερομηνίας - Μήνας !!!');", true); } else { TextBox12.Text = DateTime.Now.ToString(); if (DropDownList3.SelectedValue == "0" || (TextBox25.Text == "0" && TextBox7.Text.Length == 0) || (TextBox25.Text == "1" && (TextBox23.Text.Length == 0 && TextBox7.Text.Length == 0)) || TextBox8.Text.Length == 0 || DropDownList5.SelectedValue.Length == 0 || DropDownList4.SelectedValue == "") { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Δεν έχει συμπληρωθεί το Έτος ή το Γραμμάτιο ή το Ποσό ή Δεν έχει επιλεγεί ο Μήνας πραγματοποίησεις του Εμβάσματος !!!!');", true); } else { string strConn_X1; strConn_X1 = WebConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString; SqlConnection Conn_X1 = new SqlConnection(strConn_X1); Conn_X1.Open(); string sqltitle_X1; sqltitle_X1 = "(SELECT ISNULL(MAX([GR_AA]),0)+1 FROM Exoda)"; SqlCommand com_X1 = new SqlCommand(sqltitle_X1, Conn_X1); Int32 CurrentQty_X1; CurrentQty_X1 = Convert.ToInt32(com_X1.ExecuteScalar()); if (CurrentQty_X1 != 0) { TextBox17.Text = Convert.ToString(CurrentQty_X1); } Conn_X1.Close(); if (FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_Isotimia() == 1) { if (TextBox7.Text.Length == 0) { TextBox7.Text = Math.Round((Convert.ToDecimal(TextBox23.Text) / FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_Isot_Mera(TextBox30.Text)), 2).ToString(); } if (TextBox23.Text.Length == 0) { TextBox23.Text = Math.Round((Convert.ToDecimal(TextBox7.Text) * FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_Isot_Mera(TextBox30.Text)), 2).ToString(); } } // } if (DropDownList14.SelectedValue == "2") { GR_Emvasmata_Poso_FPA.Insert(); } Exoda_Arxis.Insert(); Kin_Logariasmon.Insert(); Emvasmata_SE.Insert(); GridView1.DataBind(); Response.Redirect("Emvasmata_Apo_A.aspx"); } } }