public void SaveItem(ItemModel itemModel, IHostingEnvironment hostingEnvironment) { Item item = new Item(); item.ItemName = itemModel.ItemName; item.ItemStatus = itemModel.ItemStatus; item.UnitName = itemModel.UnitName; item.UnitPrice = itemModel.UnitPrice; string uniqueFileName = null; if (itemModel.File != null) { string uploadFolder = Path.Combine(hostingEnvironment.WebRootPath, "upload"); uniqueFileName = Guid.NewGuid().ToString() + "_" + itemModel.File.FileName; string filePath = Path.Combine(uploadFolder, uniqueFileName); itemModel.File.CopyTo(new FileStream(filePath, FileMode.Create)); } item.ImagePath = uniqueFileName; ItemDL itemDL = new ItemDL(); itemDL.SaveItem(item); }
public ItemBL() { itemDL = new ItemDL(); }
public Item GetItemByID(Guid itemID) { ItemDL itemDL = new ItemDL(); return(itemDL.GetItemByID(itemID)); }
public void DeleteItem(Guid itemID) { ItemDL itemDL = new ItemDL(); itemDL.DeleteItem(itemID); }
public void DeleteItem(Guid Id) { ItemDL DL = new ItemDL(); DL.DeleteItem(Id); }
public void UpdateItem(string Name, string Desc, double Price, Guid Id) { ItemDL DL = new ItemDL(); DL.UpdateItem(Name, Desc, Price, Id); }
public void InsertItem(string Name, string Desc, double Price) { ItemDL DL = new ItemDL(); DL.InsertItem(Name, Desc, Price); }
public List <ItemBL> ListAllItem() { ItemDL DL = new ItemDL(); return(DL.ListAll()); }