Exemplo n.º 1
0
        protected void Button27_Click(object sender, EventArgs e)
        {
            bool load_part1 = false;

            if (TextBox21.Text == "")
            {
                Response.Write("<script language=javascript>alert('資料尚未輸入!')</script>");
            }
            else
            {
                GridView7.Visible = true;
                load_part1        = DAL.DailyMode.Data_Add2(Session["DatabaseName"].ToString(), "通知分包廠商辦理", TextBox21.Text);
                SqlDataSource8.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());
                SqlDataSource8.SelectCommand    = "Select * From Daily_UsualWord where UW_Type='通知分包廠商辦理'";
                GridView7.DataBind();
                TextBox21.Text = "";
            }
            if (load_part1)
            {
                Response.Write("<script language=javascript>alert('資料新增成功!')</script>");
            }
            else
            {
                Response.Write("<script language=javascript>alert('資料新增失敗!')</script>");
            }
        }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if ((Session["UserName"] == null) || (Session["CompanyName"] == null))
     {
         Response.Redirect("Login.aspx");
     }
     Sql_test1.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());
     Sql_test2.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());
     Sql_test3.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());
     Sql_test4.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());
     Sql_test5.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());
     Sql_test6.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());
     Sql_test7.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());
     if (!IsPostBack)
     {
         Unit_DDL.DataSource = Utility.Unitlist.UnitList();
         Unit_DDL.DataBind();
         Unit_DDL1.DataSource = Utility.Unitlist.UnitList();
         Unit_DDL1.DataBind();
         List_Show();
         GridView1.DataBind();
         GridView2.DataBind();
         GridView3.DataBind();
         GridView4.DataBind();
         GridView5.DataBind();
         GridView6.DataBind();
         GridView7.DataBind();
     }
     //Sql_test1.SelectCommand = "SELECT * FROM [UsualWord] WHERE Type = '" + lbl_type1.Text + "' and Content like '%" + TB_UsualWord1.Text + "%' and UnitID is null ORDER BY Sortnumber ASC";
     //Sql_test5.SelectCommand = "SELECT * FROM [UsualWord] WHERE Type = '" + lbl_type2.Text + "' and Content like '%" + TB_UsualWord2.Text + "%' and UnitID is not null ORDER BY Sortnumber ASC";
 }
    protected void Button7_Click(object sender, EventArgs e)
    {
        var list = ws1.selectavailablecar();

        GridView7.DataSource = list;
        GridView7.DataBind();
    }
Exemplo n.º 4
0
 protected void Button29_Click(object sender, EventArgs e)
 {
     GridView7.Visible = true;
     SqlDataSource8.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());
     SqlDataSource8.SelectCommand    = "Select * From Daily_UsualWord where UW_Type='通知分包廠商辦理'";
     GridView7.DataBind();
 }
        protected void Button7_Click(object sender, EventArgs e)
        {
            string        cmd = "exec sp_Profits " + TextBox7.Text;
            string        connectionString = ConfigurationManager.ConnectionStrings["conStr"].ToString();
            SqlConnection con = new SqlConnection(connectionString);

            SqlDataAdapter da = new SqlDataAdapter(cmd, con);

            DataSet ds = new DataSet();

            da.Fill(ds);

            try
            {
                con.Open();
            }
            catch (Exception)
            {
                con.Close();
                return;

                throw;
            }


            GridView7.DataSource = ds;
            GridView7.DataBind();
            con.Close();
        }
Exemplo n.º 6
0
    public void DataViewDemo()
    {
        DataSet1.CategoryDataTable Category = new DataSet1.CategoryDataTable();
        CategoryTableAdapter       catAdap  = new CategoryTableAdapter();

        catAdap.Fill(Category);

        DataSet1.ProductsDataTable Products = new DataSet1.ProductsDataTable();
        ProductsTableAdapter       prodAdap = new ProductsTableAdapter();

        prodAdap.Fill(Products);

        var result = from item in Products
                     select item;
        DataView view = result.AsDataView();

        view.Sort            = "ProductName desc";
        view.RowFilter       = "CategoryID = 65985";
        GridView7.DataSource = view;
        GridView7.DataBind();
        DataSet1.ProductsRow        row    = null;
        List <DataSet1.ProductsRow> myList = new List <DataSet1.ProductsRow>();

        foreach (DataRowView item in view)
        {
            row = (DataSet1.ProductsRow)item.Row;
            myList.Add(row);
        }
        GridView8.DataSource = myList;
        GridView8.DataBind();
    }
Exemplo n.º 7
0
 private void loadPointsToReceived()
 {
     using (SqlConnection sqlcon = new SqlConnection(sqlconstr))
     {
         using (SqlCommand sqlcmd = sqlcon.CreateCommand())
         {
             try
             {
                 sqlcon.Open();
                 sqlcmd.CommandText = "projection_chart_stp";
                 sqlcmd.CommandType = CommandType.StoredProcedure;
                 sqlcmd.Parameters.AddWithValue("@command", "loadPointsToReceived");
                 sqlcmd.Parameters.AddWithValue("@Searchby", ddlsearchby.SelectedValue);
                 sqlcmd.Parameters.AddWithValue("@year2", tboxYear2.Text);
                 GridView7.DataSource = sqlcmd.ExecuteReader();
                 GridView7.DataBind();
                 loadChartData();
             }
             catch (Exception e)
             {
                 errorrmessage(e.Message);
             }
         }
     }
 }
Exemplo n.º 8
0
    protected void GridView7_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView theGrid      = sender as GridView; // refer to the GridView
        int      newPageIndex = 0;

        if (-2 == e.NewPageIndex)
        {
            TextBox     txtNewPageIndex = null;
            GridViewRow pagerRow        = GridView7.BottomPagerRow;


            if (null != pagerRow)
            {
                txtNewPageIndex = (TextBox)pagerRow.FindControl("textbox");   // refer to the TextBox with the NewPageIndex value
            }

            if (null != txtNewPageIndex && txtNewPageIndex.Text != "")
            {
                newPageIndex = int.Parse(txtNewPageIndex.Text) - 1; // get the NewPageIndex
            }
        }
        else
        {
            newPageIndex = e.NewPageIndex;
        }
        GridView7.DataSource = dp.Query_DefectType(TextBox24.Text);
        GridView7.DataBind();
        newPageIndex        = newPageIndex < 0 ? 0 : newPageIndex;
        newPageIndex        = newPageIndex >= GridView7.PageCount ? GridView7.PageCount - 1 : newPageIndex;
        GridView7.PageIndex = newPageIndex;
        GridView7.DataBind();
    }
Exemplo n.º 9
0
        private void ShowQ31muacLW()
        {
            MySqlConnection con = new MySqlConnection(constr);

            try
            {
                con.Open();
                MySqlCommand cmd = new MySqlCommand("select * from muac_lw_crf6 where form_crf_6_id='" + Convert.ToString(Session["form_crf_6_id"]) + "' ", con);
                {
                    MySqlDataAdapter sda = new MySqlDataAdapter();
                    {
                        cmd.Connection    = con;
                        sda.SelectCommand = cmd;
                        DataTable dt = new DataTable();
                        {
                            sda.Fill(dt);
                            GridView7.DataSource = dt;
                            GridView7.DataBind();
                            con.Close();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Response.Write("<script type=\"text/javascript\">alert('" + ex.Message + "')</script>");
            }
            finally
            {
                con.Close();
            }
        }
Exemplo n.º 10
0
 protected void ChooseDefectType_Click(object sender, EventArgs e)
 {
     Panel7.Visible       = true;
     GridView7.DataSource = dp.Query_DefectType("%");
     GridView7.DataBind();
     UpdatePanel7.Update();
 }
Exemplo n.º 11
0
        //public string NumberOfMembers(SqlConnection con, int memberID)
        //{
        //    SqlCommand cmd = new SqlCommand("QueryNumberOfMembersFromMemberToStatsTable", con);
        //    cmd.CommandType = CommandType.StoredProcedure;

        //    cmd.Parameters.AddWithValue("@MemberID",memberID);

        //    return cmd.ExecuteScalar().ToString();
        //}

        //public int ReturnMemberID(SqlConnection con)
        //{
        //    // Use email address to get the member id.
        //    SqlCommand cmd = new SqlCommand("IDofMember", con);
        //    cmd.CommandType = CommandType.StoredProcedure;
        //    SqlParameter Email = new SqlParameter("@Email", userEmail);
        //    cmd.Parameters.Add(Email);

        //    return (int)cmd.ExecuteScalar();

        //}


        // only certain stats should be shown on the default page.
        void FillUpcomingEventsView(SqlConnection sqlCon)
        {
            if (sqlCon.State == ConnectionState.Closed)
            {
                sqlCon.Open();
            }
            SqlDataAdapter sqlDa = new SqlDataAdapter("UpcomingEvents", sqlCon);

            sqlDa.SelectCommand.CommandType = CommandType.StoredProcedure;
            sqlDa.SelectCommand.Parameters.AddWithValue("@TreeID", userTreeID);

            DataTable dtbl = new DataTable();

            sqlDa.Fill(dtbl);
            int events = (int)dtbl.Compute("COUNT(EVENT_NAME)", "");

            if (events == 0)
            {
                NoEvent.Text = "No upcoming Events";
            }
            else
            {
                GridView7.DataSource = dtbl;
                GridView7.DataBind();
            }
        }
Exemplo n.º 12
0
    private void LoadUploadedFilesDetails()
    {
        try
        {
            using (con = dbaccess.GetConnection())
            {
                Datechange();
                DataTable dt = new DataTable();
                GridView7.Dispose();
                string         str = "SELECT 0 + ROW_NUMBER() OVER (ORDER BY BankFileName) AS serial_no,COUNT(BankFileName) AS ActualNoofROws,UPPER(BankFileName) AS BankFileName,SUM(NetAmount) AS TotalAmount  FROM BankPaymentllotment Where Plant_Code='" + pcode.Trim() + "' AND Billfrmdate='" + d1.ToString().Trim() + "' Group By BankFileName ";
                SqlCommand     cmd = new SqlCommand(str, con);
                SqlDataAdapter da  = new SqlDataAdapter(cmd);
                da.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    GridView7.DataSource = dt;
                    GridView7.DataBind();
                }

                else
                {
                    GridView7.DataSource = null;
                    GridView7.DataBind();
                }
            }
        }
        catch (Exception ex)
        {
            ex.ToString();
        }
    }
Exemplo n.º 13
0
    //copy gridview process panel to another gridview
    protected void ButtonGenP_Click(object sender, EventArgs e)
    {
        DataTable dt1 = new DataTable();

        dt1.Columns.Add("Process Size [kB]", typeof(string));


        foreach (GridViewRow gvr in GVProcesses.Rows)
        {
            string var1 = gvr.Cells[0].Text;

            DataRow dr = dt1.NewRow();
            dr["Process Size [kB]"] = var1;

            dt1.Rows.Add(dr);
        }
        GridView7.DataSource = dt1;
        GridView7.DataBind();



        GridView10.DataSource = null;
        GridView10.DataBind();
        GVProcesses.DataSource = null;
        GVProcesses.DataBind();
        DropDownList2.Items.Clear();
        txtNoProcesses.Text = "";
        txtProcessSize.Text = "";
    }
Exemplo n.º 14
0
        protected void LinkButton22_Click(object sender, EventArgs e)
        {
            // zapis grupy specjalizacji

            if (cl.zmien_Grupe_specjalizacji(int.Parse(GridView7.SelectedDataKey[0].ToString().Trim()), TextBox19.Text.Trim()) == "0")
            {
                GridView7.DataBind();
                if (GridView7.Rows.Count >= 0)
                {
                    GridView7.SelectedIndex = 0;
                    try
                    {
                        TextBox19.Text          = GridView7.SelectedDataKey[1].ToString().Trim();
                        Session["id_grupy"]     = GridView7.SelectedDataKey[0].ToString().Trim();
                        Session["id_polecenia"] = 1;// edit
                    }
                    catch
                    {
                        TextBox19.Text          = "";
                        Session["id_polecenia"] = 2;// nowy
                    }
                }
            }
            else
            {
                Label19.Text = "Już istnieje grupa o takiej nazwie";
            }
        }
Exemplo n.º 15
0
        protected void Restock_Click(object sender, EventArgs e)
        {
            startDate    = TextBox12.Text;
            endDate      = TextBox13.Text + " 23:59:59:999";
            Label29.Text = string.Empty;

            SqlDataSource1.SelectParameters.Clear();
            SqlDataSource1.SelectParameters.Add("startDate", startDate);
            SqlDataSource1.SelectParameters.Add("endDate", endDate);
            SqlDataSource1.SelectCommand = "SELECT restock.productID, name, stock_date, stock_quantity, stock_price, company_name from RESTOCK, SUPPLIER, PRODUCT WHERE stock_date BETWEEN CONVERT(datetime, @startDate) " +
                                           "AND CONVERT(datetime, @endDate) AND RESTOCK.companyID = SUPPLIER.companyID AND PRODUCT.productID = RESTOCK.productID";
            SqlDataSource1.CancelSelectOnNullParameter = false;
            if (startDate == "" || endDate == "")
            {
                Label29.Text = "Please enter a valid date range.";
            }
            else
            {
                GridView7.DataSource = SqlDataSource1;
                GridView7.DataBind();
                if (GridView7.Rows.Count == 0)
                {
                    Label29.Text = "No matching results found.";
                }
            }
        }
Exemplo n.º 16
0
    protected void SearchCra_Click(object sender, EventArgs e)
    {
        string name = TextBox24.Text;

        GridView7.DataSource = dp.Query_DefectType(name);
        GridView7.DataBind();
        UpdatePanel7.Update();
    }
 protected void DropDownList10_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (DropDownList10.SelectedIndex == 0)
     {
         GridView7.DataSource = "";
         GridView7.DataBind();
         Label7.Text = "";
     }
 }
Exemplo n.º 18
0
 protected void btnTasmimInsert_Click(object sender, EventArgs e)
 {
     if (txtTasmimTitle.Text != "")
     {
         Value.InsertValues(lblTasmimID.Text, lblTasmimValue.Text, txtTasmimTitle.Text);
     }
     txtTasmimTitle.Text = "";
     GridView7.DataBind();
 }
Exemplo n.º 19
0
    protected void AddDefectTypeSummit_Click(object sender, EventArgs e)
    {
        string po = TextBox31.Text;

        dp.Insert_Defecttype(po);
        Panel8.Visible       = false;
        GridView7.DataSource = dp.Query_DefectType("%");
        GridView7.DataBind();
        UpdatePanel7.Update();
    }
Exemplo n.º 20
0
    protected void freshorgan()
    {
        DataSet        dst  = new DataSet();
        SqlConnection  cnn  = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["dtcnn"].ConnectionString);
        SqlDataAdapter adpt = new SqlDataAdapter("select * from organization", cnn);

        adpt.Fill(dst);
        GridView7.DataSource = dst.Tables[0];
        GridView7.DataBind();
    }
Exemplo n.º 21
0
    protected void Button7_Click(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand("select * from qa", con);

        con.Open();
        SqlDataReader rd = cmd.ExecuteReader();

        GridView7.DataSource = rd;
        GridView7.DataBind();
        con.Close();
    }
 // Updates the grid veiw after adding the new data
 protected void UpdateTablesData()
 {
     GridView1.DataBind();
     GridView2.DataBind();
     GridView3.DataBind();
     GridView4.DataBind();
     GridView5.DataBind();
     GridView6.DataBind();
     GridView7.DataBind();
     GridView8.DataBind();
 }
Exemplo n.º 23
0
        protected void odswiez()
        {
            string yyx = (string)Session["id_dzialu"];

            id_dzialu.Text = (string)Session["txt_dzialu"];
            string txt = string.Empty; //

            cl.deleteRowTable();

            txt = txt + cl.clear_maim_db();
            try
            {
                txt = txt + cl.generuj_dane_do_tabeli_wierszy(Date1.Date, Date2.Date, yyx, 1, tenPlik);
                txt = txt + cl.generuj_dane_do_tabeli_wierszy(Date1.Date, Date2.Date, yyx, 6, tenPlik);
                tabela_02();
                tabela_03();
                tabela_04();
                tabela_05();
                tabela_07();

                /*
                 * txt = txt + cl.generuj_dane_do_tabeli_(int.Parse((string)Session["id_dzialu"]), 2, Date1.Date, Date2.Date);
                 * txt = txt + cl.generuj_dane_do_tabeli_(int.Parse((string)Session["id_dzialu"]), 3, Date1.Date, Date2.Date);
                 * txt = txt + cl.generuj_dane_do_tabeli_(int.Parse((string)Session["id_dzialu"]), 4, Date1.Date, Date2.Date);
                 * txt = txt + cl.generuj_dane_do_tabeli_(int.Parse((string)Session["id_dzialu"]), 5, Date1.Date, Date2.Date);
                 * txt = txt + cl.generuj_dane_do_tabeli_(int.Parse((string)Session["id_dzialu"]), 6, Date1.Date, Date2.Date);
                 * txt = txt + cl.generuj_dane_do_tabeli_(int.Parse((string)Session["id_dzialu"]), 7, Date1.Date, Date2.Date);*/
            }
            catch
            {
            }

            // dopasowanie opisów
            makeLabels();
            GridView1.DataBind();
            GridView2.DataBind();
            GridView3.DataBind();
            GridView4.DataBind();
            GridView6.DataBind();
            GridView7.DataBind();
            GridView8.DataBind();

            try
            {
                Label11.Visible = cl.debug(int.Parse(yyx));
            }
            catch
            {
                Label11.Visible = false;
            }

            Label11.Text = txt;
            Label3.Text  = cl.nazwaSadu((string)Session["id_dzialu"]);
        }
        protected void Button7_Click(object sender, EventArgs e)
        {
            String         query       = "SELECT a.Customer_id, a.Cf_name, a.Cl_name, a.Address, a.Contact_no , c.Product_name, b.Product_size , b.Product_cost , d.Order_quantity , d.Order_cost FROM Customer a , Size_cost b , Product c, Order_table d WHERE (d.Order_quantity > '" + TextBox4.Text + "' AND d.Product_item_no = b.Product_item_no AND b.Product_id = c.Product_id AND a.Customer_id = d.Customer_id)";
            SqlDataAdapter dataadapter = new SqlDataAdapter(query, conx);
            DataSet        ds          = new DataSet();

            dataadapter.Fill(ds);

            GridView7.DataSource = ds;
            GridView7.DataBind();
        }
Exemplo n.º 25
0
 //reset all
 protected void Button5_Click(object sender, EventArgs e)
 {
     Label18.Text         = "";
     Label17.Text         = "";
     TextBox4.Text        = "";
     GridView8.DataSource = null;
     GridView8.DataBind();
     GridView7.DataSource = null;
     GridView7.DataBind();
     GridView3.DataSource = null;
     GridView3.DataBind();
 }
Exemplo n.º 26
0
        protected void odswiez()
        {
            string yyx = (string)Session["id_dzialu"];

            id_dzialu.Text = (string)Session["txt_dzialu"];
            string txt = string.Empty; //

            txt = "File name: <b>oksp.aspx</b></br>";
            txt = txt + "id wydzialu=" + yyx + "</br>";
            cl.deleteRowTable();

            txt = txt + cl.clear_maim_db();
            try
            {
                txt = txt + cl.generuj_dane_do_tabeli_wierszy(Date1.Date, Date2.Date, yyx, 1, tenPlik);
                txt = txt + cl.generuj_dane_do_tabeli_wierszy(Date1.Date, Date2.Date, yyx, 7, tenPlik);

                txt = txt + cl.generuj_dane_do_tabeli_(int.Parse((string)Session["id_dzialu"]), 2, Date1.Date, Date2.Date);
                txt = txt + cl.generuj_dane_do_tabeli_(int.Parse((string)Session["id_dzialu"]), 3, Date1.Date, Date2.Date);
                txt = txt + cl.generuj_dane_do_tabeli_(int.Parse((string)Session["id_dzialu"]), 4, Date1.Date, Date2.Date);
                txt = txt + cl.generuj_dane_do_tabeli_(int.Parse((string)Session["id_dzialu"]), 5, Date1.Date, Date2.Date);
                txt = txt + cl.generuj_dane_do_tabeli_(int.Parse((string)Session["id_dzialu"]), 6, Date1.Date, Date2.Date);

                txt = txt + cl.generuj_dane_do_tabeli_(int.Parse((string)Session["id_dzialu"]), 8, Date1.Date, Date2.Date);
                //txt = txt + cl.uzupelnij_statusy();
            }
            catch
            {
            }

            // dopasowanie opisów
            makeLabels();
            GridView1.DataBind();
            GridView2.DataBind();
            GridView3.DataBind();
            GridView4.DataBind();
            GridView6.DataBind();
            GridView7.DataBind();
            GridView8.DataBind();

            try
            {
                Label11.Visible = cl.debug(int.Parse(yyx));
            }
            catch
            {
                Label11.Visible = false;
            }

            Label11.Text = txt;
            Label3.Text  = cl.nazwaSadu((string)Session["id_dzialu"]);
        }
Exemplo n.º 27
0
        void reklamgetir()
        {
            baglanti.ConnectionString = "provider=Microsoft.Jet.OleDb.4.0; Data Source=" + Server.MapPath("Srezervasyon.mdb");
            baglanti.Open();

            OleDbDataAdapter adap19 = new OleDbDataAdapter("SELECT * FROM reklamlar", baglanti);
            DataSet          dc19   = new DataSet();

            adap19.Fill(dc19, "reklamlar");
            GridView7.DataSource = dc19;
            GridView7.DataBind();
            baglanti.Close();
        }
Exemplo n.º 28
0
 protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
 {
     TextBox152.Text = DropDownList2.SelectedValue;
     Passport_Cost.DataBind();
     Passport_Cost_LC.DataBind();
     Passport_Cost_Post.DataBind();
     Passport_Cost_Post_LC.DataBind();
     GridView1.DataBind();
     GridView2.DataBind();
     GridView6.DataBind();
     GridView7.DataBind();
     DropDownList2.SelectedValue = TextBox152.Text;
 }
Exemplo n.º 29
0
    protected void GridView7_Sorting(object sender, GridViewSortEventArgs e)
    {
        DataTable dataTable = GridView7.DataSource as DataTable;

        if (dataTable != null)
        {
            DataView dataView = new DataView(dataTable);
            dataView.Sort = e.SortExpression + " " + ConvertSortDirectionToSql(e.SortDirection);

            GridView7.DataSource = dataView;
            GridView7.DataBind();
        }
    }
Exemplo n.º 30
0
    public void bindgridview7()
    {
        DataTable dt = new DataTable();

        dt.Columns.AddRange(new DataColumn[3] {
            new DataColumn("Id"), new DataColumn("Name"), new DataColumn("Country")
        });
        dt.Rows.Add(1, "Total No of Students Registered for Placement ", "1512");
        dt.Rows.Add(2, "Total No of Students Got Placed", "1085");
        dt.Rows.Add(3, "% of Students Placed", "71.76");
        dt.Rows.Add(4, "Noteworthy Companies", "Wipro, HCL, Infosys, ICICI, Capgemini, Hexaware, Patni, Logica, Mphasis, US Technologies");
        dt.Rows.Add(5, "Average Salary", "Rs. 2,65,000 P.A");
        GridView7.DataSource = dt;
        GridView7.DataBind();
    }