예제 #1
0
파일: zt.master.cs 프로젝트: Jamehe/-
    public void load()
    {
        string sql = "select top 9 * from news  ";

        dt = DbHelperSQL.Query(sql).Tables[0];
        if (Session["_username"] != null)
        {
            string aa = " 欢迎您光临校园淘网!!";
            welcome.Text = Session["_username"].ToString() + aa.ToString() + "   ";
        }
        string  str = "select top 7 * from news order by _id desc  ";
        DataSet ds  = DB.dataSet(str);


        int     id      = 2;
        BLLhelp bllhelp = new BLLhelp();
        DataSet ds1     = bllhelp.cj_ds(id);

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

        int     id1 = 26;
        DataSet ds2 = bllhelp._selectAll(id1);

        Re_xs.DataSource = ds2;
        Re_xs.DataBind();

        int     id2 = 19;
        DataSet ds3 = bllhelp._selectAll(id2);

        Re_ps.DataSource = ds3;
        Re_ps.DataBind();

        int     id3 = 20;
        DataSet ds4 = bllhelp._selectAll(id3);

        Re_fw.DataSource = ds4;
        Re_fw.DataBind();

        int     id4 = 25;
        DataSet ds5 = bllhelp._selectAll(id4);

        Re_huiy.DataSource = ds5;
        Re_huiy.DataBind();
    }
예제 #2
0
    void vizual()
    {
        DataTable region2 = klas.getdatatable(@"select  PaymentID,Sanction, TaxpayerID, p.TaxesPaymentID,case when p.TaxesPaymentID=1 then N'Əmlak vergisi' 
when p.TaxesPaymentID=2 then N'Torpaq vergisi' when p.TaxesPaymentID=15 then N'Maliyyə sanksiyası' end  TaxesPaymentTypeName, Operation,CAST(Amount as numeric(18,2)) Amount,CAST(RemainingDebt as numeric(18,2)) RemainingDebt,
CAST(MorePayment as numeric(18,2)) MorePayment , PercentDayCount,  CAST(PercentCounted as numeric(18,2)) PercentCounted ,
CAST(PercentDebt as numeric(18,2)) PercentDebt, PaymentDocument, p.NowTime,
case 
when  Operation=10 then N'Ödəmə' else N'Hesablanma' end Operation1,cast(RemainingDebt+Sanction+PercentDebt as numeric(18,2)) umumiborc  from Payments p
inner join TaxesPaymentList txl on txl.TaxesPaymentID=p.TaxesPaymentID where  TaxpayerID=" + TaxpayerID + " and p.TaxesPaymentID in (1,2,15) order by p.PaymentID");

        Repeater1.DataSource = region2;
        Repeater1.DataBind();
        if (region2 == null)
        {
            emlaktorp.Visible = false;
        }
        else
        {
            emlaktorp.Visible = true;
        }

        DataTable region3 = klas.getdatatable(@"select fullname,kkk.YVOK,Mobiltel,kkk.TaxpayerID,case when kkk.Operation=10 then N'Ödəmə' else 'Hesablama' end Operation,kkk.Amount,kkk.RemainingDebt,kkk.MorePayment,
kkk.PaymentDocument,kkk.NowTime,TaxesPaymentTypeName,kkk.TaxesPaymentID from (
select t.SName+' '+t.Name+' '+FName as fullname,t.YVOK,Mobiltel,p.TaxpayerID,p.Operation,p.Amount,p.RemainingDebt,p.MorePayment,p.PaymentDocument,p.NowTime,TaxesPaymentTypeName,p.TaxesPaymentID,PaymentID
from Payments p 
inner join Taxpayer t on t.TaxpayerID=p.TaxpayerID
inner join (select * from TaxesPaymentList union select 15,'Sanksiya','0','2020-10-15 00:00:00.000') tpl on tpl.TaxesPaymentID=p.TaxesPaymentID
where p.TaxesPaymentID not in (1,2)

union
select fullname,YVOK,Mobiltel,TaxpayerID,'' Operation,'' Amount,v.Payment RemainingDebt,'' MorePayment,'' PaymentDocument,GETDATE() NowTime,TaxesPaymentTypeName,TaxesPaymentID,0 PaymentID
from  viewdepts  v where TaxesPaymentID not in (1,2)
) kkk where TaxpayerID=" + TaxpayerID + " order by PaymentID");

        Repeater2.DataSource = region3;
        Repeater2.DataBind();
        if (region3 == null)
        {
            pnlodeniw.Visible = false;
        }
        else
        {
            pnlodeniw.Visible = true;
        }
    }
예제 #3
0
        protected void getModalInfos_Click(object sender, EventArgs e)
        {
            string rname = ((Button)sender).CommandArgument.ToString();

            DAL.DALBairro p = new DAL.DALBairro();
            Repeater2.DataSourceID = null;
            Repeater2.DataSource   = p.SelectBairros(rname);
            Repeater2.DataBind();

            DAL.DALPonto_referencia b = new DAL.DALPonto_referencia();
            Repeater3.DataSourceID = null;
            Repeater3.DataSource   = b.SelectPontos(rname);
            Repeater3.DataBind();



            modalContainer.Style.Add("visibility", "visible");
        }
예제 #4
0
    protected void AddDepartmentstoSidebar()
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connect"].ToString());

        con.Open();
        SqlCommand cmd = con.CreateCommand();

        cmd.CommandType = CommandType.Text;
        cmd.CommandText = "select ProjectId, ProjectName from Project";
        cmd.ExecuteNonQuery();
        DataTable      dt = new DataTable();
        SqlDataAdapter da = new SqlDataAdapter(cmd);

        da.Fill(dt);
        Repeater2.DataSource = dt;
        Repeater2.DataBind();
        con.Close();
    }
예제 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Repeater1.DataSource = SqlHelper.ExecuteAdapter("select top 5 * from Table_article where article_class = '公告' Order by article_time DESC").DefaultView;
     Repeater1.DataBind();
     Repeater2.DataSource = SqlHelper.ExecuteAdapter("select top 5 * from Table_article where article_class != '公告' Order by article_time DESC").DefaultView;
     Repeater2.DataBind();
     Repeater3.DataSource = SqlHelper.ExecuteAdapter("select top 3 * from Table_image where image_pass!='' Order by image_time DESC").DefaultView;
     Repeater3.DataBind();
     HyperLink1.NavigateUrl = SqlHelper.ExecuteScalar("Select a_address From Table_a where a_id ='1'").ToString();//为了不破坏美工的样式 我等只能用如此戳的方式来一个一个传值!!请谅解
     HyperLink2.NavigateUrl = SqlHelper.ExecuteScalar("Select a_address From Table_a where a_id ='2'").ToString();
     HyperLink3.NavigateUrl = SqlHelper.ExecuteScalar("Select a_address From Table_a where a_id ='4'").ToString();
     HyperLink4.NavigateUrl = SqlHelper.ExecuteScalar("Select a_address From Table_a where a_id ='5'").ToString();
     HyperLink5.NavigateUrl = SqlHelper.ExecuteScalar("Select a_address From Table_a where a_id ='6'").ToString();
     HyperLink6.NavigateUrl = SqlHelper.ExecuteScalar("Select a_address From Table_a where a_id ='7'").ToString();
     HyperLink7.NavigateUrl = SqlHelper.ExecuteScalar("Select a_address From Table_a where a_id ='9'").ToString();
     HyperLink8.NavigateUrl = SqlHelper.ExecuteScalar("Select a_address From Table_a where a_id ='10'").ToString();
     HyperLink9.NavigateUrl = SqlHelper.ExecuteScalar("Select a_address From Table_a where a_id ='11'").ToString();
 }
예제 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        db = new TezDBEntities();
        var hoca = db.Hoca.Where(w => w.Id == AppKontrol.id).FirstOrDefault();

        Label1.Text = "Tez Danışmanı";
        Label2.Text = hoca.Ad;
        Label3.Text = "Bilgisayar Mühendisliği";
        Label4.Text = hoca.Mail;
        var Duyurular = db.Duyuru_Admin.ToList();

        Repeater1.DataSource = Duyurular;
        Repeater1.DataBind();
        var Mesajlar = db.Mesaj.Where(w => w.Aid == AppKontrol.id && w.ADerece == AppKontrol.derece).ToList();

        Repeater2.DataSource = Mesajlar;
        Repeater2.DataBind();
    }
예제 #7
0
        private void getlilPhoto()
        {
            string ConnectionString = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
            //連接資料庫
            SqlConnection Conn = new SqlConnection(ConnectionString);

            Conn.Open();
            //Cmd執行SQL語法
            SqlCommand    Cmd    = new SqlCommand("SELECT *,(SELECT TOP 1 YachtsPhoto.FileName FROM YachtsPhoto WHERE Yachts.id = YachtsPhoto.YachtsID) FileName FROM Yachts WHERE (SELECT COUNT(YachtsPhoto.FileName) FROM YachtsPhoto WHERE  Yachts.id = YachtsPhoto.YachtsID) > 0", Conn);
            SqlDataReader Reader = Cmd.ExecuteReader();

            Repeater2.DataSource = Reader;
            Repeater2.DataBind();
            Reader.Close();
            Cmd.Cancel();
            Conn.Close();
            Conn.Dispose();
        }
    private void FillPageListView()
    {
        if (searchStr != "")
        {
            Repeater1.DataSource = res.SearchList(searchStr);
        }
        else
        {
            Repeater1.DataSource = res.PopularResList();
        }

        Repeater2.DataSource = res.AllergyResList(searchStr);
        Repeater3.DataSource = res.LocationResList(searchStr);

        Repeater1.DataBind();
        Repeater2.DataBind();
        Repeater3.DataBind();
    }
예제 #9
0
    public void projectShow()
    {
        SqlConnection con = new SqlConnection(abc);

        con.Open();

        SqlCommand cmd = new SqlCommand("Select * from oppertiunity;", con);

        DataSet ds = new DataSet();

        SqlDataAdapter da = new SqlDataAdapter(cmd);

        da.Fill(ds);

        Repeater2.DataSource = ds;

        Repeater2.DataBind();
    }
예제 #10
0
        private void showData()
        {
            string        strConn    = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
            SqlConnection connection = new SqlConnection(strConn);
            string        code       = $"WITH CTE AS (SELECT ROW_NUMBER() OVER (ORDER BY DealersDetails.id) RowNumber,* FROM DealersDetails) SELECT * FROM CTE where ROWNUMBER >=((@page - 1) * 5 + 1) and ROWNUMBER <=(@page * 5) and ContinentID =@id";
            SqlCommand    command    = new SqlCommand(code, connection);

            command.Parameters.AddWithValue("@id", Request.QueryString["id"] ?? "1");
            command.Parameters.Add("@page", SqlDbType.Int);
            command.Parameters["@page"].Value = Convert.ToInt32(Request.QueryString["page"] ?? "1");
            connection.Open();
            SqlDataReader dataReader = command.ExecuteReader();

            Repeater2.DataSource = dataReader;
            //把這個資料表跟資料(reader)作雙向繫結
            Repeater2.DataBind();
            connection.Close();
        }
예제 #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (ConfigurationSettings.AppSettings["conn_type"].ToString() == "1")
         {
             Repeater2.Visible    = false;
             Repeater1.DataSource = my_c.GetTable("SELECT name,id,crdate,refdate FROM sysobjects WHERE xtype = 'U' AND OBJECTPROPERTY (id, 'IsMSShipped') = 0").DefaultView;
             Repeater1.DataBind();
         }
         else
         {
             Repeater1.Visible    = false;
             Repeater2.DataSource = GetSchemaTable();
             Repeater2.DataBind();
         }
     }
 }
예제 #12
0
    protected void AddDepartmentstoSidebar()
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connect"].ToString());

        con.Open();
        SqlCommand cmd = con.CreateCommand();

        cmd.CommandType = CommandType.Text;
        cmd.CommandText = "select distinct Department.DepartmentID, Department.DepartmentName from Department, Projects, Works_On where Department.DepartmentID = Projects.DepartmentID and Projects.ProjectID = Works_On.ProjectID and Works_On.EmployeeID = " + Session["emp"];

        cmd.ExecuteNonQuery();
        DataTable      dt = new DataTable();
        SqlDataAdapter da = new SqlDataAdapter(cmd);

        da.Fill(dt);
        Repeater2.DataSource = dt;
        Repeater2.DataBind();
    }
        private void getBuildingDetails(int _landlordID)
        {
            int       landlordId    = Convert.ToInt32(Session["LandLordID"]);
            DataTable dtAnnouncment = new DataTable();

            dtAnnouncment = ClassLibrary_PropertyManager.Controller.cAnnouncment.GetAnnouncmentsByLandLordID(landlordId);


            if (dtAnnouncment.Rows.Count > 0)
            {
                Repeater2.DataSource = dtAnnouncment;
                Repeater2.DataBind();
            }
            else
            {
                spnCustomerRecords.Visible = true;
            }
        }
예제 #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            LoadData();
            Database db   = new Database();
            Lang     lang = new Lang();
            db.AddParameter("@lang", lang.getCurrentLang());
            DataTable dt = db.ExecuteDataTable("select top(3) * from SocialEvent where lang=@lang Order by id desc");
            Repeater2.DataSource = dt;
            Repeater2.DataBind();

            db.AddParameter("@lang", lang.getCurrentLang());
            dt = db.ExecuteDataTable("select top(3) * from news where lang=@lang Order by id desc");
            Repeater1.DataSource = dt;
            Repeater1.DataBind();
        }
    }
예제 #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(@"Data Source=MAIT-ATOS-250\SQLEXPRESS;Initial Catalog=karthik;Persist Security Info=True;User ID=SA;Password=Atos@1");

            Buisness_Logic_Layer.ManageCapacity mc = new Buisness_Logic_Layer.ManageCapacity();
            int i = mc.Progressb();

            if (!IsPostBack)
            {
                DataSet ds = mc.Getds();
                Repeater1.DataSource = ds;
                Repeater1.DataBind();
                DataSet dsdis = mc.Geetdsdischarge();
                Repeater2.DataSource = dsdis;
                Repeater2.DataBind();
                // HiddenField.value = mc.Progressb();
            }
        }
예제 #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id      = Convert.ToInt32(Request.QueryString["KATEGORIID"]);
            var bloglar = db.TBLBLOG.Where(x => x.BLOGKATEGORI == id).ToList();

            Repeater1.DataSource = bloglar;
            Repeater1.DataBind();

            var bloglar2 = db.TBLKATEGORI.ToList();

            Repeater2.DataSource = bloglar2;
            Repeater2.DataBind();

            var bloglar3 = db.TBLBLOG.ToList();

            Repeater3.DataSource = bloglar3;
            Repeater3.DataBind();
        }
예제 #17
0
        public void Page_Load(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(Request.QueryString["Id"]);
            var n  = db.Tables.Find(id);

            Session.Add("tn", n.Id);

            //Masa numarasının çekilmesi

            Label1.Text = Session["tn"].ToString();



            //Kategorilerin listelenmesi

            var categories = db.Category.ToList();

            Repeater1.DataSource = categories;
            Repeater1.DataBind();

            //Ürünlerin listelenmesi
            var product = db.Product.ToList();

            Repeater2.DataSource = product;
            Repeater2.DataBind();

            //Sepet Listeleme

            int k    = Convert.ToInt32(Session["tn"]);
            var cart = (from x in db.Cart
                        where x.TableId == k
                        select new
            {
                x.Id,
                x.ProductId,
                x.Product.ProductName,
                x.Product.Price,
                x.Count,
            }).ToList();


            Repeater3.DataSource = cart;
            Repeater3.DataBind();
        }
예제 #18
0
    protected void Page_Load(object sender, EventArgs e)

    {
        Repeater2.DataSource = dl.da.CategoryTables;
        Repeater2.DataBind();
        Repeater3.DataSource = dl.da.CategoryTables;
        Repeater3.DataBind();
        if (Session["uid"] != null)
        {
            Literal1.Text = Session["Un"].ToString();
        }
        else
        {
            Response.Redirect("~/Login.aspx");
        }

        var p = from a in dl.da.CategoryTables
                from b in dl.da.AddProductTables.Where(k => k.Pro_Category == a.Id.ToString())
                select new
        {
            a.CName,
            b.Pro_Name,
            b.Pro_Pic,
            b.Price,
            b.Id
        };

        Repeater1.DataSource = p;
        Repeater1.DataBind();

        var q = from a in dl.da.CategoryTables.Where(k => k.Id == Convert.ToInt32(Request.QueryString["Cid"]))
                from b in dl.da.AddProductTables.Where(k => k.Pro_Category == a.Id.ToString())
                select new
        {
            a.CName,
            b.Pro_Name,
            b.Pro_Pic,
            b.Price,
            b.Id
        };

        Repeater1.DataSource = q;
        Repeater1.DataBind();
    }
예제 #19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        WebUtility.AdminLoginAuth();
        if (!bll_admin.RuleAuth("全局_选项管理"))
        {
            WebUtility.ShowError(WebUtility.ERROR101);
        }

        //获取选项组
        List <SqlWhere> sqlWhereList = new List <SqlWhere>();

        sqlWhereList.Add(new SqlWhere(OptionsModel.FATHERID, SqlWhere.Oper.Equal, 0));
        sqlWhereList.Add(new SqlWhere(OptionsModel.ENABLED, SqlWhere.Oper.Equal, true));
        List <OptionsModel> optionsList = bll_options.GetList(sqlWhereList);

        Repeater2.DataSource = optionsList;
        Repeater2.DataBind();

        if (optionsList.Count == 0)
        {
            WebUtility.ShowError(WebUtility.ERROR102);
        }

        //获取当前选项组ID
        foreach (OptionsModel options in optionsList)
        {
            if (options.Pkid.ToString() == Request.QueryString["gid"])
            {
                groupId = Request.QueryString["gid"]; break;
            }
        }
        if (String.IsNullOrEmpty(groupId))
        {
            groupId = optionsList[0].Pkid.ToString();
        }

        //执行操作
        Action();

        if (!Page.IsPostBack)
        {
            BindInfo();
        }
    }
예제 #20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Email"] != null)
        {
            SqlConnection con = new SqlConnection(WebConfigurationManager.ConnectionStrings["connectionstring"].ConnectionString);
            con.Open();

            String email = Session["Email"].ToString();

            SqlCommand cmdd = new SqlCommand("select * from [user] where email='" + email + "'", con);
            Session["userid"] = cmdd.ExecuteScalar();     //storing userid in seesion from above query

            String userid = Session["userid"].ToString(); //coverting session to string

            SqlCommand cmd = con.CreateCommand();
            cmd.CommandType = CommandType.Text;

            cmd.CommandText = "select *,(price * qty) as itemtotal from cart join product on cart.product_id = product.product_id where cart.user_id='" + userid + "' ";
            cmd.ExecuteNonQuery();
            DataTable      dtt = new DataTable();
            SqlDataAdapter daa = new SqlDataAdapter(cmd);
            daa.Fill(dtt);
            Repeater2.DataSource = dtt;
            Repeater2.DataBind();
            //Session["total"] = cmd.ExecuteScalar();
            //Label3.Text = Session["total"].ToString();

            cmd.CommandText = "select count(*) from cart join product on cart.product_id = product.product_id where cart.user_id='" + userid + "' ";
            object count = cmd.ExecuteScalar();

            //count = count + 1;
            Label50.Text = count.ToString();

            cmd.CommandText = "select [user].address from cart join [user] on cart.user_id = [user].user_id where cart.user_id='" + userid + "' ";
            //string a = cmd.ExecuteScalar().ToString();
            //Address.Text = cmd.ExecuteScalar().ToString();
            //MessageBox.Show(a);
            Label1.Text = cmd.ExecuteScalar().ToString();
        }
        else
        {
            System.Windows.Forms.MessageBox.Show("you need to loign to add to your cart");
        }
    }//page load
예제 #21
0
    private void fillRecipes2()
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["conString"].ConnectionString);

        con.Open();
        SqlCommand command = new SqlCommand();

        command.Connection  = con;
        command.CommandText = "SELECT Recipes.* FROM Recipes INNER JOIN Likes ON Recipes.RecipeID=Likes.RecipeID WHERE Likes.UserID=@UserID";

        command.Parameters.AddWithValue("@Status", "True");
        command.Parameters.AddWithValue("@UserID", userId);
        DataTable      dt    = new DataTable();
        SqlDataAdapter adapt = new SqlDataAdapter();

        adapt.SelectCommand = command;
        adapt.Fill(dt);
        con.Close();
        PagedDataSource pds = new PagedDataSource();
        DataView        dv  = new DataView(dt);

        pds.DataSource       = dv;
        pds.AllowPaging      = true;
        pds.PageSize         = 12;
        pds.CurrentPageIndex = PageNumber;
        if (pds.PageCount > 1)
        {
            rptPaging2.Visible = true;
            ArrayList arraylist = new ArrayList();
            for (int i = 0; i < pds.PageCount; i++)
            {
                arraylist.Add((i + 1).ToString());
            }
            rptPaging2.DataSource = arraylist;
            rptPaging2.DataBind();
        }
        else
        {
            rptPaging2.Visible = false;
        }
        Repeater2.DataSource = pds;
        Repeater2.DataBind();
    }
예제 #22
0
        protected void info_show()
        {
            #region 条件
            BsonDocument where = new BsonDocument();
            where.Add("RequestIdentity", infoid);
            #endregion

            #region 排序
            string[] orderby = { "Time" };
            #endregion

            #region 字段
            BsonDocument fields = new BsonDocument();
            #endregion

            //查询数据库

            List <ClientExceptionInfo> list1 = MongoDBUtil.GetPaged <ClientExceptionInfo>(dbName, "ClientExceptionInfo", where, orderby, fields, 1, 20);
            Repeater1.DataSource = list1;
            Repeater1.DataBind();


            List <ClientInvokeInfo> list2 = MongoDBUtil.GetPaged <ClientInvokeInfo>(dbName, "ClientInvokeInfo", where, orderby, fields, 1, 20);
            Repeater2.DataSource = list2;
            Repeater2.DataBind();


            List <ClientMessageInfo> list3 = MongoDBUtil.GetPaged <ClientMessageInfo>(dbName, "ClientMessageInfo", where, orderby, fields, 1, 20);
            Repeater3.DataSource = list3;
            Repeater3.DataBind();

            List <ServerExceptionInfo> list4 = MongoDBUtil.GetPaged <ServerExceptionInfo>(dbName, "ServerExceptionInfo", where, orderby, fields, 1, 20);
            Repeater4.DataSource = list4;
            Repeater4.DataBind();

            List <ServerInvokeInfo> list5 = MongoDBUtil.GetPaged <ServerInvokeInfo>(dbName, "ServerInvokeInfo", where, orderby, fields, 1, 20);
            Repeater5.DataSource = list5;
            Repeater5.DataBind();

            List <ServerMessageInfo> list6 = MongoDBUtil.GetPaged <ServerMessageInfo>(dbName, "ServerMessageInfo", where, orderby, fields, 1, 20);
            Repeater6.DataSource = list6;
            Repeater6.DataBind();
        }
예제 #23
0
 protected void DropDownList1_Changed(object sender, EventArgs e)
 {
     if (DropDownList1.SelectedIndex != 0)
     {
         classid = Convert.ToInt32(DropDownList1.SelectedValue);
         DataTable dt = BLL.Homework.BLLGetSubHomeWorklist(classid);
         DropDownList2.DataSource     = dt;
         DropDownList2.DataTextField  = dt.Columns[1].ColumnName;
         DropDownList2.DataValueField = dt.Columns[2].ColumnName;
         DropDownList2.DataBind();
         DropDownList2.Items.Insert(0, "请选择");
     }
     Repeater1.DataSource = null;
     Repeater2.DataSource = null;
     Repeater3.DataSource = null;
     Repeater1.DataBind();
     Repeater2.DataBind();
     Repeater3.DataBind();
 }
예제 #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                data       = new DataTable();
                friendlist = new DataTable();
                friends    = new DataTable();

                data.Columns.Add("Img", typeof(string));
                data.Columns.Add("ID", typeof(int));

                for (int i = 0; i < 5; i++)
                {
                    data.Rows.Add("cat.jpg", i);
                }



                repeatData.DataSource = data;
                repeatData.DataBind();

                friendlist.Columns.Add("Img", typeof(string));
                friendlist.Columns.Add("ID", typeof(int));

                for (int i = 1; i < 11; i++)
                {
                    friendlist.Rows.Add("out.jpg", i);
                }
                Repeater1.DataSource = friendlist;
                Repeater1.DataBind();


                friends.Columns.Add("Img", typeof(string));
                friends.Columns.Add("ID", typeof(int));

                for (int i = 1; i < 11; i++)
                {
                    friends.Rows.Add("out.jpg", i);
                }
                Repeater2.DataSource = friendlist;
                Repeater2.DataBind();
            }
        }
예제 #25
0
 private void LoadLatest()
 {
     try
     {
         //var latestList = (from r in _db.Resources select r ).Reverse().Take(5); ;
         var latestList = _db.Resources.OrderByDescending(s => s.DateCreated).Take(7).ToList();
         if (!latestList.Any())
         {
             Repeater2.DataSource = new List <Resource>();
             Repeater2.DataBind();
             return;
         }
         Repeater2.DataSource = latestList;
         Repeater2.DataBind();
     }
     catch
     {
     }
 }
예제 #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            kullaniciID = Session["KullaniciID"].ToString();
            SqlCommand alimlar = new SqlCommand("SELECT*FROM KullaniciRapor r inner join UrunKategori u on r.UrunKategoriID=u.UrunKategoriID WHERE AliciID=@p1", bgl.baglanti());

            alimlar.Parameters.AddWithValue("@p1", kullaniciID);
            SqlDataReader dr = alimlar.ExecuteReader();

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

            SqlCommand satislar = new SqlCommand("SELECT*FROM KullaniciRapor r inner join UrunKategori u on r.UrunKategoriID=u.UrunKategoriID WHERE SaticiID=@p1", bgl.baglanti());

            satislar.Parameters.AddWithValue("@p1", kullaniciID);
            SqlDataReader dr1 = satislar.ExecuteReader();

            Repeater2.DataSource = dr1;
            Repeater2.DataBind();
        }
        protected void getAirline_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (getAirline.Text == "Select")
            {
                Repeater1.DataSource = (DataTable)Session["dtSearchFlightResults"];
                Repeater1.DataBind();
                if (Session["tripType"].ToString().Equals("Round Trip"))
                {
                    Repeater2.DataSource = (DataTable)Session["dtSearchFlightResultsRoundTrip"];
                    Repeater2.DataBind();
                }
            }
            else
            {
                SearchFlightByFilter searchFlightByFilter = new SearchFlightByFilter();

                DataTable dtSearchFlightResults = new DataTable();
                dtSearchFlightResults = searchFlightByFilter.FilterByAirline(Session["source"].ToString(),
                                                                             Session["destination"].ToString(),
                                                                             Session["travelClass"].ToString(),
                                                                             Session["dateOfJourney"].ToString(),
                                                                             Convert.ToInt32(Session["numberOfAdults"]),
                                                                             Convert.ToInt32(Session["numberOfChildren"]),
                                                                             getAirline.Text);

                Session["dtSearchFlightResults1"] = dtSearchFlightResults;
                Repeater1.DataSource = dtSearchFlightResults;
                Repeater1.DataBind();

                if (Session["tripType"].ToString().Equals("Round Trip"))
                {
                    DataTable dtSearchFlightResultsRoundTrip = new DataTable();
                    dtSearchFlightResultsRoundTrip = searchFlightByFilter.FilterByAirline(Session["destination"].ToString(), Session["source"].ToString(),
                                                                                          Session["travelClass"].ToString(), Session["dateOfReturn"].ToString(),
                                                                                          Convert.ToInt32(Session["numberOfAdults"]), Convert.ToInt32(Session["numberOfChildren"]), getAirline.Text);


                    Session["dtSearchFlightResultsRoundTrip1"] = dtSearchFlightResultsRoundTrip;
                    Repeater2.DataSource = dtSearchFlightResultsRoundTrip;
                    Repeater2.DataBind();
                }
            }
        }
예제 #28
0
    /// <summary>
    /// 绑定信息
    /// </summary>
    private void BindInfo()
    {
        ScenicPanel.Visible    = Request.QueryString["gid"].Equals("11");
        SelfdrivePanel.Visible = Request.QueryString["gid"].Equals("13");

        bll_options.BindDropDownList(1, Topic, project.Topic.ToString(), "--请选择--");
        bll_options.BindDropDownList(2, Level, project.ILevel.ToString(), "--请选择--");

        if (project.Pkid > 0)
        {
            myhead           = "编辑";
            MyTitle.Value    = project.Title;
            CategoryId.Value = project.CategoryId.ToString();
            AreaId.Value     = project.AreaId.ToString();
            Keywords.Value   = project.Keywords;
            Descn.Value      = project.Descn;
            Pic.Value        = project.Pic;
            Pictures.Value   = project.Pictures;
            TopPic.Value     = project.TopPic;
            EventDate.Value  = project.EventDate;
            EventTheme.Value = project.EventTheme;
            Ticket.Value     = project.Ticket;
            MySingle.Value   = project.Single;
            People.Value     = project.People;
            Together.Value   = project.Together;
            Tel.Value        = project.Tel;
            Address.Value    = project.Address;
            Pubdate.Value    = DateHelper.ToShortDate(project.Pubdate);
            IsTop.Checked    = project.IsTop;
            IsHot.Checked    = project.IsHot;
            Sort.Value       = project.ISort.ToString();
        }
        else
        {
            myhead = "新增";
        }

        //内容
        Repeater1.DataSource = optionsList;
        Repeater1.DataBind();
        Repeater2.DataSource = optionsList;
        Repeater2.DataBind();
    }
예제 #29
0
파일: Beds.aspx.cs 프로젝트: asmitde/nmhc
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (!User.IsInRole("Administrator") && !User.IsInRole("Hospital Superuser") && !User.IsInRole("Hospital Management"))
            {
                Response.Redirect("~/Account/Login.aspx");
            }
            else
            {
                using (NMHCDatabaseEntities myEntities = new NMHCDatabaseEntities())
                {
                    hid = (from r in myEntities.Hospital__Staff
                           where r.Staff_ID == Profile.UserName
                           select r.H_ID).SingleOrDefault();

                    if (hid == null)
                    {
                        hid = Profile.UserName;
                    }
                }
            }

            using (NMHCDatabaseEntities myEntities = new NMHCDatabaseEntities())
            {
                var types = (from r in myEntities.Hospital__Bed
                             where r.H_ID == hid
                             select r.Type).Distinct();

                var beds = from r in types
                           select new
                {
                    type = r,
                    bno  = from s in myEntities.Hospital__Bed
                           where (s.H_ID == hid && s.Type == r)
                           select new { s.BedNo }
                };

                Repeater2.DataSource = beds;
                Repeater2.DataBind();
            }
        }
    }
예제 #30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            return;
        }
        int album_id  = int.Parse(Request.QueryString["album_id"]);
        int member_id = _vMember.ID;
        var bl        = new DS_AlbumImg_Br();

        Repeater1.DataSource = bl.Query("albumid=@0", "px", album_id);
        Repeater1.DataBind();
        var albbl = new DS_Album_Br();
        var album = albbl.GetSingle(album_id);

        ViewState["albumName"] = album.AlbumName.Length > 6?album.AlbumName.Substring(0, 6) + "..":album.AlbumName;
        Repeater2.DataSource   = albbl.Query("memberid=@0 and PictureNum>0 and Permissions!=@1", "updatedate desc", member_id, (byte)DS_Album_Br.Permissions.公开);
        Repeater2.DataBind();
    }