示例#1
0
        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);
        }
        public string Save(StockIn stockIn)
        {
            int rowAffected = stockInGateway.Save(stockIn);

            if (rowAffected > 0)
            {
                return("Stock in saved successfully");
            }
            return("Stock in saved failed");
        }
示例#3
0
        public string Save(Item item, int itemId)
        {
            int rowAffect = stockInGateway.Save(item, itemId);

            if (rowAffect > 0)
            {
                return("Save successful");
            }
            else
            {
                return("Save failed");
            }
        }
        public string Save(StockInModel stockInModel)
        {
            int rowAfftet = stockInGateway.Save(stockInModel);

            if (rowAfftet > 0)
            {
                return("Save Successful");
            }
            else
            {
                return("Save failed");
            }
        }
        public string Save(StockIn stockIn)
        {
            int rowAffect = stockInGateway.Save(stockIn);

            if (rowAffect > 0)
            {
                return("Save Successful");
            }
            else
            {
                return("Save Failed. Please Check Your Input");
            }
        }
示例#6
0
        public string Save(StockIn stockIn)
        {
            int rowAffect = stockInGateway.Save(stockIn);

            if (rowAffect > 0)
            {
                return("Item stored successfully! ");
            }
            else
            {
                return("Failed to store item!");
            }
        }
示例#7
0
        // update available quantity by stock in
        public string UpdateAvailableQuantityByItemIdAndCompany(StockIn stockIn, int totalQuantity)
        {
            // update available quantity item
            int rowAffected = itemGateway.UpdateAvailableQuantityByItemIdAndCompany(stockIn, totalQuantity);
            int rowAffectedOnStockInTable = stockInGateway.Save(stockIn);

            if (rowAffected > 0 && rowAffectedOnStockInTable > 0)
            {
                return("Stock In Successfull");
            }
            else
            {
                return("Stock In Failed");
            }
        }
 public string Save(StockIn stockIn)
 {
     if (stockIn.Quantity <= 0)
     {
         return("Item Quantity can not be zero and must be positive number");
     }
     else if (stockInGateway.Save(stockIn) > 0)
     {
         return("Stock In Successfully");
     }
     else
     {
         return("Stock In Failed");
     }
 }