Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                Stoixeia_eggrafou_New_T.Delete();
                Analitiki_Katastasi_Pistosi_New_T.Delete();

                ReportViewer1.LocalReport.Refresh();
                return;
            }

            Page.MaintainScrollPositionOnPostBack = true;
            TextBox122.Attributes.Add("readonly", "readonly");

            if (TextBox4.Text.Length == 0)
            {
                TextBox4.Text   = DateTime.Now.ToString();
                TextBox122.Text = DateTime.Today.ToString("dd/MM/yyyy");
            }



            TextBox2.Text = FINANCIAL_MANAGEMENT.App_Code.xrisi.arxi(3).ToString();
            TextBox3.Text = FINANCIAL_MANAGEMENT.App_Code.xrisi.arxi(4).ToString();

            TextBox122.Attributes.Add("readonly", "readonly");
            TextBox127.Text = FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_Isotimia().ToString();

            TextBox128.Text = FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_Isot_Descr(DateTime.Today.ToString("yyyy-MM-dd")).ToString();
        }
Ejemplo n.º 2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Stoixeia_eggrafou_New_T.Delete();
            Analitiki_Katastasi_Pistosi_New_T.Delete();



            if (CheckBox1.Checked)
            {
                if (Convert.ToDateTime(TextBox126.Text) < Convert.ToDateTime(TextBox125.Text))
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                            "alertMessage",
                                                            "alert('Λανθασμένο Ημερολογιακό Διάστημα  !!!!');", true);
                }
                else
                {
                    TextBox123.Text = DateTime.ParseExact(TextBox125.Text, "dd/MM/yyyy", CultureInfo.CurrentCulture).ToString("MM/dd/yyyy");
                    TextBox124.Text = DateTime.ParseExact(TextBox126.Text, "dd/MM/yyyy", CultureInfo.CurrentCulture).ToString("MM/dd/yyyy");
                }
            }
            else
            {
                int year = Convert.ToInt16(DropDownList1.Text);
                if (DropDownList2.SelectedValue == "1")
                {
                    DateTime firstDay = new DateTime(year, 1, 1);
                    DateTime lastDay  = new DateTime(year, 3, 31);
                    TextBox123.Text = firstDay.ToString("MM/dd/yyyy");
                    TextBox124.Text = lastDay.ToString("MM/dd/yyyy");
                }
                if (DropDownList2.SelectedValue == "2")
                {
                    DateTime firstDay = new DateTime(year, 4, 1);
                    DateTime lastDay  = new DateTime(year, 6, 30);
                    TextBox123.Text = firstDay.ToString("MM/dd/yyyy");
                    TextBox124.Text = lastDay.ToString("MM/dd/yyyy");
                }
                if (DropDownList2.SelectedValue == "3")
                {
                    DateTime firstDay = new DateTime(year, 7, 1);
                    DateTime lastDay  = new DateTime(year, 9, 30);
                    TextBox123.Text = firstDay.ToString("MM/dd/yyyy");
                    TextBox124.Text = lastDay.ToString("MM/dd/yyyy");
                }
                if (DropDownList2.SelectedValue == "4")
                {
                    DateTime firstDay = new DateTime(year, 10, 1);
                    DateTime lastDay  = new DateTime(year, 12, 31);
                    TextBox123.Text = firstDay.ToString("MM/dd/yyyy");
                    TextBox124.Text = lastDay.ToString("MM/dd/yyyy");
                }
                if (DropDownList2.SelectedValue == "7")
                {
                    DateTime firstDay = new DateTime(year, 1, 1);
                    DateTime lastDay  = new DateTime(year, 12, 31);
                    TextBox123.Text = firstDay.ToString("MM/dd/yyyy");
                    TextBox124.Text = lastDay.ToString("MM/dd/yyyy");
                }
            }

            if (CheckBox2.Checked)
            {
                Stoixeia_eggrafou_Μ.Insert();
                Analitiki_Katastasi_Pistosi_Μ.Insert();
            }
            else
            {
                Stoixeia_eggrafou.Insert();
                Analitiki_Katastasi_Pistosi.Insert();
            }


            TextBox128.Text = FINANCIAL_MANAGEMENT.App_Code.xrisi.Fetch_Isot_Descr(Convert.ToDateTime(TextBox123.Text).ToString("yyyy-MM-dd")).ToString();


            ReportViewer1.LocalReport.Refresh();
        }