protected void Button13_Click(object sender, EventArgs e) { DS_Start.DataBind(); DS_Start_Exists.DataBind(); if (TextBox41.Text.Length == 0 || TextBox43.Text.Length == 0 || (FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_Isotimia() == 1 && TextBox50.Text.Length == 0) || TextBox44.Text.Length == 0 || TextBox46.Text.Length == 0) { if (FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_Isotimia() == 1) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Δεν έχει συμπληρωθεί το Έτος ή το Ποσό σε ΕΥΡΩ και το Ποσό σε Τ.Ν. ή η Έγκριση ή η Ημερομηνία!!!!');", true); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Δεν έχει συμπληρωθεί το Έτος το Ποσό ή η Έγκριση ή η Ημερομηνία!!!!');", true); } } else { if (GridView13.Rows.Count > 0) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Υπάρχει ήδη καταχώρηση για το Έτος, μη δυνατή ενέργεια !!!!');", true); } else { Gr_Dimosion.Insert(); DS_Start.Insert(); Response.Redirect("Param_DS.aspx"); } } }
protected void GridView12_SelectedIndexChanged1(object sender, EventArgs e) { TextBox48.Text = GridView12.SelectedRow.Cells[2].Text; TextBox53.Text = GridView12.SelectedRow.Cells[9].Text; string Etos_Y = TextBox48.Text; string strConn; strConn = WebConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString; SqlConnection Conn = new SqlConnection(strConn); Conn.Open(); string sqltitle; sqltitle = "SELECT Count(*) FROM [DimosiesSxeseis_Dapanes]"; sqltitle += " WHERE (DATEPART(yyyy,Date_DS) ='" + Etos_Y + "')"; // sqltitle += " AND (edition ='" + edition + "')"; SqlCommand com = new SqlCommand(sqltitle, Conn); Int16 CurrentQty; CurrentQty = Convert.ToInt16(com.ExecuteScalar()); if (CurrentQty > 0) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Υπάρχουν καταχωρήσεις δαπανών για το Έτος, Δεν είναι επιτρεπτεί η διαγραφή !!!!');", true); } else { DS_Start.Delete(); Gr_Dimosion.Delete(); Response.Redirect("Param_DS.aspx"); } }