protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { TextBox9.Text = DropDownList1.Text; DropDownList2.SelectedIndex = 0; DS_Start_CLose.DataBind(); if (GridView1.Rows.Count > 0) { TextBox8.Text = GridView1.Rows[0].Cells[1].Text; } }
protected void Button2_Click(object sender, EventArgs e) { if (GridView1.Rows.Count > 0) { TextBox8.Text = GridView1.Rows[0].Cells[1].Text; } if (DropDownList2.SelectedValue == "0" || TextBox7.Text.Length == 0) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('!!!! Δεν έχει επιλεγει Έτος ή Ημερομηνία');", true); } else { if (Convert.ToInt16(DropDownList2.SelectedValue) != Convert.ToDateTime(TextBox7.Text).Year) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('!!!! Λάθος Έτος - Ημερομηνία !!!');", true); } else { if (TextBox6.Text == "12345") { if (Convert.ToDateTime(TextBox7.Text) < Convert.ToDateTime(TextBox8.Text)) { DS_Start_CLose.Delete(); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('!!!! Επιλέχθηκε μεταγενέστερη ημερομηνία !!!');", true); } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('!!!! Λάθος Κωδικός - Επεξεργασία !!!!');", true); } } } }