コード例 #1
0
        protected void get_gr_max()
        {
            if (TextBox28.Text != "0")
            {
                string Etos_Y = TextBox28.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);
                    TextBox20.Text = Convert.ToString(CurrentQty);
                }

                Conn.Close();
            }


            Passport.DataBind();
            GridView1.DataBind();
            GridView2.DataBind();
        }
コード例 #2
0
        protected void get_gr_max()
        {
            if (TextBox28.Text != "0")
            {
                string Etos_Y = TextBox28.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);
                    TextBox20.Text = Convert.ToString(CurrentQty);
                }

                Conn.Close();
            }
            if (DropDownList4.SelectedValue == "1")
            {
                //               GridView1.DataSourceID = "Ensimo";
                //               GridView2.DataSourceID = "Ensimo";Nautiliaka
                GridView6.DataSourceID = "Ensimo_AN";
                GridView5.DataSourceID = "Ensimo_proigoumeno";
                GridView5.DataBind();
                GridView1.DataBind();
                GridView2.DataBind();
                GridView6.DataBind();
                TextBox29.Text = "2";
            }
            else if (DropDownList4.SelectedValue == "2")
            {
                //               GridView1.DataSourceID = "Passport";
                //               GridView2.DataSourceID = "Passport";
                GridView6.DataSourceID = "Passport_AN";
                GridView5.DataSourceID = "Passport_proigoumeno";
                GridView5.DataBind();
                GridView1.DataBind();
                GridView6.DataBind();
                GridView2.DataBind();
                TextBox29.Text = "6";
            }

            else if (DropDownList4.SelectedValue == "4")
            {
                //             GridView1.DataSourceID = "Visa";
                //              GridView2.DataSourceID = "Visa";
                GridView6.DataSourceID = "Visa_AN";
                GridView5.DataSourceID = "Visa_proigoumeno";
                GridView5.DataBind();
                GridView1.DataBind();
                GridView2.DataBind();
                GridView6.DataBind();
                TextBox29.Text = "4";
            }
            else if (DropDownList4.SelectedValue == "5")
            {
                //              GridView1.DataSourceID = "FET";
                //              GridView2.DataSourceID = "FET";
                GridView6.DataSourceID = "FET_AN";
                GridView5.DataSourceID = "FET_proigoumeno";
                GridView5.DataBind();
                GridView1.DataBind();
                GridView2.DataBind();
                GridView6.DataBind();
                TextBox29.Text = "30";
            }
            else if (DropDownList4.SelectedValue == "6")
            {
                //              GridView1.DataSourceID = "Tokon";
                //               GridView2.DataSourceID = "Tokon";
                GridView6.DataSourceID = "Tokon_AN";
                GridView5.DataSourceID = "Tokon_proigoumeno";
                GridView5.DataBind();
                GridView1.DataBind();
                GridView2.DataBind();
                GridView6.DataBind();
                TextBox29.Text = "18";
            }
            if (DropDownList4.SelectedValue == "7")
            {
                //               GridView1.DataSourceID = "Ensimo";
                //               GridView2.DataSourceID = "Ensimo";
                GridView6.DataSourceID = "Nautiliaka_AN";
                GridView5.DataSourceID = "Nautiliaka_proigoumeno";
                GridView5.DataBind();
                GridView1.DataBind();
                GridView2.DataBind();
                GridView6.DataBind();
                TextBox29.Text = "5";
            }
            else if (DropDownList4.SelectedValue == "8")
            {
                //             GridView1.DataSourceID = "Pass_Visa_Ensima";
                //              GridView2.DataSourceID = "Pass_Visa_Ensima";
                GridView6.DataSourceID = "Pass_Visa_Ensima_AN";
                GridView5.DataSourceID = "Pass_Visa_Ensima_proigoumeno";
                GridView5.DataBind();
                GridView1.DataBind();
                GridView2.DataBind();
                GridView6.DataBind();
                TextBox29.Text = "2";
            }


            Passport.DataBind();
            GridView1.DataBind();
            GridView2.DataBind();
        }