コード例 #1
0
    void loadData()
    {
        SqlConnection conn = new SqlConnection(constr);

        conn.Open();
        string         SqlStr1  = $"select [comID] ,[comName] ,[comPrice] ,[comType] ,[comSurplus] ,[comIntroduction] ,[comAddress] ,[saleStatu] from [webordertable]";
        SqlDataAdapter data1    = new SqlDataAdapter(SqlStr1, conn);
        DataSet        dataset1 = new DataSet();

        data1.Fill(dataset1, "webordertable");
        //绑定DataList控件
        GridView1.DataSource   = dataset1;
        GridView1.DataKeyNames = new string[] { "comID" };
        GridView1.DataBind();

        string         SqlStr2  = $"select [comID] ,[comName] ,[comPrice] ,[comType] ,[comSurplus] ,[comIntroduction] ,[comAddress] ,[saleStatu] from [webordertable] where saleStatu='待上架'";
        SqlDataAdapter data2    = new SqlDataAdapter(SqlStr2, conn);
        DataSet        dataset2 = new DataSet();

        data2.Fill(dataset2, "webordertable");
        //绑定DataList控件
        GridView2.DataSource   = dataset2;
        GridView2.DataKeyNames = new string[] { "comID" };
        GridView2.DataBind();

        string         SqlStr3  = $"select [comID] ,[comName] ,[comPrice] ,[comType] ,[comSurplus] ,[comIntroduction] ,[comAddress] ,[saleStatu] from [webordertable] where saleStatu='已发售'";
        SqlDataAdapter data3    = new SqlDataAdapter(SqlStr3, conn);
        DataSet        dataset3 = new DataSet();

        data3.Fill(dataset3, "webordertable");
        //绑定DataList控件
        GridView3.DataSource   = dataset3;
        GridView3.DataKeyNames = new string[] { "comID" };
        GridView3.DataBind();

        string         SqlStr4  = $"select [comID] ,[comName] ,[comPrice] ,[comType] ,[comSurplus] ,[comIntroduction] ,[comAddress] ,[saleStatu] from [webordertable] where saleStatu='已售罄'";
        SqlDataAdapter data4    = new SqlDataAdapter(SqlStr4, conn);
        DataSet        dataset4 = new DataSet();

        data4.Fill(dataset4, "webordertable");
        //绑定DataList控件
        GridView4.DataSource   = dataset4;
        GridView4.DataKeyNames = new string[] { "comID" };
        GridView4.DataBind();

        string         SqlStr5  = $"select [comID] ,[comName] ,[comPrice] ,[comType] ,[comSurplus] ,[comIntroduction] ,[comAddress] ,[saleStatu] from [webordertable] where saleStatu='已下架'";
        SqlDataAdapter data5    = new SqlDataAdapter(SqlStr5, conn);
        DataSet        dataset5 = new DataSet();

        data5.Fill(dataset5, "webordertable");
        //绑定DataList控件
        GridView5.DataSource   = dataset5;
        GridView5.DataKeyNames = new string[] { "comID" };
        GridView5.DataBind();

        conn.Close();
    }
コード例 #2
0
    public void addfeeinfo()
    {
        SqlDataAdapter da = new SqlDataAdapter("Select * from add_fee where batch='" + batch_ddl.SelectedItem.ToString() + "'and class='" + class_ddl.SelectedItem.ToString() + "'and section='" + section_ddl.SelectedItem.ToString() + "' and  stream='" + stream_ddl.SelectedItem.ToString() + "' ", con);
        DataTable      dt = new DataTable();

        da.Fill(dt);
        GridView5.DataSource = dt;
        GridView5.DataBind();
    }
コード例 #3
0
        public void binddetailbook()
        {
            TrainBLL tbll = new TrainBLL();
            DataSet  ds   = new DataSet();

            ds = tbll.displaybook();
            GridView5.DataSource = ds;
            GridView5.DataBind();
        }
コード例 #4
0
        // }


        protected void btnAssignUser_Click(object sender, EventArgs e)
        {
            hidTAB.Value = "#tab5";
            if (string.IsNullOrEmpty(this.ddlMakers.Text))
            {
                this.lblAssgnUserMsg.Text = MessageFormatter.GetFormattedErrorMessage("Maker Name required!");
                return;
            }

            if (string.IsNullOrEmpty(this.ddlcheckers.Text))
            {
                this.lblAssgnUserMsg.Text = MessageFormatter.GetFormattedErrorMessage("Checker Name required!");
                return;
            }



            con.Open();

            try
            {
                OracleCommand cmd = new OracleCommand();
                // Set the command text on an OracleCommand object
                cmd.Connection  = con;
                cmd.CommandType = CommandType.Text;
                cmd.BindByName  = true;
                cmd.CommandText = "insert into CDMS.CM_MAKER_CHECKER_XREF (MAKER_ID,CHECKER_ID)" +
                                  " values (:p_MakerID,:p_CheckerID)";  //

                OracleParameter prm = new OracleParameter();
                cmd.Parameters.Add(":p_MakerID", OracleDbType.Int32).Value   = Convert.ToInt32(this.ddlMakers.SelectedValue);
                cmd.Parameters.Add(":p_CheckerID", OracleDbType.Int32).Value = Convert.ToInt32(this.ddlcheckers.SelectedValue);

                // Execute the command
                var rst = cmd.ExecuteNonQuery();
                this.lblAssgnUserMsg.Text = MessageFormatter.GetFormattedSuccessMessage("User assigned sucessfully!");

                //Emailing
                EmailHelper Email = new EmailHelper();
                Email.UserAssignmentMailSender(this.ddlMakers.SelectedValue, this.ddlcheckers.SelectedValue);

                this.ddlMakers.SelectedValue   = "";
                this.ddlcheckers.SelectedValue = "";
            }
            catch (Exception ex)
            {
                lblAssgnUserMsg.Text = MessageFormatter.GetFormattedErrorMessage(ex.Message);
            }

            // Close and Dispose OracleConnection object
            con.Close();
            con.Dispose();

            //bind data to gridview
            GridView5.DataBind();
        }
コード例 #5
0
        private void BindDataList4()
        {
            int     RecordCount = 0;
            DataSet ds          = BusinessFacadeDLT.GetUserTrackInfo(Request.QueryString["TrackAcceptID"].ToString(), AspNetPager4.CurrentPageIndex, AspNetPager4.PageSize);

            GridView5.DataSource = ds;
            GridView5.DataBind();
            RecordCount = int.Parse(ds.Tables[1].Rows[0][0].ToString());
            this.AspNetPager4.RecordCount = RecordCount;
        }
コード例 #6
0
    protected void freshbindingtype()
    {
        DataSet        dst  = new DataSet();
        SqlConnection  cnn  = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["dtcnn"].ConnectionString);
        SqlDataAdapter adpt = new SqlDataAdapter("select * from binding_type", cnn);

        adpt.Fill(dst);
        GridView5.DataSource = dst.Tables[0];
        GridView5.DataBind();
    }
コード例 #7
0
        public void BindDataRequest()
        {
            List <Requests>   requestList = new List <Requests>();
            RequestDaoSqlImpl requestDao  = new RequestDaoSqlImpl();

            requestList = requestDao.getRequestList(long.Parse(Request.QueryString["requestId"]));

            GridView5.DataSource = requestList;
            GridView5.DataBind();
        }
コード例 #8
0
ファイル: admin_aspx.cs プロジェクト: DanyaSWorlD/ASOIU-nekit
 protected void GridView5_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     using (var context = new MainEntities())
     {
         var model = context.Фильмы.ToList()[e.RowIndex];
         context.Фильмы.Remove(model);
         context.SaveChanges();
     }
     GridView5.DataBind();
 }
コード例 #9
0
ファイル: EditFactors.aspx.cs プロジェクト: elham2155/INS
 protected void btnPardakhtInsert_Click(object sender, EventArgs e)
 {
     if (txtPardakhtTitle.Text != "")
     {
         Value.InsertValues(lblPardakhtID.Text, lblPardakhtValue.Text, txtPardakhtTitle.Text);
     }
     txtPardakhtTitle.Text = "";
     GridView5.DataBind();
     //Response.Redirect("Editfactors.aspx");
 }
コード例 #10
0
ファイル: Index.aspx.cs プロジェクト: zhangminling/SETC-2
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            using (SqlConnection conn = new DB().GetConnection())
            {
                // 焦点图
                string     sql = "select * from Focuses where valid = 1 order by orders desc";
                SqlCommand cmd = new SqlCommand(sql, conn);
                conn.Open();
                SqlDataReader rd = cmd.ExecuteReader();
                Repeater1.DataSource = rd;
                Repeater1.DataBind();
                rd.Close();

                // GridView1 教师通知
                cmd.CommandText = "select top 10 ID,Title,CDT from Articles where SubID = 6 and Status =1 and Finished = 1 Order by Orders Desc,CDT Desc,ID Desc";
                rd = cmd.ExecuteReader();
                GridView1.DataSource = rd;
                GridView1.DataBind();
                rd.Close();

                // GridView2 学生通知
                cmd.CommandText = "select top 10 ID,Title,CDT from Articles where SubID = 7 and Status =1 and Finished = 1 Order by Orders Desc,CDT Desc,ID Desc";
                rd = cmd.ExecuteReader();
                GridView2.DataSource = rd;
                GridView2.DataBind();
                rd.Close();

                // GridView3 学院动态
                cmd.CommandText = "select top 10 ID,Title,CDT from Articles where SubID = 5 and Status =1 and Finished = 1 Order by Orders Desc,CDT Desc,ID Desc";
                rd = cmd.ExecuteReader();
                GridView3.DataSource = rd;
                GridView3.DataBind();
                rd.Close();

                // GridView4 作品展示
                cmd.CommandText = "select top 4 ID,Title,Abs,Author,CoverPhotoURL,CDT,Catalog from Shows where Status =1 Order by Orders Desc,CDT Desc,ID Desc";
                rd = cmd.ExecuteReader();
                GridView4.DataSource = rd;
                GridView4.DataBind();
                rd.Close();

                // GridView5 活动剪影
                cmd.CommandText = "select top 10 ID,Title,CDT from Articles where SubID = 39 and Status =1 and Finished = 1 Order by Orders Desc,CDT Desc,ID Desc";
                rd = cmd.ExecuteReader();
                GridView5.DataSource = rd;
                GridView5.DataBind();
                rd.Close();

                conn.Close();
            }
        }
    }
コード例 #11
0
ファイル: Default.aspx.cs プロジェクト: goodjob-666/rubbish
        /// <summary>
        /// 优质区日志
        /// </summary>
        private void BindData5()
        {
            int     RecordCount = 0;
            DataSet ds          = SqlHelper.ExecuteDataset(ConfigurationManager.AppSettings["MSSql"], "BM_GoodLogList", txtUID8.Text.Trim(),
                                                           AspNetPager5.CurrentPageIndex, AspNetPager5.PageSize);

            GridView5.DataSource = ds.Tables[0];
            GridView5.DataBind();
            RecordCount = int.Parse(ds.Tables[1].Rows[0][0].ToString());
            this.AspNetPager5.RecordCount = RecordCount;
        }
コード例 #12
0
        protected void Button5_Click(object sender, EventArgs e)
        {
            String         query       = "SELECT * FROM Product a , Size_cost b , Order_table c WHERE (c.Product_item_no = b.Product_item_no AND b.Product_id = a.Product_id AND c.Customer_id = '" + TextBox7.Text + "')";
            SqlDataAdapter dataadapter = new SqlDataAdapter(query, conx);
            DataSet        ds          = new DataSet();

            dataadapter.Fill(ds);

            GridView5.DataSource = ds;
            GridView5.DataBind();
        }
コード例 #13
0
 // 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();
 }
コード例 #14
0
        protected void LinkButton13_Click(object sender, EventArgs e)
        {
            GridViewRow gv           = (GridViewRow)(sender as Control).Parent.Parent;
            int         i            = gv.RowIndex;
            LinkButton  LinkButton13 = (LinkButton)GridView5.Rows[i].FindControl("LinkButton13");
            HiddenField HiddenField2 = (HiddenField)GridView5.Rows[i].FindControl("HiddenField2");

            HiddenField_VehicleId_p10.Value = HiddenField2.Value;
            SqlDataSource_Save.Delete();
            GridView5.DataBind();
        }
コード例 #15
0
        protected void radiobuttonlistLocalNonLocal_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataSet ds = new DataSet();

            if (radiobuttonlistCII.SelectedIndex == 2)                   // Terrorist
            {
                if (radiobuttonlistDIA.SelectedIndex == 0)               // Death
                {
                    if (radiobuttonlistLocalNonLocal.SelectedIndex == 0) // Local
                    {
                        Session["casualityType"] = "TerroristDeathL";
                    }
                    else if (radiobuttonlistLocalNonLocal.SelectedIndex == 1) // Non-Local
                    {
                        Session["casualityType"] = "TerroristDeathNL";
                    }
                }
                else if (radiobuttonlistDIA.SelectedIndex == 1)          // Injury
                {
                    if (radiobuttonlistLocalNonLocal.SelectedIndex == 0) // Local
                    {
                        Session["casualityType"] = "TerroristInjuryL";
                    }
                    else if (radiobuttonlistLocalNonLocal.SelectedIndex == 1) // Non-Local
                    {
                        Session["casualityType"] = "TerroristInjuryNL";
                    }
                }
                else if (radiobuttonlistDIA.SelectedIndex == 2)          // Arrested
                {
                    if (radiobuttonlistLocalNonLocal.SelectedIndex == 0) // Local
                    {
                        Session["casualityType"] = "TerroristArrestedL";
                    }
                    else if (radiobuttonlistLocalNonLocal.SelectedIndex == 1) // Non-Local
                    {
                        Session["casualityType"] = "TerroristArrestedNL";
                    }
                }
            }
            ds = select.bindGridView(Session["casualityType"].ToString(), Session["q"].ToString());
            if (ds.Tables[0].Rows.Count > 0)
            {
                GridView5.DataSource = ds;
                GridView5.DataBind();
            }
            else
            {
                GridView5.DataSource = null;
                GridView5.DataBind();
            }
            GridView5.Visible = true;
        }
コード例 #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string connectionString = ConfigurationManager.ConnectionStrings["conStr"].ToString();

            SqlConnection con = new SqlConnection(connectionString);

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

                throw;
            }


            DataSet ds1    = new DataSet();
            string  sqlstr = "select * from Visitor_T";

            SqlDataAdapter da1 = new SqlDataAdapter(sqlstr, con);

            da1.Fill(ds1);

            GridView1.DataSource = ds1;
            GridView1.DataBind();

            DataSet ds2 = new DataSet();

            sqlstr = "select * from Tourist_T";

            SqlDataAdapter da2 = new SqlDataAdapter(sqlstr, con);

            da2.Fill(ds2);

            GridView2.DataSource = ds2;
            GridView2.DataBind();
            con.Close();

            DataSet ds3 = new DataSet();

            sqlstr = "select * from Ticket_T";

            SqlDataAdapter da3 = new SqlDataAdapter(sqlstr, con);

            da3.Fill(ds3);

            GridView5.DataSource = ds3;
            GridView5.DataBind();
            con.Close();
        }
コード例 #17
0
    protected void MakeBind()
    {
        DataSet ds = new DataSet();

        ds = getDataSet();
        DataTable dt = ds.Tables[0];

        dt.DefaultView.Sort = SortField + " " + SortDir;

        GridView5.DataSource = dt.DefaultView;
        GridView5.DataBind();
    }
 //显示员工资料至 GridView5
 void ShowData()
 {
     using (SqlConnection cn = new SqlConnection())
     {
         cn.ConnectionString = sqlconn;
         cn.Open();
         SqlCommand    cmd = new SqlCommand("SELECT * FROM equipment", cn);
         SqlDataReader dr  = cmd.ExecuteReader();
         GridView5.DataSource = dr;
         GridView5.DataBind();
     }
 }
コード例 #19
0
ファイル: BOM.aspx.cs プロジェクト: qimengcheng/xi
 protected void Button38_Click(object sender, EventArgs e)
 {
     GridView5.DataSource = bom.Query_Material(TextBox21.Text, TextBox22.Text);
     GridView5.DataBind();
     Panel51.Visible = false;
     Panel5.Visible  = true;
     Panel52.Visible = true;
     Panel53.Visible = false;
     Panel6.Visible  = false;
     UpdatePanel5.Update();
     UpdatePanel6.Update();
 }
コード例 #20
0
        protected void btngreporte_Click(object sender, EventArgs e)
        {
            if (DropDownList1.SelectedItem.Text == "Seleccione Prueba")
            {
                lblmensaje.Text = "Debe elegir el tipo de usuario";
                DropDownList1.Focus();
            }
            else
            {
                oeresultado_d.idusuario = TextBox1.Text.Trim();
                oeresultado_d.n_prueba  = DropDownList1.SelectedIndex.ToString().Trim();
                ds1 = ortotal.resTotalesD(oeresultado_d);
                GridView3.DataSource = ds1;
                GridView3.DataBind();

                oeresultado_c.idusuario = TextBox1.Text.Trim();
                oeresultado_c.n_prueba  = DropDownList1.SelectedIndex.ToString().Trim();
                ds2 = ortotal.resTotalesC(oeresultado_c);
                GridView2.DataSource = ds2;
                GridView2.DataBind();

                oeresultado_i.idusuario = TextBox1.Text.Trim();
                oeresultado_i.n_prueba  = DropDownList1.SelectedIndex.ToString().Trim();
                ds3 = ortotal.resTotalesI(oeresultado_i);
                GridView4.DataSource = ds3;
                GridView4.DataBind();

                oeresultado_s.idusuario = TextBox1.Text.Trim();
                oeresultado_s.n_prueba  = DropDownList1.SelectedIndex.ToString().Trim();
                ds4 = ortotal.resTotalesS(oeresultado_s);
                GridView5.DataSource = ds4;
                GridView5.DataBind();
                GridView2.Visible     = true;
                GridView3.Visible     = true;
                GridView4.Visible     = true;
                GridView5.Visible     = true;
                btnlimpiar.Visible    = true;
                DropDownList1.Enabled = false;
                validaciones();
                btngreporte.Enabled = false;

                string D, I, S, C;
                D = ds1.Tables[0].Rows[0]["SumaD"].ToString();
                I = ds3.Tables[0].Rows[0]["SumaI"].ToString();
                S = ds4.Tables[0].Rows[0]["SumaS"].ToString();
                C = ds2.Tables[0].Rows[0]["SumaC"].ToString();

                txtD.Text = D;
                txtI.Text = I;
                txtS.Text = S;
                txtC.Text = C;
            }
        }
コード例 #21
0
        protected void UpLoad_Click(object sender, EventArgs e)
        {
            string database    = Session["DatabaseName"].ToString();
            String savepath    = DAL.SystemSet.savePath(Session["DatabaseName"].ToString());
            string ProjectCode = Session["ProjectCode"].ToString();
            string RFQ_Code    = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(TxNo.Text));

            if (FileUpload1.HasFile)
            {
                String fileName = FileUpload1.FileName;

                fileName = DateTime.Now.ToString("yyyy-MM-dd-HHmmss") + "_" + fileName;
                string Name = AttachName.Text;
                savepath += fileName;
                string kind = DDL_kind.SelectedItem.Text;
                FileUpload1.SaveAs(savepath);
                // FileUpload1.SaveAs(System.Web.HttpContext.Current.Server.MapPath(savepath)); //上傳檔案


                string[] name     = fileName.Split('_');
                string   realname = name[1];

                Response.Write("<script>alert('" + kind + "" + realname + "已上傳');</script>");
                string    SQLInsert    = "RFQ_Code,Name,Type,Path";
                DataTable DataTableBox = new DataTable();
                foreach (string DataName in SQLInsert.Split(','))
                {
                    DataTableBox.Columns.Add(DataName, typeof(string));
                }

                DataRow DataTableDr = DataTableBox.NewRow();


                DataTableDr["RFQ_Code"] = RFQ_Code;
                DataTableDr["Name"]     = Name;
                DataTableDr["Type"]     = kind;
                DataTableDr["Path"]     = savepath;

                DataTableBox.Rows.Add(DataTableDr);

                string insert = WebModel.SaveAction(database, "RFQ_File", DataTableBox);
                GridView5.DataBind();
                if (insert != "1")
                {
                    Response.Write("<script>alert('" + kind + "" + realname + "已上傳,資料庫更新失敗');</script>");
                }
            }
            else
            {
                Response.Write("<script>alert('圖說" + FileUpload1.FileName + "上傳失敗');</script>");
            }
        }
コード例 #22
0
        protected void currenttimetbl()
        {
            Service1Client com = new Service1Client();

            GridView2.DataSource = com.GetCurrentComTimeTable();
            GridView2.DataBind();

            GridView3.DataSource = com.GetCurrentEngTimeTable();
            GridView3.DataBind();

            GridView5.DataSource = com.GetCurrentMngTimeTable();
            GridView5.DataBind();
        }
コード例 #23
0
        void seansgetir()
        {
            baglanti.ConnectionString = "provider=Microsoft.Jet.OleDb.4.0; Data Source=" + Server.MapPath("Srezervasyon.mdb");
            baglanti.Open();

            OleDbDataAdapter adap14 = new OleDbDataAdapter("Select seanslar.Kimlik,seanslar.saat,filmler.filmadi From seanslar INNER JOIN filmler  ON  seanslar.filmid=filmler.Kimlik ", baglanti);
            DataSet          dc14   = new DataSet();

            adap14.Fill(dc14);
            GridView5.DataSource = dc14;
            GridView5.DataBind();
            baglanti.Close();
        }
コード例 #24
0
ファイル: admin.aspx.cs プロジェクト: aj-rajiv/online-exam
    protected void Button5_Click(object sender, EventArgs e)
    {
        SqlCommand     cmd = new SqlCommand("select * from apti where name='" + TextBox2.Text + "'", con);
        SqlDataAdapter ad  = new SqlDataAdapter(cmd);

        cmd.Parameters.AddWithValue("@name", TextBox2.Text);
        con.Open();
        SqlDataReader rd = cmd.ExecuteReader();

        GridView5.DataSource = rd;
        GridView5.DataBind();
        con.Close();
    }
コード例 #25
0
 private void View4_databind()
 {
     if (!DropDownList7.SelectedValue.Equals("-1"))
     {
         GridView4.DataBind();
         Chart4.DataBind();
         GridView5.DataSource = SqlDataSource11;
         GridView5.DataBind();
         Label14.Text    = DropDownList7.SelectedItem.Text + " results";
         Label16.Visible = true;
         Label17.Visible = true;
     }
 }
コード例 #26
0
        private void DQIBE4BVNPageDataBind()
        {
            hidTAB.Value = "#tab3";
            //string cat = "INDIVIDUAL";
            //string branch = "001";
            OracleCommand cmd = new OracleCommand();

            cmd.Connection  = con;
            cmd.CommandText = "select table_category,table_name,column_name, sum(failed_pct) as Completeness_Failed_PCT,sum(VALIDITY_FAILED_PCT) as Correctness_Failed_PCT " +
                              "from DQI_PROFILE_RESULT group by table_category,table_name,column_name order by table_category desc";
            cmd.CommandType = System.Data.CommandType.Text;
            cmd.BindByName  = true;

            try
            {
                con.Open();

                //cmd.Parameters.Add("cust", OracleDbType.RefCursor).Direction = ParameterDirection.Output;

                DataSet           ds = new DataSet();
                OracleDataAdapter da = new OracleDataAdapter();
                da.SelectCommand = cmd;
                da.Fill(ds);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    GridView5.DataSource = ds;
                    GridView5.DataBind();
                }
                else
                {
                    ds.Tables[0].Rows.Add(ds.Tables[0].NewRow());
                    GridView5.DataSource = ds;
                    GridView5.DataBind();
                    int columncount = GridView5.Rows[0].Cells.Count;
                    GridView5.Rows[0].Cells.Clear();
                    GridView5.Rows[0].Cells.Add(new TableCell());
                    GridView5.Rows[0].Cells[0].ColumnSpan = columncount;
                    GridView5.Rows[0].Cells[0].Text       = "No Records Found";
                }
            }
            catch (Exception ex)
            {
                lblMsg.Text = MessageFormatter.GetFormattedErrorMessage(ex.Message + " <br />"); //ex.StackTrace +
            }
            finally
            {
                con.Close();
                // con.Dispose();
            }
        }
コード例 #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Convert.ToBoolean(Session["giris"]) != true)
            {
                Response.Redirect("LoginRegisterPage.aspx?msg=Oncelikle giris yapmalisiniz");
            }
            else
            {
                string        baglan  = ConfigurationManager.ConnectionStrings["baglan"].ToString();
                SqlConnection baglan2 = new SqlConnection(baglan);
                string        KulAd   = "'" + Convert.ToString(Session["KullaniciAdi"]) + "'";

                string Kullaniciadi = "'" + Convert.ToString(Session["KullaniciAdi"]) + "'";
                /*Kullanici Bilgileri*/
                string         sql2     = "select * from KullaniciTable where KullaniciAdi=" + KulAd;
                SqlDataAdapter adaptor2 = new SqlDataAdapter(sql2, baglan2);
                DataTable      dt2      = new DataTable();
                adaptor2.Fill(dt2);
                Label1.Text     = dt2.Rows[0]["Adi"].ToString();
                Label2.Text     = dt2.Rows[0]["Soyadi"].ToString();
                Image1.ImageUrl = dt2.Rows[0]["KullaniciFoto"].ToString();

                /*Kitap Okuma*/

                DataSet okunankitap = Islemler.okunankitap(Kullaniciadi);
                GridView1.DataSource = okunankitap.Tables[0];
                GridView1.DataBind();

                /*Puan Tablosu*/

                DataSet KitapPuan = Islemler.KitapPuan(Kullaniciadi);
                GridView2.DataSource = KitapPuan.Tables[0];
                GridView2.DataBind();

                /*Yorum/inceleme Tablosu*/

                DataSet KitapInceleme = Islemler.KitapInceleme(Kullaniciadi);
                GridView3.DataSource = KitapInceleme.Tables[0];
                GridView3.DataBind();

                /*Alıntı Tablosu*/
                DataSet Alintilar = Islemler.Alintilar(Kullaniciadi);
                GridView4.DataSource = Alintilar.Tables[0];
                GridView4.DataBind();

                /*Mesajlar Tablosu*/
                DataSet Mesajlar = Islemler.Mesaj(Kullaniciadi);
                GridView5.DataSource = Mesajlar.Tables[0];
                GridView5.DataBind();
            }
        }
コード例 #28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string user = (string)Session["userName"];
            string pass = (string)Session["passWord"];

            ////////////////Listagens Scores//////////////
            GridView5.DataSource = getDataSet();
            GridView5.DataBind();

            /*
             * GWSiteClassLibrary.IScore sc = GWSiteClassLibrary.Factory.CreateScoreService();
             * DataSet ds = null;
             * ds = sc.GetAll(user, pass);
             * GridView5.DataSource = ds;
             * GridView5.DataBind();
             * */
            /*GWSiteClassLibrary.IUser ustest = GWSiteClassLibrary.Factory.CreateUserService();
             * //DataSet ds = null;
             * DataSet ds = ustest.FindByName(user, pass, username);
             * GridView5.DataSource = ds;
             * GridView5.DataBind();*/


            ////////////////Listagens Mapas//////////////
            GWSiteClassLibrary.IMap m = GWSiteClassLibrary.Factory.CreateMapService();
            DataSet dsP1 = null;
            dsP1 = m.GetAll(user, pass);
            GridView3.DataSource = dsP1;
            // GridView1.DataTextField = "Name";
            // GridView1.DataValueField = "PlayerID";
            GridView3.DataBind();

            ////////////////Listagens Users//////////////
            GWSiteClassLibrary.IUser u = GWSiteClassLibrary.Factory.CreateUserService();
            DataSet dsP2 = null;
            dsP2 = u.GetAll(user, pass);
            GridView2.DataSource = dsP2;
            // GridView1.DataTextField = "Name";
            // GridView1.DataValueField = "PlayerID";
            GridView2.DataBind();

            ////////////////Listagens Players//////////////
            GWSiteClassLibrary.IPlayer p = GWSiteClassLibrary.Factory.CreatePlayerService();
            DataSet dsP3 = null;
            dsP3 = p.GetAll(user, pass);
            GridView4.DataSource = dsP3;
            GridView4.DataBind();
        }
    }
コード例 #29
0
 protected void Button14_Click(object sender, EventArgs e)
 {
     if (TextBox21.Text.Length > 0)
     {
         Pass_BarCode.DataBind();
         GridView5.DataBind();
     }
     else
     {
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                 "alertMessage",
                                                 "alert('Δεν έχει συμπληρωθεί ο αριθμός αίτησης !!!');", true);
     }
 }
コード例 #30
0
        protected void Button6_Click1(object sender, EventArgs e)
        {
            conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
            conn.Open();
            string         query = "Select DISTINCT Name, Category From Items t Inner Join Transcation r ON t.ItemId = r.ItemId Where quality > 3 ";
            SqlCommand     cmd   = new SqlCommand(query, conn);
            SqlDataAdapter da    = new SqlDataAdapter(cmd);
            DataSet        ds    = new DataSet();

            da.Fill(ds);
            GridView5.DataSource = ds;
            GridView5.DataBind();
            conn.Close();
        }