public void InsertWareHouse(string[] strArray) { using (var context = new MesEntities()) { var WareHouses = context.Set <WareHouse>(); WareHouses.Add(new WareHouse { WareHouseId = Convert.ToInt32(strArray[0]), AreaSize = Convert.ToInt32(strArray[1]), EmployeeId = Convert.ToInt32(strArray[2]), PhoneNumber = strArray[3], }); context.SaveChanges(); } }
public void InsertOrder(string[] strArray) { // insert using (var context = new MesEntities()) { var orders = context.Set <Order>(); orders.Add(new Order { OrderId = Convert.ToInt32(strArray[0]), ResourceId = Convert.ToInt32(strArray[1]), Date = Convert.ToDateTime(strArray[2]), EmployeeId = Convert.ToInt32(strArray[3]), Quantity = Convert.ToInt32(strArray[4]), SellerName = strArray[5] }); context.SaveChanges(); } }
public void InsertEmployee(List <string> list) { // insert using (var context = new MesEntities()) { var orders = context.Set <Employee>(); orders.Add(new Employee { EmployeeId = Convert.ToInt32(list[0]), Name = list[1], Position = list[2], BossId = Convert.ToInt32(list[3]), Address = list[4], PhoneNumber = list[5], Team = list[6], Password = list[7] }); context.SaveChanges(); } }