示例#1
0
    private void Databind()
    {
        con.Open();
        SqlCommand com2 = con.CreateCommand();

        com2.CommandText = "Select Item_Id,Image,MRP,SalePrice,Item_Name from dbo.Item Where Sales = @y and Active = @y and In_Stock-Out_Stock > 0";
        com2.Parameters.AddWithValue("y", "yes");
        dadapter2 = new SqlDataAdapter(com2);
        dset2     = new DataSet();
        adsource2 = new PagedDataSource();
        dadapter2.Fill(dset2);
        con.Close();
        if (dset2.Tables[0].Rows.Count != 0)
        {
            adsource2.DataSource       = dset2.Tables[0].DefaultView;
            adsource2.PageSize         = 2;
            adsource2.AllowPaging      = true;
            adsource2.CurrentPageIndex = pos2;
            btnPrevious2.Visible       = !adsource2.IsFirstPage;
            btnNext2.Visible           = !adsource2.IsLastPage;
            DataList4.DataSource       = adsource2;
            DataList4.DataBind();
        }
        else
        {
            sal.Visible = false;
            //btnPrevious2.Visible = false;
            //btnNext2.Visible = false;
            //DataList4.Visible = false;
        }
    }
        private void LoadStatementdocMail()
        {
            DataTable dt = dManager.GetDoctorbasicInfo(docMail);

            DataList4.DataSource = dt;
            DataList4.DataBind();
        }
示例#3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DataList4.DataSource = data.GetDataReader("select * from Musictype");
            DataList4.DataBind();

            DataList6.DataSource = data.GetDataReader("select * from Singer");
            DataList6.DataBind();

            DataList5.DataSource = data.GetDataReader("select * from Album");
            DataList5.DataBind();

            Datalist3.DataSource = data.GetDataReader("select top 8 * from News");
            Datalist3.DataBind();



            DataList1.DataSource = data.GetDataReader("select top 6 * from Music  where  IsCheck='1' order  by  id desc  ");
            DataList1.DataBind();


            DataList2.DataSource = data.GetDataReader("select top 6 * from Music  where  IsCheck='1' order  by  clk desc  ");
            DataList2.DataBind();
            if (Session["users"] != null)
            {
                table2.Visible = true;
                TABLE1.Visible = false;
                MName.Text     = Session["users"].ToString();
            }
        }
    }
示例#4
0
        public void timer_tick(object sender, EventArgs e)
        {
            DataSet   ds2 = new DataSet();
            DataTable T2  = new DataTable();

            T2.Columns.Add("left");
            T2.Columns.Add("right");
            List <List <String> > messagelist = new List <List <string> >();

            Console.WriteLine("seller id " + Request.QueryString["param"]);
            Console.WriteLine("self id " + Session["uid"]);
            messagelist = db.GetMessages(Int32.Parse(Request.QueryString["param"]), Convert.ToInt32(Session["uid"]));
            for (int i = 0; i < messagelist.Count; i++)
            {
                String[] temp = new string[2];

                if (messagelist[i][0].Equals("0"))
                {
                    temp[0] = null;
                    temp[1] = messagelist[i][1];
                }
                else
                {
                    temp[1] = null;
                    temp[0] = messagelist[i][1];
                }

                T2.Rows.Add(temp);
            }

            ds2.Tables.Add(T2);
            DataList4.DataSource = ds2;
            DataList4.DataBind();
        }
示例#5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["users"] != null)
            {
                Label1.Text = Session["users"].ToString();
                SqlDataReader dr = data.GetDataReader("select * from Member where MemberName='" + Session["users"].ToString() + "'");
                if (dr.Read())
                {
                    Label2.Text = dr["MemberMoney"].ToString();
                }
                DataList4.DataSource = data.GetDataReader("select * from v_SCbum where UserName='******'");
                DataList4.DataBind();



                DataList2.DataSource = data.GetDataReader("select * from CSMusic where UserName='******'");
                DataList2.DataBind();
            }
            else
            {
                Alert.AlertAndRedirect("对不起您还没有登录", "Login.aspx");
            }
        }
    }
示例#6
0
        void OnButtonFind4Click(Object sender, EventArgs e)
        {
            //получить для каждого склада количество хранящегося товара(общее и отдельно по товарам)
            SQLDataService ds     = (SQLDataService)DataServiceProvider.DataService;
            var            whList = ds.Query <Склад>(Склад.Views.СкладL).ToList();
            var            result = new List <StringAndDecimal>();

            foreach (var wh in whList)
            {
                var goodInWhList = ds.Query <ТоварНаСкладе>(ТоварНаСкладе.Views.ТоварНаСкладеE).Where(k => k.Склад.__PrimaryKey == wh.__PrimaryKey).ToList();
                var sum          = goodInWhList.Sum(k => k.Количество);

                result.Add(new StringAndDecimal {
                    str = wh.Название + " Общее количество", dec = sum
                });
                foreach (var good in goodInWhList)
                {
                    result.Add(new StringAndDecimal {
                        str = good.Товар.Название, dec = good.Количество
                    });
                }
                DataList4.DataSource = result;
                DataList4.DataBind();
            }
        }
示例#7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     cn.Open();
     cmd = new SqlCommand("Select * from house", cn);
     dr  = cmd.ExecuteReader();
     DataList1.DataSource = dr;
     DataList1.DataBind();
     cn.Close();
     cn.Open();
     cmd = new SqlCommand("Select * from room", cn);
     dr  = cmd.ExecuteReader();
     DataList2.DataSource = dr;
     DataList2.DataBind();
     cn.Close();
     cn.Open();
     cmd = new SqlCommand("Select * from hall", cn);
     dr  = cmd.ExecuteReader();
     DataList3.DataSource = dr;
     DataList3.DataBind();
     cn.Close();
     cn.Open();
     cmd = new SqlCommand("Select * from ground", cn);
     dr  = cmd.ExecuteReader();
     DataList4.DataSource = dr;
     DataList4.DataBind();
     cn.Close();
 }
示例#8
0
        protected void DataList4_EditCommand(Object sender, DataListCommandEventArgs e)
        {
            DataList4.EditItemIndex = e.Item.ItemIndex;

            DataList4.DataSource = GridDataTable().Tables[2];
            DataList4.DataBind();
        }
示例#9
0
        protected void viewAcct()
        {
            DataSet ds = GridDataTable();

            // Persist the table in the Session object,
            // this is important for correct sorting
            Session["AccountsTable"] = ds.Tables[0];

            GridView1.DataSource = ds.Tables[0];
            GridView1.DataBind();

            if (!txtSearch.Text.Equals(""))
            {
                GridView2.DataSource = ds.Tables[1];
                GridView2.DataBind();

                DataList2.DataSource = ds.Tables[1];
                DataList2.DataBind();

                DataList4.DataSource = ds.Tables[2];
                DataList4.DataBind();

                txtNumInitialRow.Text  = ds.Tables[1].Rows[0]["numRow"].ToString();
                txtHiddenVcAcctNo.Text = ds.Tables[1].Rows[0]["vcAcctNo"].ToString();
                txtHiddenVcClient.Text = ds.Tables[1].Rows[0]["vcClient"].ToString();
            }
        }
示例#10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //显示用户信息
        localhost.Service myBBS = new localhost.Service();

        DataSet userInforDS = myBBS.GetUserInfo(Session["username"].ToString());

        DataList1.DataSource = userInforDS.Tables["UserInfor"].DefaultView;
        DataList1.DataBind();

        //显示所有用户发表的帖子
        DataSet titleListDS1 = myBBS.GetUserTitle(Session["username"].ToString(), "站务通知");

        DataList2.DataSource = titleListDS1.Tables["TitleList"].DefaultView;
        DataList2.DataBind();
        DataSet titleListDS2 = myBBS.GetUserTitle(Session["username"].ToString(), "文化艺术");

        DataList4.DataSource = titleListDS2.Tables["TitleList"].DefaultView;
        DataList4.DataBind();
        DataSet titleListDS3 = myBBS.GetUserTitle(Session["username"].ToString(), "休闲娱乐");

        DataList5.DataSource = titleListDS3.Tables["TitleList"].DefaultView;
        DataList5.DataBind();
        DataSet titleListDS4 = myBBS.GetUserTitle(Session["username"].ToString(), "学习天地");

        DataList6.DataSource = titleListDS4.Tables["TitleList"].DefaultView;
        DataList6.DataBind();
        DataSet titleListDS5 = myBBS.GetUserTitle(Session["username"].ToString(), "信息技术");

        DataList7.DataSource = titleListDS5.Tables["TitleList"].DefaultView;
        DataList7.DataBind();
    }
示例#11
0
    private void GetData(string emp)
    {
        DataTable dt_wk   = new DataTable();
        DataTable dt_my_1 = new DataTable();
        DataTable dt_my_2 = new DataTable();
        DataTable dt_my_3 = new DataTable();

        string sql = @"exec [usp_app_emp_login_list] '{0}','{1}'";

        sql     = string.Format(sql, _workshop, emp);
        dt_wk   = SQLHelper.Query(sql).Tables[0];
        dt_my_1 = SQLHelper.Query(sql).Tables[1];
        dt_my_2 = SQLHelper.Query(sql).Tables[2];
        dt_my_3 = SQLHelper.Query(sql).Tables[3];

        DataList1_M.DataSource = dt_wk;
        DataList1_M.DataBind();
        //Label1.Text = Label1.Text + "(" + dt_wk.Rows.Count + ")";

        DataList2.DataSource = dt_my_1;
        DataList2.DataBind();
        Label2.Text = Label2.Text + "(" + dt_my_1.Rows.Count + ")";

        DataList3.DataSource = dt_my_2;
        DataList3.DataBind();
        Label3.Text = Label3.Text + "(" + dt_my_2.Rows.Count + ")";

        DataList4.DataSource = dt_my_3;
        DataList4.DataBind();
        Label4.Text = Label4.Text + "(" + dt_my_3.Rows.Count + ")";
    }
示例#12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SqlDataAdapter adp = new SqlDataAdapter("select Top 10 * from Food_Regi", con);
            DataSet        ds  = new DataSet();
            adp.Fill(ds);
            DataList1.DataSource = ds;
            DataList1.DataBind();

            DataList2.DataSource = ds;
            DataList2.DataBind();

            selectstate();



            SqlDataAdapter adp1 = new SqlDataAdapter("select * from Notifications", con);
            DataTable      ds3  = new DataTable();
            adp1.Fill(ds3);

            DataList4.DataSource = ds3;
            DataList4.DataBind();
        }
    }
示例#13
0
        public void Top5News()
        {
            DataTable dt = new DataTable();

            dt = bus.ShowTopNews();
            DataList4.DataSource = dt;
            DataList4.DataBind();
        }
示例#14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DataList4.DataSource = data.GetDataReader("select * from Musictype");
         DataList4.DataBind();
     }
 }
示例#15
0
    public void bind_demo_paper()
    {
        DataSet ds = new DataSet();

        ds = db.ExecuteDataSet("select * from tbl_army_rally_info");

        DataList4.DataSource = ds.Tables[0];
        DataList4.DataBind();
    }
示例#16
0
    private void BindAllChWomanSi()//绑定华语女歌手
    {
        DataTable dt = SingerManager.selectAllCwomansi();

        if (dt != null && dt.Rows.Count != 0)
        {
            DataList4.DataSource = dt;
            DataList4.DataBind();
        }
    }
示例#17
0
    private void DefineDataBinding_P(string q_dfn_ids)
    {
        Biz_QuestionDefines questionDefines = new Biz_QuestionDefines();
        DataSet             defineDs        = questionDefines.GetQuestionDefines();

        DataList4.DataSource = DataTypeUtility.FilterSortDataSet(defineDs
                                                                 , string.Format("Q_DFN_ID IN ({0})", q_dfn_ids)
                                                                 , null);
        DataList4.DataBind();
    }
示例#18
0
 public void getdata()
 {
     DataList1.DataBind();
     DataList2.DataBind();
     DataList3.DataBind();
     DataList4.DataBind();
     DataList5.DataBind();
     DataList6.DataBind();
     DataList7.DataBind();
 }
    public void Load()
    {
        DataList3.DataSource = op.SelectImage("手机", 5);
        DataList3.DataBind();
        DataList4.DataSource = op.SelectImage("电器城", 5);
        DataList4.DataBind();
        DataList5.DataSource = op.SelectImage("西西超市", 5);
        DataList5.DataBind();
        DataList6.DataSource = op.SelectImage("西西生活", 5);
        DataList6.DataBind();
        DataList7.DataSource = op.SelectImage("有我你更美", 5);
        DataList7.DataBind();
        DataList8.DataSource = op.SelectImage("智能硬件", 5);
        DataList8.DataBind();

        midImage.DataSource = op.SelectImage("pimage", 5);
        midImage.DataBind();

        DataList9.DataSource = op.SelectImage("手机", 10);
        DataList9.DataBind();
        DataList10.DataSource = op.SelectImage("电器城", 10);
        DataList10.DataBind();
        DataList11.DataSource = op.SelectImage("西西超市", 10);
        DataList11.DataBind();
        DataList12.DataSource = op.SelectImage("西西生活", 10);
        DataList12.DataBind();
        DataList13.DataSource = op.SelectImage("智能硬件", 10);
        DataList13.DataBind();
        DataList14.DataSource = op.SelectImage("有我你更美", 10);
        DataList14.DataBind();
        DataList15.DataSource = op.SelectImage("办公设备", 10);
        DataList15.DataBind();
        DataList16.DataSource = op.SelectImage("西西商城", 10);
        DataList16.DataBind();

        DataList17.DataSource = op.SelectNewInfo(10);
        DataList17.DataBind();


        Phone.DataSource = op.SelectPhone(10);
        Phone.DataBind();

        Life.DataSource = op.SelectImage("西西生活", 10);
        Life.DataBind();

        Electric.DataSource = op.SelectImage("电器城", 10);
        Electric.DataBind();

        Beauty.DataSource = op.SelectImage("有我你更美", 10);
        Beauty.DataBind();
    }
示例#20
0
        protected void DataList4_DeleteCommand(Object sender, DataListCommandEventArgs e)
        {
            DataList4.DataKeys[e.Item.ItemIndex].ToString();
            string numRowFu = DataList4.DataKeys[e.Item.ItemIndex].ToString();
            string Query    = "Delete FollowUp WHERE numRowFu=" + numRowFu;

            DataSet ds = GridDataTable(Query);

            GridView1.DataSource = ds.Tables[0];
            GridView1.DataBind();

            DataList4.DataSource = ds.Tables[2];
            DataList4.DataBind();
        }
示例#21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string komut = "Select * From Tbl_Duyurular";
                dt = bgl.baglanti(komut);
                DataList3.DataSource = dt;
                DataList3.DataBind();

                string komut2 = "Select * From Tbl_Duyurular2";
                dt = bgl.baglanti(komut2);
                DataList4.DataSource = dt;
                DataList4.DataBind();
            }
        }
        private void getArticle()
        {
            try
            {
                string        con  = ConfigurationSettings.AppSettings["np"];
                SqlConnection conn = new SqlConnection(con);
                conn.Open();

                SqlDataAdapter myCommand1 = new SqlDataAdapter("select top 5 * from Article where checkup=1 and classname='新闻' order by dateandtime desc", conn);   
                DataSet        ds1        = new DataSet();
                myCommand1.Fill(ds1, "Article");
                //for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
                //{
                //    ds1.Tables[0].Rows[i][4] = ((DateTime)ds1.Tables[0].Rows[0][4]).ToString("MM-dd");
                //}
                DataList1.DataSource = ds1;



                DataList1.DataBind();


                SqlDataAdapter myCommand2 = new SqlDataAdapter("select top 5 * from Article where checkup=1 and classname='体育' order by dateandtime desc", conn);   
                DataSet        ds2        = new DataSet();
                myCommand2.Fill(ds2, "Article");
                DataList2.DataSource = ds2;
                DataList2.DataBind();

                SqlDataAdapter myCommand3 = new SqlDataAdapter("select top 5 * from Article where checkup=1 and classname='科技' order by dateandtime desc", conn);   
                DataSet        ds3        = new DataSet();
                myCommand3.Fill(ds3, "Article");
                DataList3.DataSource = ds3;
                DataList3.DataBind();

                SqlDataAdapter myCommand4 = new SqlDataAdapter("select top 5 * from Article where checkup=1 order by click desc", conn);   
                DataSet        ds4        = new DataSet();
                myCommand4.Fill(ds4, "Article");
                DataList4.DataSource = ds4;
                DataList4.DataBind();


                conn.Close();
            }
            catch (SqlException ex)
            {
                Response.Write(ex.Message);
            }
        }
示例#23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Panel4.Visible = false;
            Panel2.Visible = false;
            SqlCommand    cmd = new SqlCommand("select *from tbl_tarifler where TarifDurum=0", bgl.baglanti());
            SqlDataReader dr  = cmd.ExecuteReader();

            DataList3.DataSource = dr;
            DataList3.DataBind();

            SqlCommand    cmd2 = new SqlCommand("Select *from tbl_tarifler where TarifDurum=1", bgl.baglanti());
            SqlDataReader dr2  = cmd2.ExecuteReader();

            DataList4.DataSource = dr2;
            DataList4.DataBind();
        }
示例#24
0
    protected void Timer1_Tick1(object sender, EventArgs e)
    {
        DataList1.DataBind();
        DataList3.DataBind();
        DataList4.DataBind();
        LoadChatList();

        if (UserTitle.InnerText != LabelRecevier.Text)
        {
            UserTitle.Style.Add("color", "white");
        }
        else
        {
            UserTitle.Style.Add("color", "black");
        }
    }
示例#25
0
 protected void Page_Load(object sender, EventArgs e)
 {
     GetGoodsInfo();
     DataList3.DataSource = op.SelectImage("手机", 5);
     DataList3.DataBind();
     DataList4.DataSource = op.SelectImage("电器城", 5);
     DataList4.DataBind();
     DataList5.DataSource = op.SelectImage("西西超市", 5);
     DataList5.DataBind();
     DataList6.DataSource = op.SelectImage("西西生活", 5);
     DataList6.DataBind();
     DataList7.DataSource = op.SelectImage("有我你更美", 5);
     DataList7.DataBind();
     DataList8.DataSource = op.SelectImage("智能硬件", 5);
     DataList8.DataBind();
 }
示例#26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Button1.Visible      = false;
     con                  = new Connection();
     tintin               = null;
     DataList1.DataSource = con.Teamo();
     DataList1.DataBind();
     tintin = Request.QueryString["teemo"];
     if (tintin != null)
     {
         DataList2.DataSource = con.Showteams(tintin);
         DataList2.DataBind();
         DataList4.DataSource = con.Showcomments("Teams", tintin);
         DataList4.DataBind();
         Button1.Visible = true;
     }
 }
示例#27
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Panel2.Visible = true;
         Panel3.Visible = false;
         if (Session["username"] != null)
         {
             string str = Session["username"].ToString();
             Panel2.Visible = false;
             Panel3.Visible = true;
             username.Text  = str;
         }
         DataList4.DataSource = data.GetDataReader("select * from leibie ");
         DataList4.DataBind();
     }
 }
示例#28
0
        public void loaddata()
        {
            try
            {
                string maloai = Request.QueryString["MaLoaiSP"].ToString();
                string sql    = "SELECT LOAISANPHAM.TenLoaiSP, SANPHAM.TenSP, SANPHAM.HinhAnh, SANPHAM.TienSP, SANPHAM.MaSP, LOAISANPHAM.MaLoaiSP FROM LOAISANPHAM INNER JOIN SANPHAM ON LOAISANPHAM.MaLoaiSP = SANPHAM.MaLoaiSP where sanpham.maloaisp=" + maloai + " order by Sanpham.MaSP asc";

                DataList3.DataSource = XLDL.GetData(sql);
                DataList3.DataBind();
                string sql1 = "select TenLoaiSP from loaisanpham where MaLoaiSP=" + maloai;
                DataList4.DataSource = XLDL.GetData(sql1);
                DataList4.DataBind();
            }
            catch

            {
            }
        }
示例#29
0
        protected void btnClear_Click(object sender, EventArgs e)
        {
            txtSearch.Text    = "";
            txtCustomSQL.Text = "";

            Session["AccountsTable"] = GridDataTable().Tables[0];
            GridView1.DataSource     = Session["AccountsTable"];
            GridView1.DataBind();

            GridView2.DataSource = null;
            GridView2.DataBind();

            DataList2.DataSource = null;
            DataList2.DataBind();

            DataList4.DataSource = null;
            DataList4.DataBind();
        }
示例#30
0
        protected void btnAppendFollowUp_Click(object sender, EventArgs e)
        {
            if (!txtNumInitialRow.Text.Equals(""))
            {
                string[] formats = { "M/d/yyyy", "M/dd/yyyy", "MM/d/yyyy", "MM/dd/yyyy" };

                DateTime dateValue;
                if (DateTime.TryParseExact(txtDatFollowUp.Text, formats, new CultureInfo("en-US"), DateTimeStyles.None, out dateValue) ||
                    txtDatFollowUp.Text.Equals(""))
                {
                    String InsertQuery = string.Format(
                        "Insert into FollowUp(numInitialRow,vcFuCommentBy,vcFuComment,vcContactName,vcContactPhone,vcContactEmail,vcCallRefNo,datFollowUp,vcAcctNo,vcClient) values ("
                        + "{0},{1},{2},{3},{4},{5},{6},{7},{8},{9})",
                        txtNumInitialRow.Text.Equals("") ? "NULL" : txtNumInitialRow.Text,
                        txtVcFuCommentBy.Text.Equals("") ? "NULL" : "'" + txtVcFuCommentBy.Text + "'",
                        txtVcFuComment.Text.Equals("") ? "NULL" : "'" + txtVcFuComment.Text + "'",
                        txtVcContactName.Text.Equals("") ? "NULL" : "'" + txtVcContactName.Text + "'",
                        txtVcContactPhone.Text.Equals("") ? "NULL" : "'" + txtVcContactPhone.Text + "'",
                        txtVcContactEmail.Text.Equals("") ? "NULL" : "'" + txtVcContactEmail.Text + "'",
                        txtVcCallRefNo.Text.Equals("") ? "NULL" : "'" + txtVcCallRefNo.Text + "'",
                        txtDatFollowUp.Text.Equals("") ? "NULL" : "'" + dateValue.ToString().Split()[0] + "'",
                        txtHiddenVcAcctNo.Text.Equals("") ? "NULL" : "'" + txtHiddenVcAcctNo.Text + "'",
                        txtHiddenVcClient.Text.Equals("") ? "NULL" : "'" + txtHiddenVcClient.Text + "'"
                        );


                    DataSet ds = GridDataTable(InsertQuery);

                    GridView1.DataSource = ds.Tables[0];
                    GridView1.DataBind();

                    DataList4.DataSource = ds.Tables[2];
                    DataList4.DataBind();

                    txtVcCallRefNo.Text    = "";
                    txtVcContactName.Text  = "";
                    txtVcContactPhone.Text = "";
                    txtVcContactEmail.Text = "";
                    txtVcFuCommentBy.Text  = "";
                    txtDatFollowUp.Text    = "";
                    txtVcFuComment.Text    = "";
                }
            }
        }