public RequestResponse Insert(string password, string path) { RequestResponse r = new RequestResponse(); Shop s = Converts.ToShop(this, password); //generalDB.Shops.Add(s); //MessageBox.Show("befor you have "+generalDB.MyDb.Shops.Count()); s = resetCode(s); generalDB.MyDb.Shops.Add(s); //TODO: להעביד אותו חזרה try { generalDB.MyDb.SaveChanges(); } catch (Exception e) { MessageBox.Show(e.InnerException.Message); } //MessageBox.Show("after you have "+generalDB.MyDb.Shops.Count()); s = generalDB.MyDb.Shops.ToList().Last(); dtoShop dtos = Converts.ToDtoShop(s); if (dtos.Connections != null && dtos.Connections.Count > 0) { WriteDistanceMatrix(s, path); } dtos.Connections = new List <dtoConnection>(); r.Data = dtos; return(r); }
public dtoShop(Shop s) { dtoShop s2 = new dtoShop(); s2.Code = s.Code; s2.NameShop = s.NameShop; s2.NameShop = s.NameShop; }