public string Save(DAL.Entity.StockIn stockIn) { string message = ""; bool itemExist = stockInGateway.DoesItemExist(stockIn.ItemId); if (itemExist) { int rowAffected = stockInGateway.Update(stockIn); if (rowAffected > 0) { message = "Saved Successfully"; } else { message = "Could not be saved"; } } else { int rowAffected = stockInGateway.Save(stockIn); if (rowAffected > 0) { message = "Saved Successfully"; } else { message = "Could not be saved"; } } return(message); }