Exemplo n.º 1
0
        /// <Summary>Creates a TextColumnTemplate</Summary>
        /// <Returns>A TextColumnTemplate</Returns>
        private TextColumnTemplate CreateTemplate( ListItemType type )
        {
            bool isDesignMode = false;
            if (HttpContext.Current == null)
            {
                isDesignMode = true;
            }

            TextColumnTemplate template = new TextColumnTemplate(type);
            if (type != ListItemType.Header)
            {
                template.DataField = DataField;
            }
            template.Width = Width;

            if (type == ListItemType.Header)
            {
                template.Text = this.HeaderText;
            }
            else
            {
                template.Text = Text;
            }

            template.DesignMode = isDesignMode;

            return template;
        }
Exemplo n.º 2
0
		public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
		{
			base.InitializeCell(cell, columnIndex, itemType);

			Control bindCtrl = null;
			Control toAdd    = null;
			switch(itemType)
			{
				case ListItemType.Item : goto case ListItemType.SelectedItem;
				case ListItemType.AlternatingItem
				                       : goto case ListItemType.SelectedItem;
				case ListItemType.SelectedItem
				                       : if(DataField.Length != 0)
				                         	bindCtrl = cell;
				                         break;
				case ListItemType.EditItem
					                   : if(!ReadOnly)
					                     {
					                     	TextBox box = new TextBox();
								toAdd = box;
								if(DataField.Length != 0)
									bindCtrl = box;
							     } else 
								     goto case ListItemType.SelectedItem;

					                     break;
			}
			if(toAdd != null)
				cell.Controls.Add(toAdd);
			if(bindCtrl != null)
				bindCtrl.DataBinding += new EventHandler(OnDataBindColumn);
			//throw new NotImplementedException();
		}
Exemplo n.º 3
0
		public override void InitializeCell (TableCell cell, int columnIndex, ListItemType itemType)
		{
			base.InitializeCell (cell, columnIndex, itemType);
			ITemplate t = null;
			switch (itemType) {
			case ListItemType.Header:
				t = HeaderTemplate;
				break;
			case ListItemType.Footer:
				t = FooterTemplate;
				break;
			case ListItemType.Item:
			case ListItemType.AlternatingItem:
			case ListItemType.SelectedItem:
				t = ItemTemplate;
				if (t == null)
					cell.Text = "&nbsp;";
				break;
			case ListItemType.EditItem:
				t = EditItemTemplate;
				if (t == null)
					t = ItemTemplate;
				if (t == null)
					cell.Text = "&nbsp;";
				break;
			}
			
			if (t != null)
				t.InstantiateIn (cell);
		}
Exemplo n.º 4
0
        /// <summary>
        /// Overridden to replace the button with a confirmed button
        /// </summary>
        public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
        {
            base.InitializeCell(cell, columnIndex, itemType);

            if ( itemType != ListItemType.Footer && itemType != ListItemType.Header ) {
                WebControl theButton = null;
                if ( this.ButtonType == ButtonColumnType.LinkButton ) {
                    ConfirmedLinkButton theLinkButton = new ConfirmedLinkButton();
                    theLinkButton.Text = this.Text;
                    theLinkButton.CommandName = this.CommandName;
                    theLinkButton.CausesValidation = false;
                    theLinkButton.Message = this.Message;
                    theLinkButton.ID = theLinkButton.ClientID;
                    theButton = theLinkButton;
                } else {
                    ConfirmedButton theNormalButton = new ConfirmedButton();
                    theNormalButton.Text = this.Text;
                    theNormalButton.CommandName = this.CommandName;
                    theNormalButton.CausesValidation = false;
                    theNormalButton.Message = this.Message;
                    theNormalButton.ID = theNormalButton.ClientID;
                    theButton = theNormalButton;
                }

                if (this.DataTextField.Length != 0) {
                    theButton.DataBinding += new EventHandler( OnDataBindColumn );
                }

                cell.Controls.Clear();
                cell.Controls.Add(theButton);
            }
        }
        public LanguagesTemplateDropDown(ListItemType type, string colName, CultureTypes types)
        {
            this.templateType = type;

            // this.columnName = colName;
            this.cultureTypes = types;
        }
 //Parameterised Constructor
 public CreateItemTemplate(ListItemType item,string lectureID,string date,string text)
 {
     myListItemType = item;
     this.lectureID = lectureID;
     this.date = date;
     this.text = text;
 }
Exemplo n.º 7
0
		public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
		{
			base.InitializeCell(cell, columnIndex, itemType);
			if (Enum.IsDefined(typeof(ListItemType), itemType) &&
			    itemType != ListItemType.Footer &&
			    itemType != ListItemType.Header)
			{
				WebControl toDisplay = null;
				if(ButtonType == ButtonColumnType.PushButton)
				{
					Button b = new Button();
					b.Text = Text;
					b.CommandName = CommandName;
					b.CausesValidation = false;
					toDisplay = b;
				} else
				{
					LinkButton lb = new DataGridLinkButton();
					lb.Text = Text;
					lb.CommandName = CommandName;
					lb.CausesValidation = false;
					toDisplay = lb;
				}
				if(DataTextField.Length > 0)
				{
					toDisplay.DataBinding += new EventHandler(OnDataBindButtonColumn);
				}
				cell.Controls.Add(toDisplay);
			}
		}
 public GridViewTemplate(ListItemType itemType, string headerName, string typeName, EnumInfoType infoType)
 {
     this.itemType = itemType;
     this.headerName = headerName;
     this.typeName = typeName;
     this.infoType = infoType;
 }
 public GridViewTemplate(ListItemType itemType, string fieldName,int longitud, EnumInfoType infoType)
 {
     this.itemType = itemType;
     this.fieldName = fieldName;
     this.longitud = longitud;
     this.infoType = infoType;
 }
 public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
 {
     base.InitializeCell(cell, columnIndex, itemType);
     if ((itemType != ListItemType.Header) && (itemType != ListItemType.Footer))
     {
         WebControl child = null;
         if (this.ButtonType == ButtonColumnType.LinkButton)
         {
             LinkButton button = new DataGridLinkButton {
                 Text = this.Text,
                 CommandName = this.CommandName,
                 CausesValidation = this.CausesValidation,
                 ValidationGroup = this.ValidationGroup
             };
             child = button;
         }
         else
         {
             Button button2 = new Button {
                 Text = this.Text,
                 CommandName = this.CommandName,
                 CausesValidation = this.CausesValidation,
                 ValidationGroup = this.ValidationGroup
             };
             child = button2;
         }
         if (this.DataTextField.Length != 0)
         {
             child.DataBinding += new EventHandler(this.OnDataBindColumn);
         }
         cell.Controls.Add(child);
     }
 }
Exemplo n.º 11
0
 public ScrollDataGrid(Label lblcol, string colnameval, int colnoval, ListItemType itype)
 {
     lbl = lblcol;
     colname = colnameval;
     colno = colnoval;
     itemtype = itype;
 }
 public DownloadColumnTemplate (string id, string caption, ListItemType itemType) {
     mobjTemplateType = itemType;
     mstrID = id;
     mstrCaption = caption;
     if (mstrCaption == string.Empty) {
         mstrCaption = "Download";
     }
 }
Exemplo n.º 13
0
 protected override void RenderItem(ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer)
 {
     ListItem listItem = this.Items[repeatIndex];
     if (_UnderlyingCheckbox != null) {
         _UnderlyingCheckbox.InputAttributes["value"] = listItem.Value;
     }
     base.RenderItem(itemType, repeatIndex, repeatInfo, writer);
 }
Exemplo n.º 14
0
			protected override Style GetItemStyle (ListItemType itemType, int repeatIndex)
			{
				Style s = new Style ();
				s.BackColor = Color.Red;
				s.BorderStyle = BorderStyle.Solid;
				WebTest.CurrentTest.UserData = "GetItemStyle";
				return s;
			}
		protected override RepeaterItem CreateItem(int itemIndex, ListItemType itemType) {
			if (itemType == ListItemType.Item || itemType == ListItemType.AlternatingItem) { //Plus others??
				RowIdRepeaterItem item = new RowIdRepeaterItem(itemIndex, itemType);
				item.DataBinding += new EventHandler(item_DataBinding);
				return item;
			} else {
				return base.CreateItem (itemIndex, itemType);
			}
		}
 /// <summary>
 /// 
 /// </summary>
 /// <param name="mode">Tells us if we're in edit or display mode</param>
 /// <param name="type">The type of special control we're adding</param>
 /// <param name="colname">The display name of the column</param>
 /// <param name="id">The ID of the control we're adding</param>
 /// <param name="ddlds">A list of the values we want to bind to the created control</param>
 /// <param name="isReadOnly">True if this column is read only, false otherwise</param>
 /// <param name="isNumeric">True if this column is numeric, false otherwise</param>
 public HPMGridViewTemplate(ListItemType mode, HPMGridViewTemplateType type, string colname, string id, Dictionary<UInt32, string> ddlds, bool isReadOnly, bool isNumeric)
 {
     m_Mode = mode;
     m_ColumnName = colname;
     m_ID = id;
     m_Type = type;
     m_Ddlds = ddlds;
     m_IsReadOnly = isReadOnly;
     m_IsNumeric = isNumeric;
 }
        public void AddList(string[] listItems, ListItemType itemType)
        {
            var list = this.document.AddList(null, 0, itemType);
            foreach (var item in listItems)
            {
                this.document.AddListItem(list, item);
            }

            this.document.InsertList(list);
        }
 public SummaryGridCommandColumn(ListItemType itemType, List<UserAction> options = null)
 {
     this.itemType = itemType;
     this.options = new List<UserAction>();
     this.options.Add(UserAction.View);
     this.options.Add(UserAction.Insert);
     this.options.Add(UserAction.Delete);
     this.options.Add(UserAction.Multiple);
     if (options != null)
         this.options = options;
 }
        public DynamicFormViewTemplate(ListItemType type, DataColumnCollection dccol, bool showEdit)
        {
            _type = type;
            _dccol = dccol;
            ShowEdit = showEdit;
            _iEditTabOrder = 0;

            DataSourceTypeName = new List<string>();
            DataSourceSelectMethod = new List<string>();
            DropDownListColumns = new List<string>();
            DropDownValueField	= new List<string>();
            DropDownTextField	= new List<string>();
            DropDownDataSource	= new List<object>();
        }
Exemplo n.º 20
0
        /// <summary>
        /// Agrega una nueva columna de plantilla al objeto DataGrid
        /// </summary>
        /// <param name="MyDataGrid">Objeto DataGrid a modificar</param>
        /// <param name="myDatatable">Objeto DataTable con los datos</param>
        /// <param name="nombreColumna">Nombre de la columna a incluir</param>
        /// <param name="control">Control a insertar en la nueva columna</param>
        /// <param name="tipo_item">Tipo de control a insertar en la columna</param>
        /// <remarks>
        /// <list> Creado: Diciembre 10 de 2013 - Ing. David Alejandro Pineda Diaz </list>
        /// </remarks>
        public static void addItemColumnToGrid(ref DataGrid MyDataGrid, DataTable myDatatable, string nombreColumna, System.Web.UI.Control control, ListItemType tipo_item)
        {
            try
            {
                TemplateColumn columna = new TemplateColumn();
                columna.HeaderTemplate = new DataGridTemplate(ListItemType.Header, nombreColumna);
                columna.ItemTemplate = new DataGridTemplate(tipo_item, control);
                MyDataGrid.Columns.Add(columna);
                updateGrid(ref MyDataGrid, myDatatable);

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
 {
     base.InitializeCell(cell, columnIndex, itemType);
     if ((itemType != ListItemType.Header) && (itemType != ListItemType.Footer))
     {
         HyperLink child = new HyperLink {
             Text = this.Text,
             NavigateUrl = this.NavigateUrl,
             Target = this.Target
         };
         if ((this.DataNavigateUrlField.Length != 0) || (this.DataTextField.Length != 0))
         {
             child.DataBinding += new EventHandler(this.OnDataBindColumn);
         }
         cell.Controls.Add(child);
     }
 }
        public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
        {
            base.InitializeCell(cell, columnIndex, itemType);
            Control child = null;
            Control control2 = null;
            switch (itemType)
            {
                case ListItemType.Item:
                case ListItemType.AlternatingItem:
                case ListItemType.SelectedItem:
                    break;

                case ListItemType.EditItem:
                {
                    if (this.ReadOnly)
                    {
                        break;
                    }
                    TextBox box = new TextBox();
                    child = box;
                    if (this.boundField.Length != 0)
                    {
                        control2 = box;
                    }
                    goto Label_005F;
                }
                default:
                    goto Label_005F;
            }
            if (this.DataField.Length != 0)
            {
                control2 = cell;
            }
        Label_005F:
            if (child != null)
            {
                cell.Controls.Add(child);
            }
            if (control2 != null)
            {
                control2.DataBinding += new EventHandler(this.OnDataBindColumn);
            }
        }
Exemplo n.º 23
0
 protected override void RenderItem(ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo,
     HtmlTextWriter writer)
 {
     if (Items[repeatIndex].Value.Equals("%subheader%"))
     {
         writer.Write("<h3 class=\'shipsrvc\'>{0}</h3>", Items[repeatIndex].Text);
     }
     else
     {
         if (Items[repeatIndex].Value.Equals("%msg%"))
         {
             writer.Write("<h4 class=\'shipsrvcmsg\'>{0}</h4>", Items[repeatIndex].Text);
         }
         else
         {
             base.RenderItem(itemType, repeatIndex, repeatInfo, writer);
         }
     }
 }
        public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
        {
            base.InitializeCell(cell, columnIndex, itemType);
            ITemplate itemTemplate = null;
            switch (itemType)
            {
                case ListItemType.Header:
                    itemTemplate = this.headerTemplate;
                    goto Label_0057;

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

                case ListItemType.Item:
                case ListItemType.AlternatingItem:
                case ListItemType.SelectedItem:
                    break;

                case ListItemType.EditItem:
                    if (this.editItemTemplate == null)
                    {
                        break;
                    }
                    itemTemplate = this.editItemTemplate;
                    goto Label_0057;

                default:
                    goto Label_0057;
            }
            itemTemplate = this.itemTemplate;
        Label_0057:
            if (itemTemplate != null)
            {
                cell.Text = string.Empty;
                itemTemplate.InstantiateIn(cell);
            }
            else if (((itemType == ListItemType.Item) || (itemType == ListItemType.AlternatingItem)) || ((itemType == ListItemType.SelectedItem) || (itemType == ListItemType.EditItem)))
            {
                cell.Text = "&nbsp;";
            }
        }
 public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
 {
     base.InitializeCell(cell, columnIndex, itemType);
     bool causesValidation = this.CausesValidation;
     if ((itemType != ListItemType.Header) && (itemType != ListItemType.Footer))
     {
         if (itemType == ListItemType.EditItem)
         {
             ControlCollection controls = cell.Controls;
             this.AddButtonToCell(cell, "Update", this.UpdateText, causesValidation, this.ValidationGroup);
             LiteralControl child = new LiteralControl("&nbsp;");
             controls.Add(child);
             this.AddButtonToCell(cell, "Cancel", this.CancelText, false, string.Empty);
         }
         else
         {
             this.AddButtonToCell(cell, "Edit", this.EditText, false, string.Empty);
         }
     }
 }
		public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
		{
			base.InitializeCell(cell, columnIndex, itemType);
			
			if (itemType == ListItemType.Header || itemType == ListItemType.Footer)
				return;
			
			if (itemType == ListItemType.EditItem) {
				cell.Controls.Add (MakeButton ("Update", UpdateText));
				cell.Controls.Add (new LiteralControl ("&nbsp;"));
				cell.Controls.Add (MakeButton ("Cancel", CancelText));
			} else {
				cell.Controls.Add (MakeButton ("Edit", EditText));
			}
		}
		public void RenderItem (ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer)
		{
			writer.Write ("({0},{1},{2})", counter++, itemType, repeatIndex);
		}
Exemplo n.º 28
0
 public RepeaterItem(int itemIndex, ListItemType itemType)
 {
     this.itemIndex = itemIndex;
     this.itemType  = itemType;
 }
Exemplo n.º 29
0
 public DataListItem(int itemIndex, ListItemType itemType)
 {
     index = itemIndex;
     type  = itemType;
 }
Exemplo n.º 30
0
 public DGridTemplete(ListItemType type, string chbName)
 {
     _templateType = type;
     _chbName      = chbName;
 }
Exemplo n.º 31
0
 public ReorderListItem(object dataItem, int index, ListItemType itemType) : this(index)
 {
     _dataItem = dataItem;
     _itemType = itemType;
 }
Exemplo n.º 32
0
 public void RenderItem(ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Exemplo n.º 33
0
 void IRepeatInfoUser.RenderItem(ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer)
 {
     RenderItem(itemType, repeatIndex, repeatInfo, writer);
 }
Exemplo n.º 34
0
        private void dgBasicJobs_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            ListItemType itemType = e.Item.ItemType;

            if (itemType == ListItemType.Item || itemType == ListItemType.AlternatingItem || itemType == ListItemType.SelectedItem)
            {
                string jobIdText = ((HtmlInputHidden)e.Item.FindControl("hidJobId")).Value;

                try
                {
                    int jobId = Convert.ToInt32(jobIdText);

                    if (jobId > 0)
                    {
                        DataRowView dataItem = (DataRowView)e.Item.DataItem;
                        eJobState   jobState = (eJobState)Enum.Parse(typeof(eJobState), e.Item.Cells[2].Text.Replace(" ", ""), true);

                        e.Item.BackColor = Utilities.GetJobStateColour(jobState);

                        if (jobState == eJobState.Booked || jobState == eJobState.Planned || jobState == eJobState.InProgress)
                        {
                            Facade.IJob facJob = new Facade.Job();
                            ((HtmlImage)e.Item.FindControl("imgRequiresCallIn")).Visible = facJob.RequiresCallIn(jobId);
                        }
                        else
                        {
                            ((HtmlImage)e.Item.FindControl("imgRequiresCallIn")).Visible = false;
                        }

                        HtmlImage imgHasRequests = (HtmlImage)e.Item.FindControl("imgHasRequests");
                        if (((int)dataItem.Row["Requests"]) == 0)
                        {
                            imgHasRequests.Visible = false;
                        }
                        else
                        {
                            imgHasRequests.Visible = true;
                            imgHasRequests.Attributes.Add("onClick", "javascript:ShowPlannerRequests('" + jobId.ToString() + "');");
                        }

                        Table tblCollections = (Table)e.Item.FindControl("tblCollections");

                        DataView dvCollections = new DataView(m_dsJobsData.Tables[1]);
                        foreach (DataRow collection in dvCollections.Table.Rows)
                        {
                            if ((int)collection["JobId"] == jobId)
                            {
                                // This is a collection for the current job
                                ArrayList rows = CreateTableRows(collection);
                                foreach (TableRow row in rows)
                                {
                                    tblCollections.Rows.Add(row);
                                }
                            }
                        }

                        Table tblDeliveries = (Table)e.Item.FindControl("tblDeliveries");

                        DataView dvDeliveries = new DataView(m_dsJobsData.Tables[2]);
                        foreach (DataRow delivery in dvDeliveries.Table.Rows)
                        {
                            if ((int)delivery["JobId"] == jobId)
                            {
                                // This is a collection for the current job
                                ArrayList rows = CreateTableRows(delivery);
                                foreach (TableRow row in rows)
                                {
                                    tblDeliveries.Rows.Add(row);
                                }
                            }
                        }
                    }
                }
                catch (Exception exc)
                {
                    string error = exc.Message;
                }
            }
        }
Exemplo n.º 35
0
 Style System.Web.UI.WebControls.IRepeatInfoUser.GetItemStyle(ListItemType itemType, int repeatIndex)
 {
     return(default(Style));
 }
Exemplo n.º 36
0
        internal static List CreateItemInList(List list, string listText, int level = 0, ListItemType listType = ListItemType.Numbered, int?startNumber = null, bool trackChanges = false, bool continueNumbering = false)
        {
            if (list.NumId == 0)
            {
                list.CreateNewNumberingNumId(level, listType, startNumber, continueNumbering);
            }

            if (listText != null) //I see no reason why you shouldn't be able to insert an empty element. It simplifies tasks such as populating an item from html.
            {
                var newParagraphSection = new XElement
                                          (
                    XName.Get("p", DocX.w.NamespaceName),
                    new XElement(XName.Get("pPr", DocX.w.NamespaceName),
                                 new XElement(XName.Get("numPr", DocX.w.NamespaceName),
                                              new XElement(XName.Get("ilvl", DocX.w.NamespaceName), new XAttribute(DocX.w + "val", level)),
                                              new XElement(XName.Get("numId", DocX.w.NamespaceName), new XAttribute(DocX.w + "val", list.NumId)))),
                    new XElement(XName.Get("r", DocX.w.NamespaceName), new XElement(XName.Get("t", DocX.w.NamespaceName), listText))
                                          );

                if (trackChanges)
                {
                    newParagraphSection = CreateEdit(EditType.ins, DateTime.Now, newParagraphSection);
                }

                if (startNumber == null)
                {
                    list.AddItem(new Paragraph(list.Document, newParagraphSection, 0, ContainerType.Paragraph));
                }
                else
                {
                    list.AddItemWithStartValue(new Paragraph(list.Document, newParagraphSection, 0, ContainerType.Paragraph), (int)startNumber);
                }
            }

            return(list);
        }
Exemplo n.º 37
0
 public void RenderItem(ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer)
 {
     writer.Write((counter++).ToString());
 }
Exemplo n.º 38
0
 public Style GetItemStyle(ListItemType itemType, int repeatIndex)
 {
     return(null);
 }
 //- @Ctor -//
 public LinearTemplate(params Object[] parameterArray)
 {
     type         = ((ListItemType)parameterArray[0]);
     listCssClass = ((String)parameterArray[1]);
 }
 // Constructors
 public DataListItem(int itemIndex, ListItemType itemType)
 {
 }
Exemplo n.º 41
0
 protected virtual Style GetItemStyle(ListItemType itemType, int repeatIndex)
 {
     return(null);
 }
Exemplo n.º 42
0
        internal static List CreateItemInList(List list, string listText, int level = 0, ListItemType listType = ListItemType.Numbered, int?startNumber = null, bool trackChanges = false)
        {
            if (list.NumId == 0)
            {
                list.CreateNewNumberingNumId(level, listType);
            }

            if (!string.IsNullOrEmpty(listText))
            {
                var newParagraphSection = new XElement
                                          (
                    XName.Get("p", DocX.w.NamespaceName),
                    new XElement(XName.Get("pPr", DocX.w.NamespaceName),
                                 new XElement(XName.Get("numPr", DocX.w.NamespaceName),
                                              new XElement(XName.Get("ilvl", DocX.w.NamespaceName), new XAttribute(DocX.w + "val", level)),
                                              new XElement(XName.Get("numId", DocX.w.NamespaceName), new XAttribute(DocX.w + "val", list.NumId)))),
                    new XElement(XName.Get("r", DocX.w.NamespaceName), new XElement(XName.Get("t", DocX.w.NamespaceName), listText))
                                          );

                if (trackChanges)
                {
                    newParagraphSection = CreateEdit(EditType.ins, DateTime.Now, newParagraphSection);
                }

                if (startNumber == null)
                {
                    list.AddItem(new Paragraph(list.Document, newParagraphSection, 0, ContainerType.Paragraph));
                }
                else
                {
                    list.AddItemWithStartValue(new Paragraph(list.Document, newParagraphSection, 0, ContainerType.Paragraph), (int)startNumber);
                }
            }

            return(list);
        }
Exemplo n.º 43
0
 public Style GetItemStyle(ListItemType itemType, int repeatIndex)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Exemplo n.º 44
0
 public void SetType(ListItemType type)
 {
     base.SetItemType(type);
 }
Exemplo n.º 45
0
        private void dgJobs_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            ListItemType itemType = e.Item.ItemType;

            if (itemType == ListItemType.Item || itemType == ListItemType.AlternatingItem || itemType == ListItemType.SelectedItem)
            {
                string jobIdText = ((HtmlInputHidden)e.Item.FindControl("hidJobId")).Value;

                try
                {
                    int jobId = Convert.ToInt32(jobIdText);

                    if (jobId > 0)
                    {
                        DataRowView dataItem = (DataRowView)e.Item.DataItem;
                        eJobState   jobState = (eJobState)Enum.Parse(typeof(eJobState), e.Item.Cells[2].Text.Replace(" ", ""), true);
                        eJobType    jobType  = (eJobType)Enum.Parse(typeof(eJobType), e.Item.Cells[3].Text.Replace(", ", ""), true);

                        e.Item.BackColor = Utilities.GetJobStateColour(jobState);

                        if (jobState == eJobState.Booked || jobState == eJobState.Planned || jobState == eJobState.InProgress)
                        {
                            Facade.IJob facJob = new Facade.Job();
                            ((HtmlImage)e.Item.FindControl("imgRequiresCallIn")).Visible = facJob.RequiresCallIn(jobId);
                        }
                        else
                        {
                            ((HtmlImage)e.Item.FindControl("imgRequiresCallIn")).Visible = false;
                        }

                        HtmlAnchor lnkEditJob = (HtmlAnchor)e.Item.FindControl("lnkEditJob");
                        switch (jobType)
                        {
                        case eJobType.Normal:
                            lnkEditJob.HRef = "javascript:openResizableDialogWithScrollbars('../job/wizard/wizard.aspx?jobId=" + jobId.ToString() + "', '623', '508');";
                            break;

                        case eJobType.PalletReturn:
                            lnkEditJob.HRef = "../job/addupdatepalletreturnjob.aspx?jobId=" + jobId.ToString();
                            break;

                        case eJobType.Return:
                            lnkEditJob.HRef = "../job/addupdategoodsreturnjob.aspx?jobId=" + jobId.ToString();
                            break;

                        default:
                            lnkEditJob.Visible = false;
                            break;
                        }

                        // Configure the toggle ownership button
                        CheckBox chkOwnership = (CheckBox)e.Item.FindControl("chkOwnership");
                        bool     isMyJob      = ((int)dataItem.Row["DoesOwn"] == 1);
                        chkOwnership.Checked = isMyJob;

                        HtmlImage imgHasRequests = (HtmlImage)e.Item.FindControl("imgHasRequests");
                        if (((int)dataItem.Row["Requests"]) == 0)
                        {
                            imgHasRequests.Visible = false;
                        }
                        else
                        {
                            imgHasRequests.Visible = true;
                            imgHasRequests.Attributes.Add("onClick", "javascript:ShowPlannerRequests('" + jobId.ToString() + "');");
                        }

                        Table tblCollections = (Table)e.Item.FindControl("tblCollections");

                        DataView dvCollections = new DataView(m_dsJobsData.Tables[1]);
                        foreach (DataRow collection in dvCollections.Table.Rows)
                        {
                            if ((int)collection["JobId"] == jobId)
                            {
                                // This is a collection for the current job
                                ArrayList rows = CreateTableRows(collection);
                                foreach (TableRow row in rows)
                                {
                                    tblCollections.Rows.Add(row);
                                }
                            }
                        }

                        Table tblDeliveries = (Table)e.Item.FindControl("tblDeliveries");

                        DataView dvDeliveries = new DataView(m_dsJobsData.Tables[2]);
                        foreach (DataRow delivery in dvDeliveries.Table.Rows)
                        {
                            if ((int)delivery["JobId"] == jobId)
                            {
                                // This is a collection for the current job
                                ArrayList rows = CreateTableRows(delivery);
                                foreach (TableRow row in rows)
                                {
                                    tblDeliveries.Rows.Add(row);
                                }
                            }
                        }
                    }
                }
                catch (Exception exc)
                {
                    string error = exc.Message;
                }
            }
        }
Exemplo n.º 46
0
 public TestDataListItem(int index, ListItemType type)
     : base(index, type)
 {
 }
Exemplo n.º 47
0
 public DynamicallyTemplatedGridViewHandler(ListItemType item_type, string field_name, string control_type)
 {
     ItemType  = item_type;
     FieldName = field_name;
     InfoType  = control_type;
 }
		public new string RenderItem (ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo)
		{
			HtmlTextWriter writer = new HtmlTextWriter (new StringWriter ());
			base.RenderItem(itemType,repeatIndex,repeatInfo,writer);
			return writer.InnerWriter.ToString ();
		}
Exemplo n.º 49
0
 protected virtual void SetItemType(ListItemType itemType)
 {
     type = itemType;
 }
Exemplo n.º 50
0
 public DataGridTemplate(ListItemType type, string colname, string ctlname)
 {
     templateType = type;
     columnName   = colname;
     controlName  = ctlname;
 }
Exemplo n.º 51
0
 protected virtual DataListItem CreateItem(int itemIndex, ListItemType itemType)
 {
     return(new DataListItem(itemIndex, itemType));
 }
Exemplo n.º 52
0
 protected static Style GetItemStyle(ListItemType itemType, int repeatIndex)
 {
     return(null);
 }
 public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
 {
 }
 public RecursiveRepeaterTemplate(ListItemType type)
 {
     templateType = type;
 }
		public Style DoGetItemStyle (ListItemType itemType, int repeatIndex)
		{
			return base.GetItemStyle (itemType, repeatIndex);
		}
Exemplo n.º 56
0
 public CheckBoxColumnTemplate(ListItemType itemType)
 {
     ItemType = itemType;
 }
Exemplo n.º 57
0
 void System.Web.UI.WebControls.IRepeatInfoUser.RenderItem(ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, System.Web.UI.HtmlTextWriter writer)
 {
 }
Exemplo n.º 58
0
 Style IRepeatInfoUser.GetItemStyle(ListItemType itemType, int repeatIndex)
 {
     return(GetItemStyle(itemType, repeatIndex));
 }
Exemplo n.º 59
0
 // Constructors
 public RepeaterItem(int itemIndex, ListItemType itemType)
 {
 }
Exemplo n.º 60
0
 public void SetToolTipInfo(ListItemType type, int id)
 {
     mType   = type;
     mItemId = id;
 }