DataBind() public method

public DataBind ( ) : void
return void
Beispiel #1
0
        public void Loadlist(Repeater rpt)
        {
            try
            {
                int sotin = (_typecat == 0 ? lnews.Getsotin(_Catid) : 100);
                var list = lnews.Load_listnews(_Catid);
                if (list.Count > 0)
                {
                    if (_page != 0)
                    {
                        rpt.DataSource = list.Skip(sotin * _page - sotin).Take(sotin);
                        rpt.DataBind();
                    }
                    else
                    {
                        rpt.DataSource = list.Take(sotin);
                        rpt.DataBind();
                    }
                    ltrPage.Text = change.result(list.Count, sotin, _cat_seo_url, 0, _page, 1);
                }
                else { }

            }
            catch (Exception)
            {

                throw;
            }
        }
Beispiel #2
0
 private void BindingMaster()
 {
     if (Session["CheckedListMP"] != null)
     {
         Hashtable _HS = (Hashtable)Session["CheckedListMP"];
         _HS = RemoveHash(_HS);
         RepeaterMaster.DataSource = _HS;
         RepeaterMaster.DataBind();
     }
 }
Beispiel #3
0
        private void BindLinkEq()
        {
            int     bl     = int.Parse(Request.QueryString["bl"]);
            int     corpo  = 1;
            int     stanza = int.Parse(Request.QueryString["stanza"]);
            int     eq     = int.Parse(Request.QueryString["eq"]);
            DataSet ds     = _Servizi.GetEQ(bl, corpo, stanza, eq);;

            RepeaterLink.DataSource = ds.Tables[0];
            RepeaterLink.DataBind();
        }
Beispiel #4
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            Utility  = new CCUtility(this);
            CvsFiles = new ViewCvs.ViewCvs();
            Utility.CheckSecurity(1);



            if (!IsPostBack)
            {
                int iIssueID = Convert.ToInt32(Utility.GetParam("Issue_ID"));
                Label1.Text = "Files for Issue: " + iIssueID.ToString();
                try
                {
                    CvsFiles.OpenDB();
                    ds = CvsFiles.GetIssueFiles(iIssueID);

                    //test
                    //                DataGrid1.DataSource = ds;
                    //                DataGrid1.AllowSorting = true;
                    //
                    //                DataGrid1.DataBind();


                    dvFiles.Table = ds.Tables[0];

                    if (dvFiles.Count > 0)
                    {
                        Repeater.DataSource = dvFiles;

                        Repeater.Visible = true;
                        Repeater.DataBind();
                    }
                    else
                    {
                        Label1.Text += " No Files!";
                    }


                    //                DataGrid1.DataBind();
                    //     ds.Clear();
                }
                catch (Exception ex)
                {
                    Label1.Text = ex.Message;
                }
                finally
                {
                    CvsFiles.CloseDB();
                }
            }
        }
        private void Page_Load(object sender, System.EventArgs e)
        {
            //Put user code to initialize the page here

            System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1");
            GHTTestBegin(frm);

            GHTActiveSubTest = GHTSubTest1;
            try
            {
                Repeater1.DataSource = GHTTests.GHDataSources.DSArray();
                Repeater1.DataBind();
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTSubTestBegin("Code base constructor 1");
            try
            {
                System.Web.UI.WebControls.Repeater Repeater2 = new System.Web.UI.WebControls.Repeater();
                GHTActiveSubTest.Controls.Add(Repeater2);
                Repeater2.DataSource   = GHTTests.GHDataSources.DSArrayList();
                Repeater2.ItemTemplate = new t_DBLitTemplate();
                Repeater2.DataBind();
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }
            GHTSubTestEnd();

            GHTTestEnd();
        }
Beispiel #6
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string sql =
                    "SELECT FirstName, LastName, TitleOfCourtesy FROM Employees";

                // Create the Command and the Connection.
                string connectionString = "Data Source=localhost;" +
                                          "Initial Catalog=Northwind;Integrated Security=SSPI";
                SqlConnection con = new SqlConnection(connectionString);
                SqlCommand    cmd = new SqlCommand(sql, con);

                // Open the connection and get the DataReader.
                con.Open();
                SqlDataReader reader = cmd.ExecuteReader();

                // Bind the Reader to the Repeater.
                Repeater1.DataSource = reader;
                Repeater1.DataBind();

                // Close the DataReader and the Connection.
                reader.Close();
                con.Close();
            }
        }
Beispiel #7
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            string[] fileTypes = new string[] { "*.jpg", "*.jpeg", "*.gif" };
            System.Collections.ArrayList imageFiles = new ArrayList();
            foreach (string ext in fileTypes)
            {
                imageFiles.AddRange(System.IO.Directory.GetFiles(Server.MapPath(fileDirectory), ext));
            }
            DataTable dt = new DataTable("files");

            dt.Columns.Add("filename", typeof(string));
            dt.Columns.Add("size", typeof(int));
            dt.Columns.Add("height", typeof(int));
            dt.Columns.Add("width", typeof(int));
            dt.Columns.Add("dateModified", typeof(System.DateTime));

            for (int i = 0; i < imageFiles.Count; i++)
            {
                System.IO.FileInfo    fi = new System.IO.FileInfo((string)imageFiles[i]);
                System.Drawing.Bitmap b  = new Bitmap((string)imageFiles[i]);
                dt.Rows.Add(new object[] { fi.Name, (int)fi.Length, b.Height, b.Width, fi.LastWriteTime });
                b.Dispose();
            }
            dt.DefaultView.Sort      = "filename";
            imageRepeater.DataSource = dt.DefaultView;
            imageRepeater.DataBind();
        }
Beispiel #8
0
    protected void ViewComments(object sender, EventArgs e)
    {
        LinkButton btn    = sender as LinkButton;
        int        id     = GetIdOfAnswer(btn);
        QuizItem   answer = QuizItem.Find(id);

        Panel tmp = SelectorHelpers.FindFirstByCssClass <Panel>(btn.Parent, "viewComments");

        if (!tmp.Visible || tmp.Style["display"] == "none")
        {
            btn.Text    = "Hide " + btn.Text;
            tmp.Visible = true;
            tmp.ReRender();

            System.Web.UI.WebControls.Repeater rep = Selector.SelectFirst <System.Web.UI.WebControls.Repeater>(tmp);
            rep.DataSource = answer.Children;
            rep.DataBind();

            TextArea txt = Selector.SelectFirst <TextArea>(tmp);
            txt.Text = "write your comment here...";

            new EffectRollDown(tmp, 500)
            .Render();
        }
        else
        {
            btn.Text = btn.Text.Replace("Hide ", "");
            new EffectRollUp(tmp, 500)
            .Render();
        }
    }
Beispiel #9
0
 /// <summary>
 /// BindMenu
 /// </summary>
 /// <param name="web"></param>
 /// <param name="listName"></param>
 /// <param name="rptMenu"></param>
 /// <param name="menuPosition"></param>
 /// <param name="menuParent"></param>
 public static void BindMenu(SPWeb web, string listName, Repeater rptMenu, string menuPosition, string menuParent)
 {
     SPSecurity.RunWithElevatedPrivileges(() =>
     {
         using (var adminSite = new SPSite(web.Site.ID))
         {
             using (var adminWeb = adminSite.OpenWeb(web.ID))
             {
                 try
                 {
                     adminWeb.AllowUnsafeUpdates = true;
                     string caml = @"<Where><And><Eq><FieldRef Name='{0}' /><Value Type='Text'>{1}</Value></Eq><Eq><FieldRef Name='{2}' /><Value Type='MultiChoice'>{3}</Value></Eq></And></Where><OrderBy><FieldRef Name='{4}' /></OrderBy>";
                     var query = new SPQuery()
                     {
                         Query = string.Format(CultureInfo.InvariantCulture, caml, FieldsName.MenuList.InternalName.ParentID, menuParent, FieldsName.MenuList.InternalName.MenuPosition, menuPosition, FieldsName.MenuList.InternalName.MenuOrder)
                     };
                     var list = Utilities.GetCustomListByUrl(adminWeb, listName);
                     var items = list.GetItems(query);
                     if (items != null && items.Count > 0)
                     {
                         rptMenu.DataSource = items.GetDataTable();
                         rptMenu.DataBind();
                     }
                 }
                 catch (SPException ex)
                 {
                     Utilities.LogToULS(ex);
                 }
             }
         }
     });
 }
Beispiel #10
0
 private void lkbInfo_Click(object sender, System.EventArgs e)
 {
     Classi.ManProgrammata.Planner _Planner = new TheSite.Classi.ManProgrammata.Planner();
     this.pnlShowInfo.Visible = true;
     rptFrequenze.DataSource  = _Planner.GetFrequenze();
     rptFrequenze.DataBind();
 }
Beispiel #11
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            //Put user code to initialize the page here

            System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1");
            GHTTestBegin(frm);

            GHTActiveSubTest = GHTSubTest1;
            try
            {
                Repeater1.DataSource = GHTTests.GHDataSources.DSArrayList();
                Repeater1.DataBind();

                IEnumerator items = Repeater1.Items.GetEnumerator();
                System.Web.UI.WebControls.RepeaterItem item;

                while (items.MoveNext())
                {
                    item = (RepeaterItem)items.Current;
                    GHTSubTestAddResult(item.ItemIndex.ToString());
                }
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTTestEnd();
        }
Beispiel #12
0
 protected void rptList_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem)
     {
         System.Web.UI.WebControls.Repeater repeater = (System.Web.UI.WebControls.Repeater)e.Item.FindControl("rptSubList");
         OrderInfo orderInfo = OrderHelper.GetOrderInfo(System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderID").ToString());
         if (orderInfo != null && orderInfo.LineItems.Count > 0)
         {
             repeater.DataSource = orderInfo.LineItems.Values;
             repeater.DataBind();
         }
         OrderStatus orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderStatus");
         if (!(System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway") is System.DBNull))
         {
             string arg_CE_0 = (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway");
         }
         int num = (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "GroupBuyId") != System.DBNull.Value) ? ((int)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "GroupBuyId")) : 0;
         System.Web.UI.WebControls.HyperLink hyperLink = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("lkbtnEditPrice");
         if (orderStatus == OrderStatus.WaitBuyerPay)
         {
             hyperLink.Visible = true;
         }
         if (num > 0)
         {
             GroupBuyStatus arg_14A_0 = (GroupBuyStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "GroupBuyStatus");
         }
     }
 }
        /// <summary>
        /// Get the current DB data and fill
        /// the fields with them
        /// </summary>
        public void BindFields()
        {
            FilterData filterData = new Filters().GetFilterById(FilterId);

            FilterNameTextBox.Text = filterData.Filters[0].Description;
            LogicalOperatorDropDownList.SelectedValue = filterData.Filters[0].LogicalOperatorTypeID.ToString();

            RulesRepeater.DataSource = new Filters().GetRulesForFilter(FilterId);
            RulesRepeater.DataMember = "FilterRules";
            RulesRepeater.DataBind();

            QuestionFilterDropdownlist.DataSource     = new Questions().GetAnswerableQuestionList(SurveyId);
            QuestionFilterDropdownlist.DataTextField  = "QuestionText";
            QuestionFilterDropdownlist.DataValueField = "QuestionID";
            QuestionFilterDropdownlist.DataBind();
            QuestionFilterDropdownlist.Items.Insert(0, new ListItem(((PageBase)Page).GetPageResource("SelectQuestionMessage"), "-1"));
            BindFieldsAutoGenerate();

            BindFieldsParentFilter(ParentFilterNameDropDownList);
            SelectParentFilter(ParentFilterNameDropDownList, filterData.Filters[0].ParentFilterId);
            //ParentFilterNameDropDownList.SelectedValue = filterData.Filters[0].ParentFilterId.ToString();

            AddRuleButton.Enabled            = false;
            AnswerLabel.Visible              = false;
            AnswerFilterDropdownlist.Visible = false;
            TextFilterTextbox.Visible        = false;
            FilterText.Visible = false;
        }
Beispiel #14
0
        private void LoadServizi(string cadenza, string frequenza)
        {
            TheSite.Classi.ClassiDettaglio.Servizi s = new TheSite.Classi.ClassiDettaglio.Servizi();
            DataSet ds = s.GetServizi();

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

            cmbsTipoCadenza.Attributes.Add("onclick", "SetVisible();");
            Page.RegisterStartupScript("visib", "<script language='javascript'>SetVisible();</script>");

            Classi.ClassiAnagrafiche.PmpFrequenza _PmpFrequenza = new Classi.ClassiAnagrafiche.PmpFrequenza();
            ds = _PmpFrequenza.GetDataStag(frequenza);
            //rpserv.Visible =true;
            foreach (RepeaterItem item in rpserv.Items)
            {
                HtmlInputHidden ids = (HtmlInputHidden)item.FindControl("idser");

                foreach (DataRow riga in ds.Tables[0].Rows)
                {
                    if (riga["servizi_id"].ToString() == ids.Value)
                    {
                        DropDownList cmb = (DropDownList)item.FindControl("drmese");
                        cmb.SelectedValue = riga["idmese"].ToString();
                        break;
                    }
                }
            }
        }
Beispiel #15
0
 protected void rptypelist_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem)
     {
         System.Web.UI.WebControls.Repeater repeater = e.Item.FindControl("ListShipper") as System.Web.UI.WebControls.Repeater;
         FreightTemplate freightTemplate             = (FreightTemplate)e.Item.DataItem;
         int             templateId = System.Convert.ToInt32(freightTemplate.TemplateId);
         System.Collections.Generic.IList <SpecifyRegionGroup> specifyRegionGroups = SettingsHelper.GetSpecifyRegionGroups(templateId);
         if (specifyRegionGroups.Count < 1)
         {
             specifyRegionGroups.Add(new SpecifyRegionGroup
             {
                 RegionIds   = "",
                 ModeId      = 1,
                 FristNumber = 1m,
                 FristPrice  = 0m,
                 AddNumber   = 1m,
                 AddPrice    = 0m,
                 IsDefault   = true
             });
         }
         repeater.DataSource = specifyRegionGroups;
         repeater.DataBind();
     }
 }
Beispiel #16
0
        protected void listOrders_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem)
            {
                OrderStatus     orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderStatus");
                System.DateTime t           = (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "FinishDate") == System.DBNull.Value) ? System.DateTime.Now.AddYears(-1) : ((System.DateTime)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "FinishDate"));
                string          a           = "";
                if (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway") != null && !(System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway") is System.DBNull))
                {
                    a = (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway");
                }
                System.Web.UI.WebControls.HyperLink hyperLink = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("hplinkorderreview");

                System.Web.UI.HtmlControls.HtmlAnchor linkNowPay = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("hlinkPay");

                ImageLinkButton confirmOrder = (ImageLinkButton)e.Item.FindControl("lkbtnConfirmOrder");
                ImageLinkButton cancelOrder  = (ImageLinkButton)e.Item.FindControl("lkbtnCloseOrder");
                System.Web.UI.HtmlControls.HtmlAnchor lkbtnApplyForRefund  = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForRefund");
                System.Web.UI.HtmlControls.HtmlAnchor lkbtnApplyForReturn  = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForReturn");
                System.Web.UI.HtmlControls.HtmlAnchor lkbtnNotPay          = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnNotPay");
                System.Web.UI.HtmlControls.HtmlAnchor lkbtnApplyForReplace = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForReplace");

                System.Web.UI.WebControls.Repeater repeater = (System.Web.UI.WebControls.Repeater)e.Item.FindControl("rpProduct");
                //查看物流
                System.Web.UI.WebControls.Label label = (System.Web.UI.WebControls.Label)e.Item.FindControl("Logistics");
                if (hyperLink != null)
                {
                    hyperLink.Visible = (orderStatus == OrderStatus.Finished);
                }

                SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);

                //未付款
                lkbtnNotPay.Visible = (orderStatus == OrderStatus.WaitBuyerPay);
                //退货
                lkbtnApplyForReturn.Visible = (orderStatus == OrderStatus.Finished && t >= System.DateTime.Now.AddDays((double)(-(double)masterSettings.EndOrderDays)));

                //退款
                lkbtnApplyForRefund.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid || orderStatus == OrderStatus.SellerAlreadySent);
                //换货
                lkbtnApplyForReplace.Visible = (orderStatus == OrderStatus.Finished && t >= System.DateTime.Now.AddDays((double)(-(double)masterSettings.EndOrderDays)));

                /*1.等待买家付款(WaitBuyerPay) ->        未付款/取消
                 * 2.已付款,等待发货(BuyerAlreadyPaid) -> 退款
                 * 3.已发货(SellerAlreadySent)          ->退款,确认收货,查看物流
                 * 4.订单已完成(Finished)  -> 退货/换货 查看物流
                 */

                if (repeater != null)
                {
                    string orderId = ((DataRowView)e.Item.DataItem).Row["OrderId"].ToString();
                    if (!string.IsNullOrEmpty(orderId))
                    {
                        DataTable dt = TradeHelper.GetOrderItemThumbnailsUrl(orderId);
                        repeater.DataSource = dt;
                        repeater.DataBind();
                    }
                }
            }
        }
 void BuildChartColumnResults(int questionId)
 {
     if (questionId == 0)
     {
         ChartRepeater.Visible    = true;
         SingleChartImage.Visible = false;
         ChartRepeater.DataSource = new Questions().GetQuestionListWithSelectableAnswers(SurveyId);
         ChartRepeater.DataBind();
     }
     else
     {
         ChartRepeater.Visible     = false;
         SingleChartImage.Visible  = true;
         SingleChartImage.ImageUrl = Server.HtmlDecode("BarChartReport.aspx?questionid=" + questionId + "&filterid=" + GetFilterId().ToString() + "&SortOrder=" + ResultsOrderDropDownList.SelectedValue + "&LanguageCode=" + LanguagesDropdownlist.SelectedValue);
     }
 }
Beispiel #18
0
        private void ToExcel(System.Web.UI.WebControls.Repeater ctl, IList <EyouSoft.Model.StatisticStructure.EarningsTypeStatistic> PerAreaList)
        {
            ctl.Visible    = true;
            ctl.DataSource = PerAreaList;
            ctl.DataBind();

            HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=ProAreaStaticFile.xls");

            HttpContext.Current.Response.Charset = "UTF-8";

            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.Default;

            HttpContext.Current.Response.ContentType = "application/ms-excel";

            ctl.Page.EnableViewState = false;

            StringWriter sw = new StringWriter();

            System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(sw);
            ctl.RenderControl(hw);
            ctl.Visible = false;

            HttpContext.Current.Response.Write(sw.ToString());
            HttpContext.Current.Response.End();
        }
Beispiel #19
0
 protected void rptypelist_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     if (string.IsNullOrEmpty(this.StoreName) && (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem))
     {
         System.Web.UI.WebControls.Repeater repeater    = e.Item.FindControl("reCommissionsChild") as System.Web.UI.WebControls.Repeater;
         System.Data.DataRowView            dataRowView = (System.Data.DataRowView)e.Item.DataItem;
         int    num  = System.Convert.ToInt32(dataRowView.Row["ReferralUserId"]);
         string text = dataRowView.Row["OrderId"].ToString();
         if (num > 0 && text != "")
         {
             CommissionsQuery commissionsQuery = new CommissionsQuery();
             commissionsQuery.ReferralUserId = num;
             commissionsQuery.StoreName      = "";
             commissionsQuery.OrderNum       = text;
             commissionsQuery.EndTime        = "";
             commissionsQuery.StartTime      = "";
             commissionsQuery.PageIndex      = 1;
             commissionsQuery.PageSize       = 1000;
             commissionsQuery.SortOrder      = SortAction.Desc;
             commissionsQuery.SortBy         = "CommId";
             Globals.EntityCoding(commissionsQuery, true);
             DbQueryResult commissionsWithStoreName = VShopHelper.GetCommissionsWithStoreName(commissionsQuery, "3");
             repeater.DataSource = commissionsWithStoreName.Data;
             repeater.DataBind();
         }
     }
 }
 private void btnSearch_Click(object sender, System.EventArgs e)
 {
     try
     {
         pnlVerifyOperator.Visible = false;
         pnlSelectOperator.Visible = true;
         user                    = new clsUsers();
         user.iOrgId             = OrgId;
         user.sFirstName         = tbFirstName.Text;
         user.sLastName          = tbLastName.Text;
         user.sEmail             = "";
         user.iGroupId           = 0;
         user.iActiveStatus      = 0;
         user.iTypeId            = (int)UserTypes.All;
         repOperators.DataSource = new DataView(user.GetUserList_Filter());
         repOperators.DataBind();
     }
     catch (Exception ex)
     {
         _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
         Session["lastpage"]     = "wo_selectOperator.aspx?equipid=" + EquipId.ToString() + "&orderid=" + OrderId.ToString();
         Session["error"]        = ex.Message;
         Session["error_report"] = ex.ToString();
         Response.Redirect("error.aspx", false);
     }
     finally
     {
         if (user != null)
         {
             user.Dispose();
         }
     }
 }
        private void Page_Load(object sender, System.EventArgs e)
        {
            //Put user code to initialize the page here

            System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1");
            GHTTestBegin(frm);

            GHTActiveSubTest = GHTSubTest1;
            try
            {
                Repeater1.DataSource = GHTTests.GHDataSources.DSArrayList();
                Repeater1.DataBind();
                GHTSubTestAddResult(Repeater1.Items.GetType().ToString());
                foreach (RepeaterItem item in Repeater1.Items)
                {
                    GHTSubTestAddResult(item.ItemIndex + "," + item.ItemType.ToString() + "," + ((DataBoundLiteralControl)item.Controls[0]).Text);
                }
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTTestEnd();
        }
        public override void DataBind()
        {
            IPaginatedList productList = this.WebLocalSingleton.CurrentList;

            NPetshop.Domain.Catalog.Category category = ((NPetshop.Domain.Catalog.Product)productList[0]).Category;

            RepeaterProduct.DataSource = productList;
            RepeaterProduct.DataBind();

            if (productList.IsNextPageAvailable)
            {
                LinkbuttonNext.Visible         = true;
                LinkbuttonNext.CommandArgument = category.Id;
            }
            else
            {
                LinkbuttonNext.Visible = false;
            }
            if (productList.IsPreviousPageAvailable)
            {
                LinkbuttonPrev.Visible         = true;
                LinkbuttonPrev.CommandArgument = category.Id;
            }
            else
            {
                LinkbuttonPrev.Visible = false;
            }

            Label1.Text = category.Name;
        }
Beispiel #23
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            Save.Click += new EventHandler(OnSave);

            ISourceControl[] sourceControls = SourceControlManager.AvailableSourceControl();

            if (!IsPostBack)
            {
                SelectedSourceControl = -1;

                sc.AutoPostBack   = true;
                sc.DataSource     = sourceControls;
                sc.DataTextField  = "Name";
                sc.DataValueField = "Key";
                sc.DataBind();

                bs.DataSource     = BuildSystemManager.AvailableBuildSystems();
                bs.DataTextField  = "Name";
                bs.DataValueField = "Key";
                bs.DataBind();
            }

            if (sc.SelectedIndex != SelectedSourceControl)
            {
                // If the user changed the combo, we rebind the
                // properties for the selected source control

                ISourceControl control = sourceControls[sc.SelectedIndex];

                SelectedSourceControl = sc.SelectedIndex;

                dynRep.DataSource = control.ParametersDefinition;
                dynRep.DataBind();
            }
        }
Beispiel #24
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                OrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false);

                if (!IsPostBack)
                {
                    OperatorInfo op = new OperatorInfo(Request.Cookies["bfp_operator"].Value);
                    lblFirstName.Text        = op.FirstName;
                    equip                    = new clsEquipment();
                    equip.iOrgId             = OrgId;
                    equip.iUserId            = op.Id;
                    repEquipments.DataSource = new DataView(equip.GetEquipListByOperator2());
                    repEquipments.DataBind();
                }
            }
            catch (Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"]     = "ok_mainMenu.aspx";
                Session["error"]        = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if (equip != null)
                {
                    equip.Dispose();
                }
            }
        }
Beispiel #25
0
        public static void RepeaterBind <T>(System.Web.UI.WebControls.Repeater repeater, IList <T> dataSource, int paginaAtual, int qtdRegistrosPagina, int totalRegistros, int[] opcoesRegistroPagina, PopularDropDownListOrdernacao popularDropDownListOrdernacao, RepeaterItemEventHandler onItemDataBound)
        {
            int nroPaginas = (int)Math.Ceiling((decimal)totalRegistros / qtdRegistrosPagina);

            if (nroPaginas <= paginaAtual)
            {
                paginaAtual = nroPaginas - 1;
            }
            if (paginaAtual < 0)
            {
                paginaAtual = 0;
            }

            if (opcoesRegistroPagina == null)
            {
                opcoesRegistroPagina = new int[] { 20, 40, 60, 80, 100, 160, 200 }
            }
            ;

            DadosDatabound = new CarregaDadosDatabound()
            {
                PaginaAtual = paginaAtual, TotalPaginas = nroPaginas, QtdRegistrosPagina = qtdRegistrosPagina, TotalRegistros = totalRegistros, OpcoesRegistroPagina = opcoesRegistroPagina, PopularDropDownListOrdernacao = popularDropDownListOrdernacao, OnItemDataBound = onItemDataBound
            };

            repeater.ItemDataBound += new RepeaterItemEventHandler(repeater_ItemDataBound);
            repeater.DataSource     = dataSource;
            repeater.DataBind();

            DadosDatabound = null;
        }
Beispiel #26
0
        private void drawMenu()
        {
            //string activeCss,linkActiveCss = String.Empty;
            string xmlFile = "admin.config";

            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            System.Xml.XmlDocument    xd = new System.Xml.XmlDocument();
            System.Data.DataTable     dt = new DataTable();
            dt.Columns.Add("label", typeof(string));
            dt.Columns.Add("href", typeof(string));
            dt.Columns.Add("icon", typeof(string));
            dt.Columns.Add("width", typeof(double));

            xd.Load(Server.MapPath(xmlFile));

            int count = xd["menu"].ChildNodes.Count;

            foreach (XmlNode x in xd["menu"])
            {
                if (x.Attributes["protected"].Value == "true" && SFGlobal.CurrentUser.IsUserAdmin())
                {
                    dt.Rows.Add(new object[] { x.Attributes["label"].Value, x.Attributes["href"].Value, x.Attributes["icon"].Value, Math.Ceiling((double)100 / (double)count) });
                }
                if (x.Attributes["protected"].Value == "false")
                {
                    dt.Rows.Add(new object[] { x.Attributes["label"].Value, x.Attributes["href"].Value, x.Attributes["icon"].Value, Math.Ceiling((double)100 / (double)count) });
                }
            }

            menuRepeater.DataSource = dt;
            menuRepeater.DataBind();
        }
Beispiel #27
0
 protected void rptProduct_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item)
     {
         DataRowView arg_37_0 = (DataRowView)e.Item.DataItem;
         System.Web.UI.WebControls.Label label         = (System.Web.UI.WebControls.Label)e.Item.Controls[0].FindControl("lbBundlingID");
         FormatedMoneyLabel formatedMoneyLabel         = (FormatedMoneyLabel)e.Item.Controls[0].FindControl("lbltotalPrice");
         FormatedMoneyLabel formatedMoneyLabel2        = (FormatedMoneyLabel)e.Item.Controls[0].FindControl("lblbundlingPrice");
         FormatedMoneyLabel formatedMoneyLabel3        = (FormatedMoneyLabel)e.Item.Controls[0].FindControl("lblsaving");
         System.Web.UI.WebControls.HyperLink hyperLink = (System.Web.UI.WebControls.HyperLink)e.Item.Controls[0].FindControl("hlBuy");
         System.Web.UI.WebControls.Repeater  repeater  = (System.Web.UI.WebControls.Repeater)e.Item.Controls[0].FindControl("rpbundlingitem");
         System.Collections.Generic.List <BundlingItemInfo> bundlingItemsByID = ProductBrowser.GetBundlingItemsByID(System.Convert.ToInt32(label.Text));
         decimal num = 0m;
         foreach (BundlingItemInfo current in bundlingItemsByID)
         {
             num += current.ProductNum * current.ProductPrice;
         }
         formatedMoneyLabel.Money  = num;
         formatedMoneyLabel3.Money = System.Convert.ToDecimal(formatedMoneyLabel.Money) - System.Convert.ToDecimal(formatedMoneyLabel2.Money);
         if (!Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsDistributorSettings && !Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsOpenSiteSale)
         {
             hyperLink.Visible = false;
         }
         repeater.DataSource = bundlingItemsByID;
         repeater.DataBind();
     }
 }
        public override void DataBind()
        {
            NPetshop.Domain.Catalog.Product product = this.WebLocalSingleton.CurrentAction.Data[DataViews.PRODUCT] as NPetshop.Domain.Catalog.Product;
            IPaginatedList paginatedList            = this.WebLocalSingleton.CurrentList as IPaginatedList;

            LabelProduct.Text       = product.Name;
            RepeaterItem.DataSource = paginatedList;
            RepeaterItem.DataBind();

            if (paginatedList.IsNextPageAvailable)
            {
                LinkbuttonNext.Visible         = true;
                LinkbuttonNext.CommandArgument = product.Id;
            }
            else
            {
                LinkbuttonNext.Visible = false;
            }
            if (paginatedList.IsPreviousPageAvailable)
            {
                LinkbuttonPrev.Visible         = true;
                LinkbuttonPrev.CommandArgument = product.Id;
            }
            else
            {
                LinkbuttonPrev.Visible = false;
            }
        }
Beispiel #29
0
        /// <summary>
        /// Recupera le informazioni relative al documento
        /// </summary>
        private void Execute()
        {
            S_Controls.Collections.S_ControlsCollection CollezioneControlli = new  S_Controls.Collections.S_ControlsCollection();

            S_Controls.Collections.S_Object s_p_filname = new S_Controls.Collections.S_Object();
            s_p_filname.ParameterName = "p_filname";
            s_p_filname.DbType        = CustomDBType.VarChar;
            s_p_filname.Direction     = ParameterDirection.Input;
            s_p_filname.Index         = 0;
            s_p_filname.Value         = this.filname;
            s_p_filname.Size          = 50;
            CollezioneControlli.Add(s_p_filname);

            Classi.AnagrafeImpianti.DocDWF _DocDWF = new Classi.AnagrafeImpianti.DocDWF();

            DataSet Ds = _DocDWF.GetData(CollezioneControlli);

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

            if (Ds.Tables[0].Rows.Count > 0)
            {
                GetFile(Ds.Tables[0].Rows[0]["var_percorso_root"].ToString(), Ds.Tables[0].Rows[0]["var_percorso_child"].ToString());
            }
        }
Beispiel #30
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                OrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false);

                if (Request.QueryString["id"] == null)
                {
                    Session["lastpage"] = "admin_inspections.aspx";
                    Session["error"]    = _functions.ErrorMessage(104);
                    Response.Redirect("error.aspx", false);
                    return;
                }
                try
                {
                    InspectId = Convert.ToInt32(Request.QueryString["id"]);
                }
                catch (FormatException fex)
                {
                    Session["lastpage"] = "admin_inspections.aspx";
                    Session["error"]    = _functions.ErrorMessage(105);
                    Response.Redirect("error.aspx", false);
                    return;
                }
                Header.AddBreadCrumb("Home", "/selectMode.aspx");
                Header.AddBreadCrumb("Administration", "/admin.aspx");
                Header.AddBreadCrumb("Inspections Manager", "/admin_inspections.aspx");
                Header.LeftBarHtml = "View Inspection Items";
                this.PageTitle     = "Inspection Items Manager";

                lblBack.Text = "<input type=button value=\" Back \" onclick=\"document.location='admin_inspections.aspx'\">";
                if (!IsPostBack)
                {
                    inspect                   = new clsInspections();
                    inspect.iOrgId            = OrgId;
                    inspect.iId               = InspectId;
                    repInspections.DataSource = new DataView(inspect.GetInspectionItemsList());
                    repInspections.DataBind();
                    lblInspectionName.Text          = inspect.sInspectionName.Value;
                    hlAddCategory.NavigateUrl       = "admin_inspection_category_edit.aspx?id=" + InspectId.ToString() + "&catid=0";
                    hlAddInspectionItem.NavigateUrl = "admin_inspection_item_edit.aspx?id=" + InspectId.ToString() + "&itemid=0";
                }
            }
            catch (Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"]     = this.ParentPageURL;
                Session["error"]        = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if (inspect != null)
                {
                    inspect.Dispose();
                }
            }
        }
Beispiel #31
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                if (Request.QueryString["id"] == null)
                {
                    Session["lastpage"] = "ok_selectWorkOrder.aspx";
                    Session["error"]    = _functions.ErrorMessage(104);
                    Response.Redirect("error.aspx", false);
                    return;
                }
                try
                {
                    OrderId = Convert.ToInt32(Request.QueryString["id"]);
                }
                catch (FormatException fex)
                {
                    Session["lastpage"] = "ok_selectWorkOrder.aspx";
                    Session["error"]    = _functions.ErrorMessage(105);
                    Response.Redirect("error.aspx", false);
                    return;
                }

                OrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false);

                NextBackControl.BackText  = "<< Back";
                NextBackControl.BackPage  = "ok_viewServices.aspx?id=" + OrderId.ToString();
                NextBackControl.NextText  = "Continue >>";
                NextBackControl.sCSSClass = "ok_input_button";

                if (!IsPostBack)
                {
                    order        = new clsWorkOrders();
                    order.iOrgId = OrgId;
                    order.iId    = OrderId;
                    dtIssues     = order.GetReportedIssueLists().Tables[1];
                    if (dtIssues.Rows.Count > 0)
                    {
                        repIssues.DataSource = new DataView(dtIssues);
                        repIssues.DataBind();
                    }
                    else
                    {
                        Response.Redirect("ok_updateSpare.aspx?id=" + OrderId.ToString(), false);
                    }
                }
            }
            catch (Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"]     = "ok_viewServices.aspx?id=" + OrderId.ToString();
                Session["error"]        = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
            }
        }
Beispiel #32
0
 /// <summary>
 /// Display template with moduleid set
 /// </summary>
 /// <param name="rp1"></param>
 /// <param name="moduleId"></param>
 public void DoDetail(Repeater rp1,int moduleId)
 {
     var obj = new NBrightInfo(true);
     obj.ModuleId = moduleId;
     var l = new List<object> { obj };
     rp1.DataSource = l;
     rp1.DataBind();
 }
        public void BindDataToControls(Repeater tasksList, Repeater performersList)
        {
            tasksList.DataSource = _tasksService.GetRecentTasks(5);
            performersList.DataSource = _employeService.GetTopPerformers(5);

            tasksList.DataBind();
            performersList.DataBind();
        }
        private void btnYES_Click(object sender, System.EventArgs e)
        {
            DataTable dtSpareEquip = null;

            try
            {
                equip        = new clsEquipment();
                equip.iOrgId = OrgId;
                equip.iId    = EquipId;
                dtSpareEquip = equip.GetSpareEquipList();

                if (dtSpareEquip.Rows.Count > 0)
                {                 // view spare equipments
                    pnlSelectSpare.Visible  = true;
                    pnlNoSpare.Visible      = false;
                    pnlViewQuestion.Visible = false;

                    repSpareEquip.DataSource = new DataView(dtSpareEquip);
                    repSpareEquip.DataBind();
                }
                else
                {
                    // no spare
                    pnlNoSpare.Visible      = true;
                    pnlSelectSpare.Visible  = false;
                    pnlViewQuestion.Visible = false;
                    btnBack.Visible         = false;

                    NextBackControl.sCSSClass = "ok_input_button";
                    if (Operation == "CheckIn")
                    {
                        NextBackControl.BackText = "<< Back";
                        NextBackControl.BackPage = BackPage;
                        NextBackControl.NextText = "Continue >>";
                    }
                    else
                    {
                        NextBackControl.NextText    = "Back to Main Menu";
                        NextBackControl.BackVisible = false;
                    }
                }
            }
            catch (Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"]     = CurrentPage;
                Session["error"]        = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if (equip != null)
                {
                    equip.Dispose();
                }
            }
        }
Beispiel #35
0
        protected override void AttachChildControls()
        {
            rp_productsales = (Repeater)this.FindControl("rp_productsales");

            DataTable lineItems = ProductBrowser.GetLineItems(Convert.ToInt32(this.Page.Request.QueryString["productId"]), this.maxNum);

            rp_productsales.DataSource = lineItems;
            rp_productsales.DataBind();
        }
Beispiel #36
0
        protected override void InitializeSkin(System.Web.UI.Control Skin)
        {
            CommentRepeater = (Repeater)Skin.FindControl("NewComment");
            //CommentRepeater.DataSource = BView_WeblogUserComment.GetTopCommentByLogUID(blogContext.BlogUserId);
            CommentRepeater.DataSource = BGetCommentInfoByLogId.GetTopCommentByLogUID(blogContext.BlogUserId);
            CommentRepeater.DataBind();

            //throw new NotImplementedException();
        }
Beispiel #37
0
        /// <summary>
        /// Inits the metadata repeater.
        /// </summary>
        /// <param name="pageMetadata">The page metadata.</param>
        /// <param name="metadataTypeName">Name of the metadata type.</param>
        /// <param name="repeater">The repeater.</param>
        protected void InitMetadataRepeater(List<Metadata> pageMetadata, string metadataTypeName, Repeater repeater)
        {
            QueryRequest queryRequestFactory =  QueryRequestFactory.Instance.GetMetadataSubjectInstancesQueryRequest(ModuleCMS.Instance.PageTypes, FoundationContext.Current.LanguageID, FoundationContext.Current.Token);

            List<App_Code.Site.CMS.MetaData.Metadata> metadatas =   MetadataService.Instance.GetMetadatas(queryRequestFactory, ModuleCMS.Instance.PermissionManager,FoundationContext.Current.Token);

            repeater.DataSource = metadatas;
            repeater.DataBind();
        }
Beispiel #38
0
 void bingRepearter(string rootID, Repeater rMenu)
 {
     TreeNodeInfo<MenuInfo> cList = new BLL.Menu().GetTree(rootID);
     if (null == cList)
     {
         return;
     }
     rMenu.DataSource = cList.ChildNodeList;
     rMenu.DataBind();
 }
 public void read(String instr, Repeater repeater)
 {
     conn.Open();
     SqlCommand cmd = new SqlCommand();
     cmd.CommandText = instr;
     cmd.Connection = conn;
     repeater.DataSource = cmd.ExecuteReader();
     repeater.DataBind();
     conn.Close();
 }
Beispiel #40
0
        public static void BindRepeater(ref Repeater objRepeater, string strSelectQuery)
        {
            DataSet dsBindData = new DataSet();
            DataView dv = new DataView();

            //Fill DataSet And Create Dataview
            dsBindData = CrystalConnection.CreateDatasetWithoutTransaction(strSelectQuery);
            dv = dsBindData.Tables[0].DefaultView;

            //Bind the Repeader with PageDataSource
            objRepeater.DataSource = dv;
            objRepeater.DataBind();
        }
        public void Loadcate_index(int limit, int type, ref Repeater rp)
        {
            try
            {
                rp.DataSource = index.Load_cate_index(limit, type,0);
                rp.DataBind();
            }
            catch (Exception)
            {

                throw;
            }
        }
		private static void CreateRepeater(Control parent)
		{
			Control cellContainer = PrepareCellContainer(parent);

			Repeater repeater = new Repeater();
			cellContainer.Controls.Add(repeater);

			repeater.HeaderTemplate = new RepeaterHeaderTemplate();
			repeater.ItemTemplate = new RepeaterItemTemplate();

			repeater.DataSource = TestData.PrepareData();

			repeater.DataBind();
		}
Beispiel #43
0
        public static bool? Categories(Repeater userControl, string getstr)
        {
            if (string.IsNullOrEmpty(getstr))
            {
                return null;
            }
            SqlConnection con = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
            SqlCommand cmd = new SqlCommand("select discipline_id from discipline where Discipline_name = @name", con);
            cmd.Parameters.AddWithValue("name", getstr);

            try
            {
                con.Open();
                SqlDataReader dr = cmd.ExecuteReader();
                if (dr.HasRows)
                {
                    string str = "";
                    while (dr.Read())
                    {
                        str = dr["discipline_id"].ToString();
                        if (!string.IsNullOrEmpty(str))
                            break;
                    }

                    dr.Close();
                    SqlCommand cm = new SqlCommand("select categories_name from categories where discipline_id = @id", con);
                    cm.Parameters.AddWithValue("id", str);
                    dr = cm.ExecuteReader();
                    if (dr.HasRows)
                    {
                        SqlDataSource ds = new SqlDataSource(WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString, cm.CommandText);
                        ds.SelectParameters.Add("id", str);
                        userControl.DataSource = ds;
                        userControl.DataBind();
                        return true;
                    }

                }
                return false;
            }
            catch (Exception)
            {
                return false;
            }
            finally
            {
                con.Close();
            }
        }
 public void Load_ads(int position, ref Repeater rp)
 {
     try
     {
         var list = per.Load_slider(position, 1).ToList();
         if (list.Count > 0)
         {
             rp.DataSource = list;
             rp.DataBind();
         }
     }
     catch (Exception ex)
     {
         clsVproErrorHandler.HandlerError(ex);
     }
 }
 public void Load_ads(int position, ref Repeater rp)
 {
     try
     {
         var list = per.Load_slider(HttpContext.Current.Session["Cat_id"], position, 100).ToList();
         if (list.Count > 0)
         {
             rp.DataSource = list;
             rp.DataBind();
         }
     }
     catch (Exception ex)
     {
         clsVproErrorHandler.HandlerError(ex);
     }
 }
Beispiel #46
0
 protected void rptFeatures_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType != ListItemType.AlternatingItem && e.Item.ItemType != ListItemType.Item)
         return;
     var feature = e.Item.DataItem as Feature;
     if (!feature.Features.Any())
         return;
     var phSubtree = e.Item.FindControl("phSubtree");
     var rpt = new Repeater();
     rpt.DataSource = feature.Features;
     rpt.HeaderTemplate = (sender as Repeater).HeaderTemplate;
     rpt.FooterTemplate = (sender as Repeater).FooterTemplate;
     rpt.ItemTemplate = (sender as Repeater).ItemTemplate;
     rpt.ItemDataBound += rptFeatures_ItemDataBound;
     phSubtree.Controls.Add(rpt);
     rpt.DataBind();
 }
Beispiel #47
0
        public void Loadimgbig(int take, int skip, ref Repeater rp)
        {
            try
            {
                int _newsID = lnews.getNewsId("introl");
                var list = pro_detail.Load_albumimg(_newsID).Skip(skip).Take(take).ToList();
                if (list.Count > 0)
                {
                    rp.DataSource = list;
                    rp.DataBind();
                }
            }
            catch (Exception)
            {

                throw;
            }
        }
Beispiel #48
0
 public static bool Discipline(Repeater userControl, string command)
 {
     SqlDataSource ds = new SqlDataSource(WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString, command);
     if (!Count(command))
     {
         return false;
     }
     try
     {
         userControl.DataSource = ds;
         userControl.DataBind();
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
        protected void rptDropDownMenu_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
              Item node = (Item)e.Item.DataItem;
              {
            HyperLink MenuLink = (HyperLink)e.Item.FindControl("MenuLink");
            Literal MenuText = (Literal)e.Item.FindControl("MenuText");
            HtmlControl MenuLi = (HtmlControl)e.Item.FindControl("MenuLi");

            if (MenuLink != null && MenuText != null)
            {
              MenuText.Text = node["Menu Title"];
              MenuLink.NavigateUrl = LinkManager.GetItemUrl(node);
              if (node.ID == Sitecore.Context.Item.ID) { MenuLi.Attributes.Add("class", "active"); }

              if (node["Show Children In Menu"] == "1" && node.HasChildren && node.Parent.ID == HomeItem.ID)
              {
                MenuLi.Attributes.Add("class", "dropdown");
                MenuLink.Attributes.Add("class", "dropdown-toggle");
                MenuLink.Attributes.Add("data-toggle", "dropdown");
                MenuText.Text += "  <b class=\"caret\"></b>";

                PlaceHolder phSubTree = (PlaceHolder)e.Item.FindControl("phSubMenu");

                List<Item> nodes = new List<Item>();
                foreach (Item i in node.Children)
                {
                  if (SiteConfiguration.DoesItemExistInCurrentLanguage(i) && i["Show Item In Menu"] == "1") { nodes.Add(i); }
                }

                Repeater rpt = new Repeater();
                rpt.DataSource = nodes;
                rpt.HeaderTemplate = new TopBarRecursiveRepeaterTemplate(ListItemType.Header);
                rpt.ItemTemplate = rptDropDownMenu.ItemTemplate;
                rpt.FooterTemplate = new TopBarRecursiveRepeaterTemplate(ListItemType.Footer);
                rpt.ItemDataBound += new RepeaterItemEventHandler(rptDropDownMenu_ItemDataBound);
                phSubTree.Controls.Add(rpt);
                rpt.DataBind();
              }
            }
              }
            }
        }
 protected void _repeater_ItemDataBound( object sender, RepeaterItemEventArgs e )
 {
     if( e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem )
     {
         SearchTreeNodeHelper node = (SearchTreeNodeHelper)e.Item.DataItem;
         if( node.Children.Count != 0 )
         {
             Control ctl = e.Item.FindControl( "_childsPlaceHolder" );
             Repeater rpt = new Repeater();
             rpt.ItemTemplate = _repeater.ItemTemplate;
             rpt.HeaderTemplate = _repeater.HeaderTemplate;
             rpt.FooterTemplate = _repeater.FooterTemplate;
             rpt.ItemDataBound += _repeater_ItemDataBound;
             ctl.Controls.Add( rpt );
             rpt.DataSource = node.Children;
             rpt.DataBind();
         }
     }
 }
        protected void rptTree_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
             {
            Item node = (Item)e.Item.DataItem;
            {
               HyperLink MenuLink = (HyperLink)e.Item.FindControl("MenuLink");
               HtmlControl liwrapper = (HtmlControl)e.Item.FindControl("liwrapper");

               if (MenuLink != null)
               {
                  MenuLink.NavigateUrl = LinkManager.GetItemUrl(node);
                  MenuLink.Text = node["Menu Title"];

                  // determine if the current item is a descendant
                  if (Sitecore.Context.Item.ID == node.ID ||
                      node.Axes.SelectItems(String.Format(".//*[@@id = '{0}']", Sitecore.Context.Item.ID)) != null) // do not compare nodes as it is faster to compare ids.
                  {
                      liwrapper.Attributes.Add("class", "selected");

                      // now load the children since this is the selected node
                      if (node.HasChildren)
                      {
                          PlaceHolder phSubTree = (PlaceHolder)e.Item.FindControl("phSubTree");
                          Repeater rpt = new Repeater();
                          List<Item> nodes = new List<Item>();
                          foreach (Item i in node.Children)
                          {
                              if (i.Versions.Count > 0 && i["Hide Item from Secondary Menu"] != "1") { nodes.Add(i); }
                          }
                          rpt.DataSource = nodes;
                          rpt.HeaderTemplate = new RecursiveRepeaterTemplate(ListItemType.Header);
                          rpt.ItemTemplate = rptTree.ItemTemplate;
                          rpt.FooterTemplate = new RecursiveRepeaterTemplate(ListItemType.Footer);
                          rpt.ItemDataBound += new RepeaterItemEventHandler(rptTree_ItemDataBound);
                          phSubTree.Controls.Add(rpt);
                          rpt.DataBind();
                      }
                  }
               }
            }
             }
        }
        public void Loadindex(int perior,ref Repeater rp)
        {
            try
            {
                var list = index.Loadindex(1, perior, 12);
                if (list.Count > 0)
                {
                    rp.DataSource = list;
                    rp.DataBind();
                   
                }
               
                
            }
            catch (Exception)
            {

                throw;
            }
        }
Beispiel #53
0
 /// </summary> 
 /// 导出Excel文件,自动返回可下载的文件流 
 /// </summary> 
 public static void DataTable1Excel(Repeater repeater, System.Data.DataTable dtData)
 {
     HttpContext curContext = HttpContext.Current;
     StringWriter strWriter = null;
     HtmlTextWriter htmlWriter = null;
     if (dtData != null)
     {
         curContext.Response.AddHeader("content-disposition", "attachment;filename=" + "用户统计表-" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls");
         curContext.Response.ContentType = "application/vnd.ms-excel";
         curContext.Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
         curContext.Response.Charset = "utf-8";
         strWriter = new StringWriter();
         htmlWriter = new HtmlTextWriter(strWriter);
         repeater.DataSource = dtData;
         repeater.DataBind();
         repeater.RenderControl(htmlWriter);
         curContext.Response.Write(strWriter.ToString());
         curContext.Response.End();
     }
 }
        public void Loadindex(int skip,ref Repeater rp)
        {
            try
            {
                var list = index.LoadindexMobile(1, 1, skip, 20);
                if (list.Count > 0)
                {
                    rp.DataSource = list;
                    rp.DataBind();

                }


            }
            catch (Exception)
            {

                throw;
            }
        }
Beispiel #55
0
        protected void SearchForUsers(object sender, EventArgs e, Repeater repeater, GridView dataGrid, DropDownList dropDown, TextBox textBox)
        {
            ICollection coll = null;
            string text = textBox.Text;
            text = text.Replace("*", "%");
            text = text.Replace("?", "_");
            int total = 0;

            if (text.Trim().Length != 0) {
                if (dropDown.SelectedIndex == 0 /* userID */) {
                    coll = (MembershipUserCollection)CallWebAdminHelperMethod(true, "FindUsersByName", new object[] {(string)text, 0, Int32.MaxValue, total}, new Type[] {typeof(string), typeof(int), typeof(int), Type.GetType("System.Int32&")});
                } else {
                    coll = (MembershipUserCollection)CallWebAdminHelperMethod(true, "FindUsersByEmail", new object[]{(string)text, 0, Int32.MaxValue, total}, new Type[] {typeof(string), typeof(int), typeof(int), Type.GetType("System.Int32&")});
                }
            }

            dataGrid.PageIndex = 0;
            dataGrid.DataSource = coll;
            PopulateRepeaterDataSource(repeater);
            repeater.DataBind();
            dataGrid.DataBind();
        }
Beispiel #56
0
 public static void BindRepeaterCat(SPWeb web,Repeater rpt,string listName, string newsPosition)
 {
     var newPos = newsPosition;
     if (BoxNewsPosition.ContainsKey(newsPosition))
     {
         newPos = BoxNewsPosition[newsPosition];
     }
     SPSecurity.RunWithElevatedPrivileges(() =>
     {
         using (var adminSite = new SPSite(web.Site.ID))
         {
             using (var adminWeb = adminSite.OpenWeb(web.ID))
             {
                 try
                 {
                     adminWeb.AllowUnsafeUpdates = true;
                     string caml = @"<Where><And><Eq><FieldRef Name='{0}' /><Value Type='Choice'>{1}</Value></Eq><Eq><FieldRef Name='{2}' /><Value Type='Choice'>{3}</Value></Eq></And></Where><OrderBy><FieldRef Name='{4}' /><FieldRef Name='{5}' /></OrderBy>";
                     var query = new SPQuery()
                     {
                         Query = string.Format(CultureInfo.InvariantCulture, caml, FieldsName.CategoryList.InternalName.NewsPossition, newPos, FieldsName.CategoryList.InternalName.Type, "Tin tức", FieldsName.CategoryList.InternalName.CategoryLevel, FieldsName.CategoryList.InternalName.Order),
                         RowLimit=3
                     };
                     var list = Utilities.GetCustomListByUrl(adminWeb, listName);
                     var items = list.GetItems(query);
                     if (items != null && items.Count > 0)
                     {
                         rpt.DataSource = items.GetDataTable();
                         rpt.DataBind();
                     }
                 }
                 catch (SPException ex)
                 {
                     Utilities.LogToULS(ex);
                 }
             }
         }
     });
 }
        protected void rptDropDownMenu_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Item node = (Item)e.Item.DataItem;
                {
                    HyperLink MenuLink = (HyperLink)e.Item.FindControl("MenuLink");
                    Literal MenuText = (Literal)e.Item.FindControl("MenuText");

                    if (MenuLink != null && MenuText != null)
                    {
                        MenuText.Text = node["Menu Title"];
                        MenuLink.NavigateUrl = LinkManager.GetItemUrl(node);

                        if (node["Hide Children from Menu"] != "1" && node.HasChildren)
                        {
                            PlaceHolder phSubTree = (PlaceHolder)e.Item.FindControl("phSubMenu");

                            List<Item> nodes = new List<Item>();
                            foreach (Item i in node.Children)
                            {
                                if (i.Versions.Count > 0 && i["Hide Item from Menu"] != "1") { nodes.Add(i); }
                            }

                            Repeater rpt = new Repeater();
                            rpt.DataSource = nodes;
                            rpt.HeaderTemplate = rptDropDownMenu.HeaderTemplate;
                            rpt.ItemTemplate = rptDropDownMenu.ItemTemplate;
                            rpt.FooterTemplate = rptDropDownMenu.FooterTemplate;
                            rpt.ItemDataBound += new RepeaterItemEventHandler(rptDropDownMenu_ItemDataBound);
                            phSubTree.Controls.Add(rpt);
                            rpt.DataBind();
                        }
                    }
                }
            }
        }
        /// <summary>
        /// Used to bind a repeater for a given Panel to a List of Modules.  Each panel is defined by a type.  Each type can be assigned
        /// one or more modules. 
        /// </summary>
        /// <param name="repeater">A repeater control is passed by ref to this method.</param>
        /// <param name="paneltype">The type of the Panel as defined in the PresentationXML //Panel/@Type attribute</param>
        public void BindRepeaterToPanel(ref Repeater repeater, List<Framework.Utilities.Panel> panels)
        {
            Framework.Utilities.Panel rtnpanel = new Profiles.Framework.Utilities.Panel();

            try
            {
                if (panels.Count() == 1)
                {
                    foreach (Framework.Utilities.Panel f in panels)
                        rtnpanel.Modules = f.Modules;
                }
                else
                {
                    rtnpanel.Modules = new List<Utilities.Module>();

                    foreach (Framework.Utilities.Panel f in panels)
                    {
                        if (f.Alias != string.Empty && this.Tab != string.Empty)
                            f.DefaultTab = false;
                        else if (f.Alias != string.Empty && f.TabType == "Default" && this.Tab == string.Empty)
                            f.DefaultTab = true;

                        if ((f.Alias == this.Tab) || (f.DefaultTab))
                        {
                            foreach (Utilities.Module m in f.Modules)
                                rtnpanel.Modules.Add(m);
                        }

                    }
                }
            }
            catch (Exception ex) { Framework.Utilities.DebugLogging.Log(ex.Message + " ++ " + ex.StackTrace); }

            repeater.DataSource = rtnpanel.Modules;
            repeater.DataBind();
        }
		private void Page_Load(object sender, System.EventArgs e) 
		{
			//Put user code to initialize the page here

			System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1");
			GHTTestBegin(frm);

			GHTActiveSubTest = GHTSubTest1;
			try 
			{
				Repeater1.DataSource = GHTTests.GHDataSources.DSArrayList();
				Repeater1.DataBind();
			}
			catch (Exception ex) 
			{
				GHTSubTestUnexpectedExceptionCaught(ex);
			}

			GHTActiveSubTest = GHTSubTest2;
			try 
			{
				Repeater2.DataSource = GHTTests.GHDataSources.DSArrayList();
				Repeater2.DataBind();
			}
			catch (Exception ex) 
			{
				GHTSubTestUnexpectedExceptionCaught(ex);
			}

			GHTActiveSubTest = GHTSubTest3;
			try 
			{
				Repeater3.DataSource = GHTTests.GHDataSources.DSArrayList();
				Repeater3.DataBind();
			}
			catch (Exception ex) 
			{
				GHTSubTestUnexpectedExceptionCaught(ex);
			}

			GHTActiveSubTest = GHTSubTest4;
			try 
			{
				Repeater4.DataSource = GHTTests.GHDataSources.DSArrayList();
				Repeater4.DataBind();
			}
			catch (Exception ex) 
			{
				GHTSubTestUnexpectedExceptionCaught(ex);
			}

			GHTActiveSubTest = GHTSubTest5;
			try 
			{
				Repeater5.DataSource = GHTTests.GHDataSources.DSArrayList();
				Repeater5.DataBind();
			}
			catch (Exception ex) 
			{
				GHTSubTestUnexpectedExceptionCaught(ex);
			}

			GHTActiveSubTest = GHTSubTest6;
			try 
			{
				Repeater6.DataSource = GHTTests.GHDataSources.DSArrayList();
				Repeater6.DataBind();
			}
			catch (Exception ex) 
			{
				GHTSubTestUnexpectedExceptionCaught(ex);
			}

			GHTActiveSubTest = GHTSubTest7;
			try 
			{
				Repeater7.DataSource = GHTTests.GHDataSources.DSArrayList();
				Repeater7.DataBind();
			}
			catch (Exception ex) 
			{
				GHTSubTestUnexpectedExceptionCaught(ex);
			}

			GHTSubTestBegin("Code base template 1");
			try 
			{
				System.Web.UI.WebControls.Repeater Repeater8 = new System.Web.UI.WebControls.Repeater();
				GHTActiveSubTest.Controls.Add(Repeater8);
				Repeater8.DataSource = GHTTests.GHDataSources.DSArrayList();
				Repeater8.ItemTemplate = new t_EmptyLitTemplate();
				Repeater8.DataBind();
			}
			catch (Exception ex) 
			{
				GHTSubTestUnexpectedExceptionCaught(ex);
			}
			GHTSubTestEnd();

			GHTSubTestBegin("Code base template 2");
			try 
			{
				System.Web.UI.WebControls.Repeater Repeater9 = new System.Web.UI.WebControls.Repeater();
				GHTActiveSubTest.Controls.Add(Repeater9);
				Repeater9.DataSource = GHTTests.GHDataSources.DSArrayList();
				Repeater9.ItemTemplate = new t_PlainTextLitTemplate();
				Repeater9.DataBind();
			}
			catch (Exception ex) 
			{
				GHTSubTestUnexpectedExceptionCaught(ex);
			}
			GHTSubTestEnd();

			GHTSubTestBegin("Code base template 3");
			try 
			{
				System.Web.UI.WebControls.Repeater Repeater10 = new System.Web.UI.WebControls.Repeater();
				GHTActiveSubTest.Controls.Add(Repeater10);
				Repeater10.DataSource = GHTTests.GHDataSources.DSArrayList();
				Repeater10.ItemTemplate = new t_HtmlLitTemplate();
				Repeater10.DataBind();
			}
			catch (Exception ex) 
			{
				GHTSubTestUnexpectedExceptionCaught(ex);
			}
			GHTSubTestEnd();

			GHTSubTestBegin("Code base template 4");
			try 
			{
				System.Web.UI.WebControls.Repeater Repeater11 = new System.Web.UI.WebControls.Repeater();
				GHTActiveSubTest.Controls.Add(Repeater11);
				Repeater11.DataSource = GHTTests.GHDataSources.DSArrayList();
				Repeater11.ItemTemplate = new t_ControlLitTemplate();
				Repeater11.DataBind();
			}
			catch (Exception ex) 
			{
				GHTSubTestUnexpectedExceptionCaught(ex);
			}
			GHTSubTestEnd();

			GHTSubTestBegin("Code base template 5");
			try 
			{
				System.Web.UI.WebControls.Repeater Repeater12 = new System.Web.UI.WebControls.Repeater();
				GHTActiveSubTest.Controls.Add(Repeater12);
				Repeater12.DataSource = GHTTests.GHDataSources.DSArrayList();
				Repeater12.ItemTemplate = new t_DBLitTemplate();
				Repeater12.DataBind();
			}
			catch (Exception ex) 
			{
				GHTSubTestUnexpectedExceptionCaught(ex);
			}
			GHTSubTestEnd();

			GHTTestEnd();
		}
        public void Loadimgbig(int take, int skip, ref Repeater rp)
        {
            try
            {
                int _newsID = Utils.CIntDef(Session["news_id"]);
                var list = pro_detail.Load_albumimg(_newsID).Skip(skip).Take(take).ToList();
                if (list.Count > 0)
                {
                    rp.DataSource = list;
                    rp.DataBind();
                }
            }
            catch (Exception)
            {

                throw;
            }
        }