public List <SupplierHistoryEntity> GetAllSalesInvoiceJson(string JsonData, bool?ExcincTax)
        {
            string ignored = string.Empty;
            List <SupplierHistoryEntity> InvoiceList       = new List <SupplierHistoryEntity>();
            SupplierHistoryEntity        InvoiceList1      = new SupplierHistoryEntity();
            List <SupplierHistoryEntity> InvoiceListReturn = new List <SupplierHistoryEntity>();

            if (JsonData != null)
            {
                var objResponse1 = JsonConvert.DeserializeObject <List <SearchEntity> >(JsonData);
                InvoiceList = entities.Database.SqlQuery <SupplierHistoryEntity>("USP_GetSuppliersHistory @year,@Quarter,@IncGST",
                                                                                 new SqlParameter("year", Convert.ToInt32(objResponse1[0].FieldValue)),
                                                                                 new SqlParameter("Quarter", Convert.ToInt32(objResponse1[1].FieldValue)),
                                                                                 new SqlParameter("IncGST", ExcincTax)).ToList();
            }
            else
            {
                ignored = JsonConvert.SerializeObject(JsonData,
                                                      Formatting.Indented,
                                                      new JsonSerializerSettings {
                    NullValueHandling = NullValueHandling.Ignore
                });
                InvoiceList = entities.Database.SqlQuery <SupplierHistoryEntity>("USP_GetSuppliersHistory @year,@Quarter,@IncGST",
                                                                                 new SqlParameter("year", Convert.ToInt32(0)),
                                                                                 new SqlParameter("Quarter", Convert.ToInt32(0)),
                                                                                 new SqlParameter("IncGST", ExcincTax)).ToList();
            }



            return(InvoiceList);
        }
        public List <SupplierHistoryEntity> GetAllSalesInvoiceJson(string JsonData, bool?ExcincTax)
        {
            var objResponse1 = JsonConvert.DeserializeObject <List <SearchEntity> >(JsonData);
            List <SupplierHistoryEntity> InvoiceList       = new List <SupplierHistoryEntity>();
            SupplierHistoryEntity        InvoiceList1      = new SupplierHistoryEntity();
            List <SupplierHistoryEntity> InvoiceListReturn = new List <SupplierHistoryEntity>();

            InvoiceList = entities.Database.SqlQuery <SupplierHistoryEntity>("USP_GetSuppliersHistory @year,@Quarter,@IncGST",
                                                                             new SqlParameter("year", Convert.ToInt32(objResponse1[0].FieldValue)),
                                                                             new SqlParameter("Quarter", Convert.ToInt32(objResponse1[1].FieldValue)),
                                                                             new SqlParameter("IncGST", ExcincTax)).ToList();


            return(InvoiceList);
        }