Example #1
0
        protected string GetEditUrl(object container)
        {
            System.Web.UI.WebControls.RepeaterItem ri  = container as System.Web.UI.WebControls.RepeaterItem;
            MetricTrac.Bll.MetricValue.Extend      val = ri.DataItem as MetricTrac.Bll.MetricValue.Extend;
            int BackPageIndex = 1;

            switch (DataMode)
            {
            case Mode.Input:
                BackPageIndex = 1;
                break;

            case Mode.Approve:
                BackPageIndex = 2;
                break;

            default:
                BackPageIndex = 1;
                break;
            }
            return("MetricInputEdit.aspx?MetricID=" + val.MetricID +
                   "&Date=" + val.Date.ToString("MM-dd-yyyy") +
                   "&OrgLocationID=" + LastMetricMetricValue.OrgLocationID +
                   "&Mode=" + DataMode.ToString() +
                   "&BulkEdit=True" +
                   "&BackPage=" + BackPageIndex.ToString());
        }
        protected string GetSearchResultHighlight(RepeaterItem rptItem)
        {
            string searchHiglight = string.Empty;
            var sr = (SearchResult)rptItem.DataItem;

            if (sr.Fields.ContainsKey("hTMLContent"))
            {
                searchHiglight = ExtensionMethods.GetHighlight(sr.Fields["hTMLContent"], LuceneIndex,
                                                               string.Format(GeneratedQuery,SearchTerm), "hTMLContent");
            }
            else if (sr.Fields.ContainsKey("description"))
            {
                searchHiglight = ExtensionMethods.GetHighlight(sr.Fields["description"], LuceneIndex,
                                                               string.Format(GeneratedQuery, SearchTerm), "description");
            }
            else if (sr.Fields.ContainsKey("copy"))
            {
                searchHiglight = ExtensionMethods.GetHighlight(sr.Fields["copy"], LuceneIndex,
                                                               string.Format(GeneratedQuery, SearchTerm), "copy");
            }
            else if (sr.Fields.ContainsKey("bodyText"))
            {
                searchHiglight = ExtensionMethods.GetHighlight(sr.Fields["bodyText"], LuceneIndex,
                                                               string.Format(GeneratedQuery, SearchTerm), "bodyText");
            }

            return searchHiglight;
        }
 protected String IsHidden(RepeaterItem item)
 {
     DataRowView drv = (DataRowView)item.DataItem;
     return (((drv.Row["GPI"].ToString() == ThisSession.DrugGPI) &&
        (drv.Row["QuantityUOM"].ToString().Replace("\n","").Replace("\r","") == ThisSession.DrugQuantityUOM)) ?
        "" : "hidden");
 }
Example #4
0
        protected string GetClientId(object container)
        {
            System.Web.UI.WebControls.RepeaterItem ri  = container as System.Web.UI.WebControls.RepeaterItem;
            MetricTrac.Bll.MetricValue.Extend      val = ri.DataItem as MetricTrac.Bll.MetricValue.Extend;
            string ClientId = String.Empty;

            switch (val.MetricDataTypeID)
            {
            case 2:
                System.Web.UI.WebControls.TextBox tbValue = (System.Web.UI.WebControls.TextBox)ri.FindControl("tbValue");
                ClientId = tbValue.ClientID;
                break;

            case 3:
                System.Web.UI.WebControls.CheckBox chbValue = (System.Web.UI.WebControls.CheckBox)ri.FindControl("chbValue");
                ClientId = chbValue.ClientID;
                break;

            case 4:
                Telerik.Web.UI.RadDatePicker rdpDateValue = (Telerik.Web.UI.RadDatePicker)ri.FindControl("rdpDateValue");
                ClientId = rdpDateValue.ClientID;
                break;

            case 1:
            default:
                Telerik.Web.UI.RadNumericTextBox rntValue = (Telerik.Web.UI.RadNumericTextBox)ri.FindControl("rntValue");
                ClientId = rntValue.ClientID;
                break;
            }
            return(ClientId);
        }
Example #5
0
        protected string GetChartUrl(object container)
        {
            System.Web.UI.WebControls.RepeaterItem ri = container as System.Web.UI.WebControls.RepeaterItem;
            MetricTrac.Bll.MetricOrgValue          v  = (MetricTrac.Bll.MetricOrgValue)ri.DataItem;
            string FreqDate = "cskckj";//FrequencyFirstDate[v.FrequencyID].ToString("MM-dd-yyyy");

            return("DataValueChart.aspx?MetricID=" + v.MetricID + "&OrgLocationID=" + v.OrgLocationID + "&Date=" + FreqDate);
        }
		public ListItemEventArgs(ListItemBase listItem) {
			if(listItem == null) {
				throw new ArgumentNullException("listItem");
			}
			this.listItem = listItem;
			this.listItemObject = listItem.ListItem;
			this.listingObject = listItem.ListingObject;
			this.repeaterItem = listItem.RepeaterItem;
			this.itemIndex = listItem.ItemIndex;
		}
Example #7
0
 private System.Web.UI.WebControls.LinkButton GetLinkButton(string name, System.Web.UI.WebControls.RepeaterItem ri)
 {
     System.Web.UI.WebControls.LinkButton obj = null;
     try
     {
         obj = (System.Web.UI.WebControls.LinkButton)ri.FindControl(name);
     }
     catch
     {
     }
     return(obj);
 }
Example #8
0
 private void GetHtmlButton(string name, System.Web.UI.WebControls.RepeaterItem ri, bool b)
 {
     try
     {
         Control obj1 = ri.FindControl(name);
         if (obj1 != null)
         {
             obj1.Visible = b;
         }
     }
     catch { }
 }
Example #9
0
 private System.Web.UI.HtmlControls.HtmlAnchor GetHtmlLink(string name, System.Web.UI.WebControls.RepeaterItem ri)
 {
     System.Web.UI.HtmlControls.HtmlAnchor obj = null;
     try
     {
         obj = (System.Web.UI.HtmlControls.HtmlAnchor)ri.FindControl(name);
     }
     catch
     {
     }
     return(obj);
 }
        /// <summary>
        /// Checks the current item to see if it differs from the previous item
        /// </summary>
        /// <param name="item">item to be checked</param>
        /// <returns><c>true</c> if this item is different from the previous</returns>
        /// <remarks>Calling this method again on the same item will always return false</remarks>
        public bool IsNewGroupItem(RepeaterItem item) {

            //See if this is a data item with a new value
            if ((item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
                && item.DataItem != null && _comparer.Compare(lastvalue, item.DataItem) != 0) {

                //remeber this value
                lastvalue = item.DataItem;
                return true;
            }

            return false;
        }
 /// <summary>
 /// 生成要返回的数据(附加在tr里的数据)
 /// </summary>        
 protected string getReturnData(RepeaterItem repeaterItem)
 {
     string[] fieldNames = this.hidFieldNames.Value.Trim().Split('|');
     StringBuilder sb = new StringBuilder();
     foreach (string fieldName in fieldNames)
     {
         sb.Append(" data-")
           .Append(fieldName)
           .Append("=\"")
           .Append(Server.HtmlEncode(DataBinder.Eval(repeaterItem.DataItem, fieldName).ToString()))
           .Append("\" ");
     }
     return sb.ToString();
 }
Example #12
0
 private void GetButton(string name, System.Web.UI.WebControls.RepeaterItem ri, bool b)
 {
     try
     {
         System.Web.UI.WebControls.Button obj = (System.Web.UI.WebControls.Button)ri.FindControl(name);
         if (obj != null)
         {
             obj.Visible = b;
         }
     }
     catch
     {
         GetHtmlButton(name, ri, b);
     }
 }
 private void InstantiateEmptyTemplate()
 {
     if (itemsCreated == 0 && EmptyTemplate != null)
     {
         System.Web.UI.WebControls.RepeaterItem ri = new System.Web.UI.WebControls.RepeaterItem(0, System.Web.UI.WebControls.ListItemType.Header);
         EmptyTemplate.InstantiateIn(ri);
         Controls.Add(ri);
         OnItemCreated(new System.Web.UI.WebControls.RepeaterItemEventArgs(ri));
         if (useDataSource)
         {
             ri.DataBind();
             OnItemDataBound(new System.Web.UI.WebControls.RepeaterItemEventArgs(ri));
         }
     }
 }
Example #14
0
		private void InstantiateEmptyTemplate()
		{
			if (itemsCreated == 0 && EmptyTemplate != null)
			{
				System.Web.UI.WebControls.RepeaterItem ri = new System.Web.UI.WebControls.RepeaterItem(0, System.Web.UI.WebControls.ListItemType.Header);
				EmptyTemplate.InstantiateIn(ri);
				Controls.Add(ri);
				OnItemCreated(new System.Web.UI.WebControls.RepeaterItemEventArgs(ri));
				if (useDataSource)
				{
					ri.DataBind();
					OnItemDataBound(new System.Web.UI.WebControls.RepeaterItemEventArgs(ri));
				}
			}
		}
Example #15
0
 protected bool IsNewGroup(object container)
 {
     System.Web.UI.WebControls.RepeaterItem ri  = container as System.Web.UI.WebControls.RepeaterItem;
     MetricTrac.Bll.MetricOrgValue          mmv = ri.DataItem as MetricTrac.Bll.MetricOrgValue;
     if (LastMetricMetricValue == null)
     {
         return(true);
     }
     if (LastMetricMetricValue.FrequencyID != mmv.FrequencyID)
     {
         return(true);
     }
     if (GroupByMetric)
     {
         return(LastMetricMetricValue.MetricID != mmv.MetricID);
     }
     return(LastMetricMetricValue.OrgLocationID != mmv.OrgLocationID);
 }
Example #16
0
 public void SetRowValue(bool otherBreak, int index, string value, Repeater rpt, RepeaterItem item, string controlId, string width)
 {
     if (this._value == null)
     {
         Init(index, value);
         if (_total == 1)
         {
             Literal ltr = (Literal)item.FindControl(controlId);
             ltr.Text = " <td align=\"center\" style=\"width:" + width + "\">" + _value + "</td>";
         }
     }
     else
     {
         if (index == _total - 1 || index == _pageSize - 1)
         {
             if (value != this._value || otherBreak)
             {
                 Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                 ltr.Text = " <td align=\"center\" style=\"width:" + width + "\"" + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
                 ltr = (Literal)item.FindControl(controlId);
                 ltr.Text = " <td align=\"center\" style=\"width:" + width + "\">" + value + "</td>";
             }
             else
             {
                 _rowCount++;
                 Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                 ltr.Text = " <td align=\"center\" style=\"width:" + width + "\"" + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
             }
         }
         else
             if (value != this._value || otherBreak)
             {
                 Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                 ltr.Text = " <td align=\"center\" style=\"width:" + width + "\"" + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
                 Init(index, value);
             }
             else
             {
                 _rowCount++;
             }
     }
 }
        protected virtual void InitializeItem(RepeaterItem item)
        {
            ITemplate itemTemplate = null;

            switch (item.ItemType)
            {
            case ListItemType.Header:
                itemTemplate = this.headerTemplate;
                goto Label_005B;

            case ListItemType.Footer:
                itemTemplate = this.footerTemplate;
                goto Label_005B;

            case ListItemType.Item:
                break;

            case ListItemType.AlternatingItem:
                itemTemplate = this.alternatingItemTemplate;
                if (itemTemplate != null)
                {
                    goto Label_005B;
                }
                break;

            case ListItemType.Separator:
                itemTemplate = this.separatorTemplate;
                goto Label_005B;

            default:
                goto Label_005B;
            }
            itemTemplate = this.itemTemplate;
Label_005B:
            if (itemTemplate != null)
            {
                itemTemplate.InstantiateIn(item);
            }
        }
Example #18
0
        /// <devdoc>
        /// </devdoc>
        private RepeaterItem CreateItem(int itemIndex, ListItemType itemType, bool dataBind, object dataItem)
        {
            RepeaterItem          item = CreateItem(itemIndex, itemType);
            RepeaterItemEventArgs e    = new RepeaterItemEventArgs(item);

            InitializeItem(item);
            if (dataBind)
            {
                item.DataItem = dataItem;
            }
            OnItemCreated(e);
            Controls.Add(item);

            if (dataBind)
            {
                item.DataBind();
                OnItemDataBound(e);

                item.DataItem = null;
            }

            return(item);
        }
Example #19
0
        /// <devdoc>
        /// <para>A protected method. Populates iteratively the specified <see cref='System.Web.UI.WebControls.RepeaterItem'/> with a
        ///    sub-hierarchy of child controls.</para>
        /// </devdoc>
        protected virtual void InitializeItem(RepeaterItem item)
        {
            ITemplate contentTemplate = null;

            switch (item.ItemType)
            {
            case ListItemType.Header:
                contentTemplate = headerTemplate;
                break;

            case ListItemType.Footer:
                contentTemplate = footerTemplate;
                break;

            case ListItemType.Item:
                contentTemplate = itemTemplate;
                break;

            case ListItemType.AlternatingItem:
                contentTemplate = alternatingItemTemplate;
                if (contentTemplate == null)
                {
                    goto case ListItemType.Item;
                }
                break;

            case ListItemType.Separator:
                contentTemplate = separatorTemplate;
                break;
            }

            if (contentTemplate != null)
            {
                contentTemplate.InstantiateIn(item);
            }
        }
Example #20
0
        protected virtual void InitializeItem(RepeaterItem item)
        {
            ITemplate t = null;

            switch (item.ItemType)
            {
            case ListItemType.Header:
                t = HeaderTemplate;
                break;

            case ListItemType.Footer:
                t = FooterTemplate;
                break;

            case ListItemType.Item:
                t = ItemTemplate;
                break;

            case ListItemType.AlternatingItem:
                t = AlternatingItemTemplate;
                if (t == null)
                {
                    t = ItemTemplate;
                }
                break;

            case ListItemType.Separator:
                t = SeparatorTemplate;
                break;
            }

            if (t != null)
            {
                t.InstantiateIn(item);
            }
        }
 public RepeaterItemEventArgs(RepeaterItem item)
 {
 }
Example #22
0
 public RepeaterCommandEventArgs(RepeaterItem item, Object commandSource, CommandEventArgs originalArgs) : base(default(CommandEventArgs))
 {
 }
Example #23
0
 protected string GetRelatedUrl(object container)
 {
     System.Web.UI.WebControls.RepeaterItem ri = container as System.Web.UI.WebControls.RepeaterItem;
     MetricTrac.Bll.MetricOrgValue          m  = ri.DataItem as MetricTrac.Bll.MetricOrgValue;
     return((DataMode == Mode.View ? "RelatedInputValues" : "RelatedInputValuesA") + ".aspx?MetricID=" + m.MetricID);
 }
Example #24
0
        public void SetRowControl(bool otherBreak, int index, string value, Repeater rpt, RepeaterItem item, string controlId, string id)
        {
            if (this._value == null)
            {
                Init(index, value);
                if (_total == 1)
                {
                    Literal ltr = (Literal)item.FindControl(controlId);
                    ltr.Text = " <td align=\"center\">" + "";
                    ((Control)item.FindControl(id)).Visible = true;

                }
            }
            else
            {
                if (index == _total - 1)
                {
                    if (value != this._value || otherBreak)
                    {
                        Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                        ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + "";
                        ((Control)rpt.Items[_index].FindControl(id)).Visible = true;

                        ltr = (Literal)item.FindControl(controlId);
                        ltr.Text = " <td align=\"center\">" + "";
                        ((Control)item.FindControl(id)).Visible = true;
                    }
                    else
                    {
                        _rowCount++;
                        Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                        ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + "";

                        ((Control)rpt.Items[_index].FindControl(id)).Visible = true;

                    }
                }
                else
                    if (value != this._value || otherBreak)
                    {
                        Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                        ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + "";
                        ((Control)rpt.Items[_index].FindControl(id)).Visible = true;

                        Init(index, value);
                    }
                    else
                    {
                        _rowCount++;
                    }
            }
        }
Example #25
0
        /// <summary>
        /// If a banner has more than one banner no, then each day need sum value up
        /// </summary>
        /// <param name="rpt"></param>
        /// <param name="_rowCount"></param>
        /// <param name="index"></param>
        /// <returns></returns>
        private string GetBannerData(Repeater rpt, int _rowCount, int index, RepeaterItem item)
        {
            int pvCountI = 0;
            int pvCountE = 0;
            int pvCountS = 0;
            int pvCountAll = 0;
            int clickCountI = 0;
            int clickCountE = 0;
            int clickCountS = 0;
            int clickCountAll = 0;
            int uniqueCountI = 0;
            int uniqueCountE = 0;
            int uniqueCountS = 0;
            int uniqueCountAll = 0;
            for (int i = 0; i < _rowCount - 1; i++)
            {
                RepeaterItem itemDetail = null;
                if (item != null && i == _rowCount - 2)
                {
                    itemDetail = item;
                }
                else
                {
                    itemDetail = (RepeaterItem)rpt.Items[index - 1 - i];
                }
                TextBox txt = (TextBox)itemDetail.FindControl("txtPvCountI");
                pvCountI += Func.ParseInt(txt.Text);
                txt = (TextBox)itemDetail.FindControl("txtPvCountE");
                pvCountE += Func.ParseInt(txt.Text);
                txt = (TextBox)itemDetail.FindControl("txtPvCountS");
                pvCountS += Func.ParseInt(txt.Text);

                txt = (TextBox)itemDetail.FindControl("txtClickCountI");
                clickCountI += Func.ParseInt(txt.Text);
                txt = (TextBox)itemDetail.FindControl("txtClickCountE");
                clickCountE += Func.ParseInt(txt.Text);
                txt = (TextBox)itemDetail.FindControl("txtClickCountS");
                clickCountS += Func.ParseInt(txt.Text);

                txt = (TextBox)itemDetail.FindControl("txtUniqueCountI");
                uniqueCountI += Func.ParseInt(txt.Text);
                txt = (TextBox)itemDetail.FindControl("txtUniqueCountE");
                uniqueCountE += Func.ParseInt(txt.Text);
                txt = (TextBox)itemDetail.FindControl("txtUniqueCountS");
                uniqueCountS += Func.ParseInt(txt.Text);

                Label lblAll = (Label)itemDetail.FindControl("lblPvCountAll");
                pvCountAll += Func.ParseInt(lblAll.Text);
                lblAll = (Label)itemDetail.FindControl("lblClickCountAll");
                clickCountAll += Func.ParseInt(lblAll.Text);
                lblAll = (Label)itemDetail.FindControl("lblUniqueCountAll");
                uniqueCountAll += Func.ParseInt(lblAll.Text);

            }
            System.Text.StringBuilder sb = new System.Text.StringBuilder("<tr class=\"TitleNoBold\">");
            sb.AppendFormat("<td>合計</td><td align=\"right\">{0}</td><td align=\"right\">{1}</td><td align=\"right\">{2}</td>", Func.FormatNumber(pvCountI), Func.FormatNumber(clickCountI), Func.FormatNumber(uniqueCountI));
            sb.AppendFormat("<td align=\"right\">{0}</td><td align=\"right\">{1}</td><td align=\"right\">{2}</td>", Func.FormatNumber(pvCountE), Func.FormatNumber(clickCountE), Func.FormatNumber(uniqueCountE));
            sb.AppendFormat("<td align=\"right\">{0}</td><td align=\"right\">{1}</td><td align=\"right\">{2}</td>", Func.FormatNumber(pvCountS), Func.FormatNumber(clickCountS), Func.FormatNumber(uniqueCountS));
            sb.AppendFormat("<td align=\"right\">{0}</td><td align=\"right\">{1}</td><td align=\"right\">{2}</td><td></td>", Func.FormatNumber(pvCountAll), Func.FormatNumber(clickCountAll), Func.FormatNumber(uniqueCountAll));
            sb.Append("</tr>");
            return sb.ToString();
        }
		protected virtual void InitializeItem (RepeaterItem item)
		{
			ITemplate t = null;
			
			switch (item.ItemType) {
			case ListItemType.Header:
				t = HeaderTemplate;
				break;
			case ListItemType.Footer:
				t = FooterTemplate;
				break;	
			case ListItemType.Item:
				t = ItemTemplate;
				break;
			case ListItemType.AlternatingItem:
				t = AlternatingItemTemplate;
				if (t == null)
					t = ItemTemplate;
				break;
			case ListItemType.Separator:
				t = SeparatorTemplate;
				break;
			}

			if (t != null)
				t.InstantiateIn (item);			
		}
Example #27
0
 protected string GetSelectClientId(object container)
 {
     System.Web.UI.WebControls.RepeaterItem ri = container as System.Web.UI.WebControls.RepeaterItem;
     System.Web.UI.WebControls.DropDownList ddlApprovalStatus = (System.Web.UI.WebControls.DropDownList)ri.FindControl("ddlApprovalStatus");
     return(ddlApprovalStatus.ClientID);
 }
 /// <summary>
 /// Raises the repeater event.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <param name="ev">The ev.</param>
 private void RaiseRepeaterEvent(RepeaterItem item, ViewEventHandler ev)
 {
     this._CurrentGroup = this.GLMinorCategoryActivityGroups[item.ItemIndex];
     this._currentMinorCategoriesControl = item.FindControl("MinorCategoryDropDown") as MultiSelectDropDown;
     this._currentActivityTypesControl = item.FindControl("ActivityTypeDropDown") as MultiSelectDropDown;
     ev();
 }
 private void ChangeRowVisibility(RepeaterItem item, string trName, bool visibility)
 {
     HtmlTableRow row = (HtmlTableRow)item.FindControl(trName);
     if (null != row) row.Visible = visibility;
 }
 private void ChangeCallLogRepeaterColumnVisibility(RepeaterItem item, string colName, bool visibility)
 {
     HtmlTableCell cell = (HtmlTableCell)item.FindControl(colName);
     if (null != cell) cell.Visible = visibility;
 }
 public void rptJobSummaryResources_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         JobSummaryResourceRepeaterItem = e.Item;
         _presenter.FillJobSummaryResourceRow();
     }
 }
        public void ChangeHeaderCssClass(RepeaterItem item)
        {
            string thName = string.Empty;
            if (DashBoardViewType == Globals.Dashboard.ViewType.JobSummaryView)
            {
                switch (JobSummarySortColumn)
                {
                    case Globals.Common.Sort.JobSummarySortColumns.Division:
                        thName = "thDivision";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.JobNumber:
                        thName = "thJobNumber";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.CustomerResource:
                        thName = "thCustomerResource";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.JobStatus:
                        thName = "thJobStatus";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.Location:
                        thName = "thLocation";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.ProjectManager:
                        thName = "thProjectManager";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.ModifiedBy:
                        thName = "thModifiedBy";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.LastModification:
                        thName = "thLastModification";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.InitialCallDate:
                        thName = "thInitialCallDate";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.PresetDate:
                        thName = "thPresetDate";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.LastCallType:
                        thName = "thLastCallType";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.LastCallDate:
                        thName = "thLastCallDate";
                        break;
                    case Globals.Common.Sort.JobSummarySortColumns.None:
                    default:
                        thName = string.Empty;
                        break;
                }
            }
            else if (DashBoardViewType == Globals.Dashboard.ViewType.JobCallLogView)
            {
                switch (JobCallLogSortColumn)
                {
                    case Globals.Common.Sort.JobCallLogSortColumns.Division:
                        thName = "thDivision";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.JobNumber:
                        thName = "thJobNumber";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.Customer:
                        thName = "thCustomer";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.CallType:
                        thName = "thCallType";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.CalledInBy:
                        thName = "thCalledInBy";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.CallDate:
                        thName = "thCallDate";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.CallTime:
                        thName = "thCallTime";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.ModifiedBy:
                        thName = "thModifiedBy";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.Details:
                        thName = "thDetails";
                        break;
                    case Globals.Common.Sort.JobCallLogSortColumns.None:
                    default:
                        thName = string.Empty;
                        break;
                }
            }

            string[] items = OrderBy;
            if (!string.IsNullOrEmpty(thName))
            {
                HtmlTableCell control = item.FindControl(thName) as HtmlTableCell;
                if (null != control)
                {
                    if (items[1] == "1")
                        control.Attributes.Add("class", control.Attributes["class"] + " Ascending");
                    else
                        control.Attributes.Add("class", control.Attributes["class"] + " Descending");
                }
            }
        }
Example #33
0
 protected override void OnDataBinding(EventArgs e)
 {
     base.OnDataBinding(e);
     if ((Items.Count == 0) && (NoneTemplate != null))
     {
         this.Controls.Clear();
         //执行空数据源模板
         RepeaterItem noneItem = new RepeaterItem(-1, ListItemType.Item);
         RepeaterItemEventArgs noneArgs = new RepeaterItemEventArgs(noneItem);
         NoneTemplate.InstantiateIn(noneItem);
         this.OnItemCreated(noneArgs);
         this.Controls.Add(noneItem);
         OnNoneItemsDataBound(noneArgs);
         this.ChildControlsCreated = true;
     }
 }
 protected virtual new void InitializeItem(RepeaterItem item)
 {
 }
 private CategoryConditionModel GetParaCondition(int scenceId, int cateId, RepeaterItem item)
 {
     CategoryConditionModel ccmodel = null;
     Label lblPropName = item.FindControl("lblPropName") as Label;
     CheckBoxList cblPara = item.FindControl("cblPara") as CheckBoxList;
     List<string> selvals = new List<string>();
     foreach (ListItem sitem in cblPara.Items)
     {
         if (sitem.Selected)
             selvals.Add("'" + sitem.Value + "'");
     }
     if (selvals.Count > 0)
     {
         string rulvals = String.Join(",", selvals.ToArray());
         ccmodel = new CategoryConditionModel(scenceId, cateId, int.Parse(lblPropName.ToolTip), rulvals);
     }
     return ccmodel;
 }
Example #36
0
 protected string GetRole(RepeaterItem repeaterItem)
 {
     return (string)((RepeaterItem)repeaterItem.Parent.Parent).DataItem;
 }
Example #37
0
        public void SetBannerRowValue(int index, string value, Repeater rpt, RepeaterItem item, string controlId, string sumRowId)
        {
            if (this._value == null)
            {
                Init(index, value);
                if (_total == 1)
                {
                    Literal ltr = (Literal)item.FindControl(controlId);
                    ltr.Text = " <td align=\"center\">" + _value + "</td>";
                }
            }
            else
            {
                if (index == _total - 1)
                {
                    if (value != this._value)
                    {
                        if (_rowCount > 1 && index > 0)
                        {
                            _rowCount++;
                            Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                            ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
                            ltr = (Literal)item.FindControl(controlId);
                            ltr.Text = " <td align=\"center\" rowspan=\"1\">" + value + "</td>";
                            ltr = (Literal)rpt.Items[index - 1].FindControl(sumRowId);
                            ltr.Text = GetBannerData(rpt, _rowCount, index);
                        }
                        else
                        {
                            Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                            ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
                            ltr = (Literal)item.FindControl(controlId);
                            ltr.Text = " <td align=\"center\">" + value + "</td>";
                        }
                    }
                    else
                    {
                        _rowCount++;
                        if (_rowCount > 1 && index > 0)
                        {
                            _rowCount++;
                            Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                            ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
                            ltr = (Literal)item.FindControl(sumRowId); //last record
                            ltr.Text = GetBannerData(rpt, _rowCount, index, item);
                        }
                        else
                        {
                            Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                            ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
                        }
                    }
                }
                else
                    if (value != this._value)
                    {

                        if (_rowCount > 1 && index > 0)
                        {
                            _rowCount++;
                            Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                            ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
                            ltr = (Literal)rpt.Items[index - 1].FindControl(sumRowId);
                            ltr.Text = GetBannerData(rpt, _rowCount, index);
                        }
                        else
                        {
                            Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                            ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + _value + "</td>";
                        }
                        Init(index, value);
                    }
                    else
                    {
                        _rowCount++;
                    }
            }
        }
Example #38
0
 protected bool IsEditValue(object container)
 {
     System.Web.UI.WebControls.RepeaterItem ri  = container as System.Web.UI.WebControls.RepeaterItem;
     MetricTrac.Bll.MetricValue.Extend      val = ri.DataItem as MetricTrac.Bll.MetricValue.Extend;
     return((DataMode == Mode.Input) ? val.CollectionEnabled : (val.Value != null));
 }
Example #39
0
        public void SetRowCheckBox(int index, string value, Repeater rpt, RepeaterItem item, string controlId, string checkBoxId)
        {
            if (this._value == null)
            {
                Init(index, value);
                if (_total == 1)
                {
                    Literal ltr = (Literal)item.FindControl(controlId);
                    ltr.Text = " <td align=\"center\">" + "";

                    CheckBox chk = (CheckBox)item.FindControl(checkBoxId);
                    chk.Visible = chk.Enabled;
                }
            }
            else
            {
                if (index == _total - 1)
                {
                    if (value != this._value)
                    {
                        Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                        ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + "";
                        CheckBox chk = (CheckBox)rpt.Items[_index].FindControl(checkBoxId);
                        chk.Visible = chk.Enabled;

                        ltr = (Literal)item.FindControl(controlId);
                        ltr.Text = " <td align=\"center\">" + "";
                        chk = (CheckBox)item.FindControl(checkBoxId);
                        chk.Visible = chk.Enabled;
                    }
                    else
                    {
                        _rowCount++;
                        Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                        ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + "";

                        CheckBox chk = (CheckBox)rpt.Items[_index].FindControl(checkBoxId);
                        chk.Visible = chk.Enabled;
                    }
                }
                else
                    if (value != this._value)
                    {
                        Literal ltr = (Literal)rpt.Items[_index].FindControl(controlId);
                        ltr.Text = " <td align=\"center\" " + (_rowCount > 1 ? " rowspan=" + _rowCount : "") + ">" + "";
                        CheckBox chk = (CheckBox)rpt.Items[_index].FindControl(checkBoxId);
                        chk.Visible = chk.Enabled;
                        Init(index, value);
                    }
                    else
                    {
                        _rowCount++;
                    }
            }
        }
Example #40
0
 protected bool IsTotalMetric(object container)
 {
     System.Web.UI.WebControls.RepeaterItem ri  = container as System.Web.UI.WebControls.RepeaterItem;
     MetricTrac.Bll.MetricOrgValue          mmv = ri.DataItem as MetricTrac.Bll.MetricOrgValue;
     return(mmv.IsTotalAgg);
 }
        protected virtual void CreateControlHierarchy(bool useDataSource)
        {
            IEnumerable data          = null;
            int         dataItemCount = -1;

            if (this.itemsArray != null)
            {
                this.itemsArray.Clear();
            }
            else
            {
                this.itemsArray = new ArrayList();
            }
            if (!useDataSource)
            {
                dataItemCount = (int)this.ViewState["_!ItemCount"];
                if (dataItemCount != -1)
                {
                    data = new DummyDataSource(dataItemCount);
                    this.itemsArray.Capacity = dataItemCount;
                }
            }
            else
            {
                data = this.GetData();
                ICollection is2 = data as ICollection;
                if (is2 != null)
                {
                    this.itemsArray.Capacity = is2.Count;
                }
            }
            if (data != null)
            {
                int  itemIndex = 0;
                bool flag      = this.separatorTemplate != null;
                dataItemCount = 0;
                if (this.headerTemplate != null)
                {
                    this.CreateItem(-1, ListItemType.Header, useDataSource, null);
                }
                foreach (object obj2 in data)
                {
                    if (flag && (dataItemCount > 0))
                    {
                        this.CreateItem(itemIndex - 1, ListItemType.Separator, useDataSource, null);
                    }
                    ListItemType itemType = ((itemIndex % 2) == 0) ? ListItemType.Item : ListItemType.AlternatingItem;
                    RepeaterItem item     = this.CreateItem(itemIndex, itemType, useDataSource, obj2);
                    this.itemsArray.Add(item);
                    dataItemCount++;
                    itemIndex++;
                }
                if (this.footerTemplate != null)
                {
                    this.CreateItem(-1, ListItemType.Footer, useDataSource, null);
                }
            }
            if (useDataSource)
            {
                this.ViewState["_!ItemCount"] = (data != null) ? dataItemCount : -1;
            }
        }
Example #42
0
 public String UpdateRule(RepeaterItem rpItem, Boolean debugMode = false)
 {
     var strXml = GenXmlFunctions.GetGenXml(rpItem);
     // load into NBrigthInfo class, so it's easier to get at xml values.
     var objInfoIn = new NBrightInfo();
     objInfoIn.XMLData = strXml;
     UpdateRule(objInfoIn, debugMode);
     return ""; // if everything is OK, don't send a message back.
 }
Example #43
0
 MetricTrac.Bll.MetricValue.Extend GetValue(object container)
 {
     System.Web.UI.WebControls.RepeaterItem ri = container as System.Web.UI.WebControls.RepeaterItem;
     return(ri.DataItem as MetricTrac.Bll.MetricValue.Extend);
 }
Example #44
0
        private void SeleccionarNovedad(RepeaterItem selected)
        {
            try
            {
                ImageButton btn = new ImageButton();
                HtmlGenericControl divBlock;
                foreach (RepeaterItem ri in this.rptNovedades.Items)
                {
                    divBlock = (HtmlGenericControl) ri.FindControl("divContenedor");
                    if (divBlock != null)
                        btn = (ImageButton) divBlock.FindControl("imgButton");
                    //En el seleccionado le cambia el estilo
                    if (ri == selected)
                    {
                        if (divBlock != null)
                            divBlock.Attributes.Add("class", "block-select");
                        if (btn != null)
                        {
                            btn.ImageUrl = "~/img/button-news-active-wg.gif";
                            this.FillData(Convert.ToInt32(btn.CommandArgument));
                        }

                        Page.ClientScript.RegisterStartupScript(GetType(), "script", "changeCommentsUrl('" + btn.CommandArgument + "');", true);

                        this.fileUtility.SubFolder = "Noticias/" + btn.CommandArgument.ToString();
                        DataTable dt = this.fileUtility.FilesToDataTable();

                        DataRow[] foundRows = dt.Select("Extension = '.mp3'");
                        if (foundRows.Length > 0)
                        {
                            this.divAudio.Visible = true;
                            String link = this.Request.Url.Authority + this.fileUtility.PathVirtual + this.fileUtility.SubFolder;
                            link = link.Replace("//", "/");
                            link = "http://" + link;

                            RegisterJS(link + foundRows[0]["Name"].ToString());
                        }
                        else
                        {
                            this.divAudio.Visible = false;
                        }

                        foundRows = dt.Select("Extension = '.flv' OR Extension = '.mp4'");
                        if (foundRows.Length > 0)
                        {
                            this.divVideo.Visible = true;
                            String link = this.Request.Url.Authority + this.fileUtility.PathVirtual + this.fileUtility.SubFolder;
                            link = link.Replace("//", "/");
                            link = "http://" + link;

                            Page.ClientScript.RegisterStartupScript(GetType(), "script", "InitializeVideos('" + link + foundRows[0]["Name"].ToString() + "');", true);
                        }
                        else
                        {
                            this.divVideo.Visible = false;
                        }

                        foundRows = dt.Select("Extension <> '.flv' AND Extension <> '.mp3' AND Extension <> '.jpg' AND Extension <> '.bmp'" +
                                                                    " AND Extension <> '.png'" +
                                                                    " AND Extension <> '.gif'");
                        if (foundRows.Length > 0)
                        {
                            this.divOtrosArchivos.Visible = true;

                            this.rptArchivos.DataSource = foundRows;
                            this.rptArchivos.DataBind();
                        }
                        else
                        {
                            this.divOtrosArchivos.Visible = false;
                        }

                        foundRows = dt.Select("Extension = '.jpg' OR Extension = '.bmp' OR Extension = '.png' OR Extension = '.gif'");
                        if (foundRows.Length > 0)
                        {
                            String link = this.Request.Url.Authority + this.fileUtility.PathVirtual + this.fileUtility.SubFolder;
                            link = link.Replace("//", "/");
                            link = "http://" + link;

                            this.divImage.Visible = true;
                            this.divImage.Attributes.Add("style", "width:" + 204 * foundRows.Length + "px;");

                            this.litImage.Text = "";
                            for (int i = 0; i < foundRows.Length; i++)
                            {
                                this.litImage.Text +=
                                    "<a class=\"fancybox-thumb\" rel=\"fancybox-thumb\" href=\"" + link + foundRows[i]["Name"].ToString() + "\" title=\"Foto Foto Foto Foto\"> " +
                                    "<img src=\"" + link + foundRows[i]["Name"].ToString() + "\" style=\" height: 150px;\"  alt=\"\" /></a>";
                            }
                        }
                        else
                        {
                            this.divImage.Visible = false;
                            this.litImage.Text = "";
                        }
                    }
                    else //Establece el estilo sin seleccionar
                    {
                        if (divBlock != null)
                            divBlock.Attributes.Add("class", "block");
                        if (btn != null)
                            btn.ImageUrl = "~/img/button-news-inactive.gif";
                    }
                }
            }
            catch (Exception ex)
            {

            }
        }
Example #45
0
 public RepeaterCommandEventArgs(RepeaterItem item, object commandSource, CommandEventArgs originalArgs) : base(originalArgs)
 {
     this.item          = item;
     this.commandSource = commandSource;
 }
 public RepeaterItemEventArgs(RepeaterItem item)
 {
     this.item = item;
 }
Example #47
0
        private void VisibleUnvisibleControl(bool value, RepeaterItem selectedRptItem)
        {
            ((Label)selectedRptItem.FindControl("lblLabourType")).Visible = !value;
            ((TextBox)selectedRptItem.FindControl("txtLabourType")).Visible = value;

            ((Label)selectedRptItem.FindControl("lblSector")).Visible = !value;
            ((DropDownList)selectedRptItem.FindControl("ddlSector")).Visible = value;

            ((Label)selectedRptItem.FindControl("lblIsVerify")).Visible = !value;
            ((CheckBox)selectedRptItem.FindControl("chkIsVerify")).Visible = value;
            ((Button)selectedRptItem.FindControl("btnEdit")).Visible = !value;
            ((Button)selectedRptItem.FindControl("btnDelete")).Visible = !value;
            if (((LinkButton)selectedRptItem.FindControl("lbtnInsert")).Visible == true)
            {
                ((LinkButton)selectedRptItem.FindControl("lbtnUpdate")).Visible = !value;
                //((Button)selectedRptItem.FindControl("btnDelete")).Visible = !value;
                ((LinkButton)selectedRptItem.FindControl("lbtnCancel")).Visible = value;
            }
            else
            {
                ((LinkButton)selectedRptItem.FindControl("lbtnUpdate")).Visible = value;
                //((Button)selectedRptItem.FindControl("btnDelete")).Visible = value;
                ((LinkButton)selectedRptItem.FindControl("lbtnCancel")).Visible = value;
            }
        }
Example #48
0
 public RepeaterItemEventArgs(RepeaterItem item)
 {
 }
 protected virtual new void InitializeItem(RepeaterItem item)
 {
 }
 protected void rptRequest_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         RequestItemRepeaterItem = e.Item;
         _presenter.BindRequestRow();
     }
     else if (e.Item.ItemType == ListItemType.Header)
     {
         RequestItemRepeaterItem = e.Item;
         SetGridHeaderCssClass();
     }
 }
 /// <devdoc>
 /// <para>Initializes a new instance of the <see cref='System.Web.UI.WebControls.RepeaterItemEventArgs'/> class.</para>
 /// </devdoc>
 public RepeaterItemEventArgs(RepeaterItem item) {
     this.item = item;
 }
        private Utilities.ProfilesRNSDLL.BO.ORCID.PersonAffiliation GetAffiliationFromThePage(RepeaterItem ri)
        {
            // Get the controls for this item.
            DropDownList ddlEmpVis = (DropDownList)ri.FindControl("ddlEmpVis");

            Label lblProfilesID = (Label)ri.FindControl("lblProfilesID");
            Label lblAffiliationTypeID = (Label)ri.FindControl("lblAffiliationTypeID");
            Label lblDepartmentName = (Label)ri.FindControl("lblDepartmentName");
            Label lblRoleTitle = (Label)ri.FindControl("lblRoleTitle");
            Label lblStartDate = (Label)ri.FindControl("lblStartDate");
            Label lblEndDate = (Label)ri.FindControl("lblEndDate");
            Label lblOrganizationName = (Label)ri.FindControl("lblOrganizationName");
            Label lblOrganizationCity = (Label)ri.FindControl("lblOrganizationCity");
            Label lblOrganizationRegion = (Label)ri.FindControl("lblOrganizationRegion");
            Label lblOrganizationCountry = (Label)ri.FindControl("lblOrganizationCountry");
            Label lblDisambiguationID = (Label)ri.FindControl("lblDisambiguationID");
            Label lblDisambiguationSource = (Label)ri.FindControl("lblDisambiguationSource");

            Utilities.ProfilesRNSDLL.BO.ORCID.PersonAffiliation personAffiliation = new Utilities.ProfilesRNSDLL.BO.ORCID.PersonAffiliation();
            personAffiliation.DecisionID = int.Parse(ddlEmpVis.SelectedValue.ToString());
            personAffiliation.ProfilesID = int.Parse(lblProfilesID.Text);
            personAffiliation.AffiliationTypeID = int.Parse(lblAffiliationTypeID.Text);
            if (!lblDepartmentName.Text.Equals(string.Empty))
            {
                personAffiliation.DepartmentName = lblDepartmentName.Text;
            }
            personAffiliation.RoleTitle = lblRoleTitle.Text;
            if (!lblStartDate.Text.Equals(string.Empty))
            {
                personAffiliation.StartDate = DateTime.Parse(lblStartDate.Text);
            }
            if (!lblEndDate.Text.Equals(string.Empty))
            {
                personAffiliation.EndDate = DateTime.Parse(lblEndDate.Text);
            }
            personAffiliation.OrganizationName = lblOrganizationName.Text;
            if (!lblOrganizationCity.Text.Equals(string.Empty))
            {
                personAffiliation.OrganizationCity = lblOrganizationCity.Text;
            }
            if (!lblOrganizationRegion.Text.Equals(string.Empty))
            {
                personAffiliation.OrganizationRegion = lblOrganizationRegion.Text;
            }
            if (!lblOrganizationCountry.Text.Equals(string.Empty))
            {
                personAffiliation.OrganizationCountry = lblOrganizationCountry.Text;
            }

            if (!lblDisambiguationID.Text.Equals(string.Empty))
            {
                personAffiliation.DisambiguationID = lblDisambiguationID.Text;
                personAffiliation.DisambiguationSource = lblDisambiguationSource.Text;
            }
            return personAffiliation;
        }
Example #53
0
 protected int GetElementType(object container)
 {
     System.Web.UI.WebControls.RepeaterItem ri  = container as System.Web.UI.WebControls.RepeaterItem;
     MetricTrac.Bll.MetricValue.Extend      val = ri.DataItem as MetricTrac.Bll.MetricValue.Extend;
     return(val.MetricDataTypeID);
 }
Example #54
0
 protected string SetItem(RepeaterItem repeaterItem)
 {
     Item = repeaterItem.DataItem as PropertyMap;
     return string.Empty;
 }
 public RepeaterCommandEventArgs(RepeaterItem item, Object commandSource, CommandEventArgs originalArgs) : base (default(CommandEventArgs))
 {
 }
Example #56
0
 MetricTrac.Bll.MetricOrgValue GetMetric(object container)
 {
     System.Web.UI.WebControls.RepeaterItem ri = container as System.Web.UI.WebControls.RepeaterItem;
     return(ri.DataItem as MetricTrac.Bll.MetricOrgValue);
 }