예제 #1
0
파일: dtoShop.cs 프로젝트: ilana10/rep5
        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);
        }
예제 #2
0
파일: dtoShop.cs 프로젝트: ilana10/rep5
        public dtoShop(Shop s)
        {
            dtoShop s2 = new dtoShop();

            s2.Code     = s.Code;
            s2.NameShop = s.NameShop;
            s2.NameShop = s.NameShop;
        }