using System.Collections.Generic;
using WK_KLI_LAPS_Service.App_Data;

namespace WK_KLI_LAPS_Service.Controllers.Configuration.Outline
{

    public interface IOutlineConfigurationService
    {
        object GetAll();
        object GetActiveOutline();
        object Add(string inputstr, string mode);
        object Edit(string inputstr, string mode);
        object Delete(string inputstr, string mode);
        IEnumerable<object> getOutlineByoutlineconfigId(int outlineconfigId);
        object HeaderMapping(string inputstr, string mode);
        IEnumerable<object> getOutlineDetailByoutlineconfigId(int outlineconfigId);
    }
    public class OutlineConfigurationService : IOutlineConfigurationService
    {
        CommonRepository oCommonRepository = new CommonRepository();
        //code to retrieve list of all records
        public object GetAll()
        {
            return oCommonRepository.ExecuteSP_ReturnList("spoutlineconfigdetail", null, "getall");
        }

        //code to retrieve list of active records
        public object GetActiveOutline()
        {
            return oCommonRepository.ExecuteSP_ReturnList("spoutlineconfigdetail", null, "getall");
        }

        //Code to add data
        public object Add(string inputstr, string mode)
        {
            var retval = oCommonRepository.ExecuteSP_ReturnList("spoutlineconfigdetail", inputstr, mode);
            return retval;
        }

        //code to update data
        public object Edit(string inputstr, string mode)
        {
            var retval = oCommonRepository.ExecuteSP_ReturnList("spoutlineconfigdetail", inputstr, mode);
            return retval;
        }

        //code to activate or deactivate record
        public object Delete(string inputstr, string mode)
        {

            var retval = oCommonRepository.ExecuteSP_ReturnList("spoutlineconfigdetail", inputstr, mode);
            return retval;
        }

        public IEnumerable<object> getOutlineByoutlineconfigId(int outlineconfigId)
        {
            return oCommonRepository.getOutlineByoutlineconfigId(outlineconfigId);
        }
        //code to activate or deactivate record
        public object HeaderMapping(string inputstr, string mode)
        {

            var retval = oCommonRepository.ExecuteSP_ReturnList("spoutlineconfigdetail", inputstr, mode);
            return retval;
        }

        public IEnumerable<object> getOutlineDetailByoutlineconfigId(int outlineconfigId)
        {
            return oCommonRepository.getOutlineDetailByoutlineconfigId(outlineconfigId);
        }

    }
}