обновление бд
namespace Test_project
{
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.Spatial;
public partial class order_accounting_teh
{
[Key]
[Column("Номер_заказа ", Order = 0)]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public int Номер_заказа_ { get; set; }
[Key]
[Column("Ед.изм.", Order = 1)]
[StringLength(100)]
public string Ед_изм_ { get; set; }
[Key]
[Column("Дата выдачи сырья", Order = 2, TypeName = "date")]
public DateTime Дата__выдачи_сырья { get; set; }
[Column("Дата изменения", TypeName = "date")]
public DateTime? Дата_изменения { get; set; }
[Key]
[Column(Order = 3)]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public int П_П { get; set; }
[Key]
[Column("Обозначение/Наименование", Order = 4)]
[StringLength(255)]
public string Обозначение_Наименование { get; set; }
[Key]
[Column("Наименование сырья", Order = 5)]
[StringLength(255)]
public string Наименование_сырья { get; set; }
[Key]
[Column("Кол-во,шт", Order = 6)]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public int Кол_во_шт { get; set; }
[Column("Номер заказчика")]
public int? Номер_заказчика { get; set; }
}
}
public IEnumerable<string> SafeEnumerateFiles(string path, string searchPattern, SearchOption searchOption)
{
Stack<string> dirs = new Stack<string>();
dirs.Push(path);
while (dirs.Count > 0)
{
string currentDirPath = dirs.Pop();
if (searchOption == SearchOption.AllDirectories)
{
try
{
string[] subDirs = Directory.GetDirectories(currentDirPath);
foreach (string subDirPath in subDirs)
{
if ((File.GetAttributes(subDirPath) & (FileAttributes.Hidden | FileAttributes.System)) != (FileAttributes.Hidden | FileAttributes.System))
{
dirs.Push(subDirPath);
}
}
}
catch (UnauthorizedAccessException)
{
continue;
}
catch (DirectoryNotFoundException)
{
continue;
}
}
string[] files = null;
try
{
files = Directory.GetFiles(currentDirPath, searchPattern);
}
catch (UnauthorizedAccessException)
{
continue;
}
catch (DirectoryNotFoundException)
{
continue;
}
foreach (string filePath in files)
{
yield return filePath;
}
}
}