Пример #1
0
        private void ProcessUpdateValues(List <ASPxDataUpdateValues> updateValues)
        {
            foreach (ASPxDataUpdateValues updateInfo in updateValues)
            {
                SampleData item = ModelRepository.GetData().Find(i => i.ID == Convert.ToInt32(updateInfo.Keys[0]));
                item.Text = Convert.ToString(updateInfo.NewValues["Text"]);

                DateAmountMap dateAmountMap = JsonConvert.DeserializeObject <DateAmountMap>(item.AmountDateMap);

                foreach (string fieldName in updateInfo.NewValues.Keys)
                {
                    DateFieldParts dateFieldParts = DateFieldParts.GetDateFieldParts(fieldName);
                    if (dateFieldParts != null)
                    {
                        dateAmountMap.SetDateAmount(dateFieldParts, Convert.ToDouble(updateInfo.NewValues[fieldName]));
                    }
                }

                item.AmountDateMap = JsonConvert.SerializeObject(dateAmountMap);
            }
        }
Пример #2
0
 protected void Grid_DataBinding(object sender, EventArgs e)
 {
     Grid.DataSource = ModelRepository.GetData();
     AddColumns();
 }