예제 #1
0
 public ActionResult Edit([Bind(Include = "Guid,Name,Description,Address,City,State,Zipcode,PhoneNumber,EmailAddress,Logo,LogoName,DateCreated,Active")] tbl_Stores tbl_Stores)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_Stores).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "Items", new { guid = tbl_Stores.Guid }));
     }
     return(View(tbl_Stores));
 }
예제 #2
0
 public void SaveStore(tbl_Stores store)
 {
     using (var connection = new SqlConnection(Configuration.ConnectionString))
     {
         if (store.StoreID == 0)
         {
             connection.Insert(store);
         }
         else
         {
             connection.Update(store);
         }
     }
 }
예제 #3
0
        // GET: Stores/Edit/5
        public ActionResult Edit(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_Stores tbl_Stores = db.tbl_Stores.Find(id);

            if (tbl_Stores == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_Stores));
        }
예제 #4
0
        public ActionResult Create([Bind(Include = "Guid,Name,Description,Address,City,State,Zipcode,PhoneNumber,EmailAddress,Logo,LogoName,DateCreated,Active")] tbl_Stores tbl_Stores)
        {
            if (ModelState.IsValid)
            {
                tbl_Stores.Guid        = Guid.NewGuid();
                tbl_Stores.DateCreated = DateTime.Now;
                tbl_Stores.Active      = true;
                db.tbl_Stores.Add(tbl_Stores);
                db.SaveChanges();
                return(RedirectToAction("Index", "Items", new { guid = tbl_Stores.Guid }));
            }

            return(View(tbl_Stores));
        }
예제 #5
0
    public static bool SaveStore(string id, string name, string status)
    {
        InventoryBL bl    = new InventoryBL();
        tbl_Stores  Store = new tbl_Stores()
        {
            Store_Id     = Convert.ToInt32(id),
            Store_Name   = name,
            Store_Status = status == "1" ? true : false
        };

        if (!bl.ValidateStore(Store))
        {
            bool result = bl.SaveStore(Store);
            return(result);
        }
        return(false);
    }