Example #1
0
        public WebControl CreateControl(TemplateField field, DataRowView rowInPage, IDictionary <TemplateField, int> fieldIndices)
        {
#if trueWWW
            DateTime data = (DateTime)rowInPage.Row.ItemArray[fieldIndices[field]];
            var      text = data.ToString(new CultureInfo("ru-RU"));
#else
            var text = string.Format(field.Format.Provider, field.Format.FormatString, rowInPage.Row.ItemArray[fieldIndices[field]]);
            text = CellControlNewAttributes.GetDateTimeValue(text, field);
#endif

            if (EntityInstance != null)
            {
                if (EntityInstance.EntityInstanceID == rowInPage["objID"].ToString() && EntityInstance.SelfColumnsValue != null)
                {
                    foreach (var colValue in EntityInstance.SelfColumnsValue)
                    {
                        if (colValue.Key == field.Attribute.FPath)
                        {
                            //text = colValue.Value.ToString("g", new CultureInfo("ru-RU"));
                            text = CellControlNewAttributes.GetDateTimeValue(colValue.Value, field);
                        }
                    }
                }
            }

            TextBox TextBox;
            TextBox = new TextBox
            {
                ID       = field.Attribute.FPath + "TableCellDateTextBox" + field.Order.ToString() + rowInPage.Row.ItemArray[0],
                ReadOnly = false,
                //Height = Unit.Pixel(15),
                BorderWidth = Unit.Pixel(0),
                Text        = text
            };
            TextBox.Attributes.Add("onchange", "getTableCellControlsData()");
            TextBox.Attributes.Add("attributeName", field.Attribute.FPath);
            TextBox.Attributes.Add("class", "AlternativeRow");
            TextBox.Attributes.Add("type", "date");
            return(TextBox);
        }
Example #2
0
        public WebControl CreateControl(TemplateField field, DataRowView rowInPage, IDictionary <TemplateField, int> fieldIndices)
        {
            var text = string.Format(field.Format.Provider, field.Format.FormatString, rowInPage.Row.ItemArray[fieldIndices[field]]);

            text = CellControlNewAttributes.GetNumberValue(text);

            if (EntityInstance != null)
            {
                if (EntityInstance.EntityInstanceID == rowInPage["objID"].ToString() && EntityInstance.SelfColumnsValue != null)
                {
                    foreach (var colValue in EntityInstance.SelfColumnsValue)
                    {
                        if (colValue.Key == field.Attribute.FPath)
                        {
                            text = CellControlNewAttributes.GetNumberValue(colValue.Value);
                        }
                    }
                }
            }

            TextBox TextBox;

            TextBox = new TextBox
            {
                ID       = field.Attribute.FPath + "TableCellContorl" + field.Order.ToString() + rowInPage.Row.ItemArray[0],
                ReadOnly = false,
                //Height = Unit.Pixel(15),
                BorderWidth = Unit.Pixel(0),
                Text        = text
            };
            TextBox.Attributes.Add("onkeyup", "getTableCellControlsData()");
            TextBox.Attributes.Add("attributeName", field.Attribute.FPath);
            TextBox.Attributes.Add("class", "AlternativeRow");
            TextBox.Attributes.Add("type", "number");
            return(TextBox);
        }