Пример #1
0
        public string GetEditFieldJson()
        {
            var data = DataSearchSource.Select("CoreSource > 0");

            if (data.Any())
            {
                return(JsonConvert.SerializeObject(data.CopyToDataTable()));
            }
            return("");
        }
Пример #2
0
        public async Task EditField(DataRow row)
        {
            var data = DataSearchSource.Select("CoreSource > 0");

            if (data.Any())
            {
                foreach (DataRow item in data)
                {
                    if (item["CoreSource"].ToString().Length == 2)
                    {
                        item["CoreSource"] = item["CoreSource"].ToString().Replace("4", "");
                    }
                    else
                    {
                        item["CoreSource"] = "0";
                    }
                }
            }
            row["CoreSource"] = "4" + row["CoreSource"];
        }
Пример #3
0
 public async Task SaveField()
 {
     if (RowEdit == null && DataSearchSource != null)
     {
         var row = DataSearchSource.NewRow();
         foreach (var item in Field.FieldChilds)
         {
             row[item.FieldName.ToLower()] = item.Value;
         }
         row["CoreSource"] = 1;
         DataSearchSource.Rows.Add(row);
         DataSearchSource.AcceptChanges();
     }
     else
     {
         foreach (var item in Field.FieldChilds)
         {
             RowEdit[item.FieldName.ToLower()] = item.Value;
         }
         RowEdit["CoreSource"] = 2;
     }
     Field.Value = GetEditFieldJson();
 }