protected void Button2_Click(object sender, EventArgs e) { if (TextBox5.Text.Length == 0 || DropDownList8.Text.Length == 0) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Δεν έχει συμπληρωθεί το Γραμμάτιο ή το Έτος !!!!');", true); } else { Esoda_Arxis.DataBind(); } }
protected void DropDownList8_SelectedIndexChanged(object sender, EventArgs e) { int etos = Convert.ToInt16(DropDownList8.SelectedValue); TextBox19.Text = FINANCIAL_MANAGEMENT.App_Code.xrisi.XrisiTR(etos).ToString(); //------------------ if (DropDownList8.SelectedValue != "0") { TextBox23.Text = FINANCIAL_MANAGEMENT.App_Code.xrisi.XrisiPL(etos).ToString(); } //------------------- Esoda_Arxis.DataBind(); TextBox16.Text = ""; Button4.Visible = false; TextBox7.Text = ""; TextBox24.Text = ""; TextBox5.Text = ""; DropDownList9.SelectedIndex = 0; DropDownList5.Items.Clear(); DropDownList5.Items.Add(new ListItem(" Επιλογή Μηνός ...", "0")); DropDownList5.DataBind(); //MAX number of Gramm. Eisprajeis if (DropDownList8.SelectedValue != "0") { string Etos_Y = DropDownList8.Text; string strConn; strConn = WebConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString; SqlConnection Conn = new SqlConnection(strConn); Conn.Open(); string sqltitle; sqltitle = "SELECT (ISNULL(MAX(GR_Eiprajeis),0))+1 FROM Esoda"; sqltitle += " WHERE (Etos ='" + Etos_Y + "')"; // sqltitle += " AND (edition ='" + edition + "')"; SqlCommand com = new SqlCommand(sqltitle, Conn); Int32 CurrentQty; CurrentQty = Convert.ToInt32(com.ExecuteScalar()); if (CurrentQty != 0) { // TextBox5.Text = Convert.ToString(CurrentQty); TextBox16.Text = Convert.ToString(CurrentQty); TextBox1.Text = Convert.ToString(CurrentQty); // I WANT TO SHOW HERE THE TEXTBOX3 FROM THE DATABASE QTY if (Convert.ToString(CurrentQty) == "1") { Calc_Sum_Poig_Metaf.DataBind(); Session["Last_GR_Etos"] = DropDownList8.Text; ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "var Mleft = (screen.width/2)-(760/2);var Mtop = (screen.height/2)-(700/2);window.open( '../Parametroi/New_Year_Metafora.aspx', null, 'height=800,width=800,status=yes,toolbar=no,scrollbars=yes,menubar=no,location=no, left=\'+Mleft+\'' );", true); DropDownList9.SelectedValue = "12"; //TextBox7.Text = (string)Session["Calc_SUM_GR_Etos"]; } } Conn.Close(); } Button3.Enabled = true; Button6.Enabled = true; TextBox22.Text = DropDownList8.SelectedValue; DropDownList12.SelectedValue = "7"; if (FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_Xrisi_mina_Tokon() == 0) { DropDownList9.Items.Remove(DropDownList9.Items.FindByValue("20")); } }
protected void Button1_Click(object sender, EventArgs e) { Session["New_ypologo_MultyBanks"] = DropDownList9.SelectedValue; if (CheckBox1.Checked) { TextBox15.Text = DropDownList4.Text; } else { TextBox15.Text = TextBox14.Text; } Esoda_Arxis.DataBind(); if (DropDownList8.SelectedValue == "0" || DropDownList9.SelectedValue == "0" || (TextBox25.Text == "0" && TextBox7.Text.Length == 0 && FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_Xrisi_USD() == 0) || (TextBox25.Text == "1" && (TextBox24.Text.Length == 0 && TextBox7.Text.Length == 0) && FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_Xrisi_USD() == 0) || DropDownList5.SelectedValue == "0" || TextBox15.Text == "0" || TextBox8.Text.Length == 0) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Δεν έχει συμπληρωθεί το Έτος ή το Είδος Εσόδου ή το Ποσό ή Δεν έχει επιλεγεί Μήνας Εσόδου !!!!');", true); } else { TextBox18.Text = "28/" + DropDownList5.Text + "/" + DropDownList8.Text; DateTime dateTime = Convert.ToDateTime(this.TextBox18.Text.Trim(), new CultureInfo("en-GB")); this.TextBox18.Text = dateTime.AddDays(30).ToString("dd/MM/yyyy"); if (Convert.ToDateTime(TextBox8.Text) < Convert.ToDateTime(TextBox18.Text)) { if (DropDownList9.SelectedValue == "12") { Proig_Diax_Met_GR.Delete(); Proig_Diax_Met_GR.Update(); Proig_Diax_Met_GR.Insert(); if (TextBox16.Text == "1") { TextBox19.Text = "1"; } else { TextBox19.Text = (Convert.ToInt16(TextBox19.Text) + 1).ToString(); } Session["Ypo_GR_Etos"] = DropDownList8.Text; Session["Ypol_GR"] = TextBox5.Text; Session["Ypol_Xrisi"] = TextBox19.Text; if (TextBox20.Text == "1") { Gr_leitourgikwn.Insert(); Gr_leitourgikwn.Delete(); } if (TextBox21.Text == "1") { Gr_DimosiesS.Insert(); } Nea_Xrisi.Delete(); Nea_Xrisi.Update(); Nea_Xrisi.Insert(); } else { if (FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_Isotimia() == 1) { decimal isot; if (DropDownList9.SelectedValue == "11") { isot = FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_Isot_Mera_Theti(TextBox27.Text); } else { isot = FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_Isot_Mera(TextBox27.Text); } if (TextBox7.Text.Length == 0 && TextBox30.Text.Length == 0) { TextBox7.Text = Math.Round((Convert.ToDecimal(TextBox24.Text) / isot), 2).ToString(); } if (TextBox24.Text.Length == 0 && TextBox30.Text.Length == 0) { TextBox24.Text = Math.Round((Convert.ToDecimal(TextBox7.Text) * isot), 2).ToString(); } } } if (DropDownList9.SelectedValue == "20") { Tokoi.Insert(); } else { Esoda_Arxis.Insert(); } // if (DropDownList9.SelectedValue != "12") // { if (!CheckBox2.Checked) { Kin_Logariasmon.Insert(); if (DropDownList9.SelectedValue != "20") { Del_Esoda_log.Insert(); } } else { Session["Etos"] = DropDownList8.Text; Session["Month"] = DropDownList5.Text; Session["Xrisi"] = TextBox19.Text; Session["Desc"] = TextBox6.Text; Session["GR_eisp"] = TextBox5.Text; Session["Poso"] = TextBox7.Text; Session["Poso_LC"] = TextBox24.Text; Session["Date_Apost"] = TextBox8.Text; Session["Date_Entry"] = TextBox10.Text; ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "var Mleft = (screen.width/2)-(730/2);var Mtop = (screen.height/2)-(600/2);window.open( '../Esoda/Multy_Logariasmoi.aspx', null, 'height=550,width=660,status=yes,toolbar=no,scrollbars=yes,menubar=no,location=no, left=\'+Mleft+\'' );", true); } // } // Logariasmoi.Update(); if (DropDownList9.SelectedValue == "12") { // Session["Ypo_GR_Etos"] = DropDownList8.Text; // Session["Ypol_GR"] = TextBox5.Text; // Session["Ypol_Xrisi"] = TextBox19.Text; // Server.Transfer("~/Esoda/Delete_Last_GR.aspx"); ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "var Mleft = (screen.width/2)-(760/2);var Mtop = (screen.height/2)-(700/2);window.open( 'Neos_Ypologos_Alagi_Xrisi.aspx', null, 'height=800,width=793,status=no,toolbar=no,scrollbars=yes,menubar=no,location=no, left=\'+Mleft+\'' );", true); } else { if (!CheckBox2.Checked) { Response.Redirect("Esoda.aspx"); } } Button1.Enabled = false; Button3.Enabled = false; Button4.Visible = false; } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Λανθασμένη επιλογή Ημερομηνίας - Δεν μπορεί να επιλεγεί μήνας προγενέστερος του τελευταίου καταχωρημένου Γραμματείου !!!');", true); } } Esoda_Arxis.DataBind(); Esoda_Arxis_Tokoi.DataBind(); }