예제 #1
0
        public bool CreateStore()
        {
            Stream req = Request.InputStream;

            req.Seek(0, System.IO.SeekOrigin.Begin);
            string json     = new StreamReader(req).ReadToEnd();
            var    store    = JsonConvert.DeserializeObject <Dictionary <string, string> >(json);
            Store  newStore = new Store();

            if (store.ContainsKey("Name") && "" != store["Name"])
            {
                newStore.Name = store["Name"];
            }
            else
            {
                return(false);
            }
            if (store.ContainsKey("Address"))
            {
                newStore.Address = store["Address"];
            }
            return(storeDAL.AddStore(newStore));
        }
예제 #2
0
 public int Create(Store store)
 {
     return(objStore.AddStore(store));
 }
예제 #3
0
 public Store Post(Store store)
 {
     return(ObjectStore.AddStore(store));
 }