Пример #1
0
        public ActionResult ReportCategoryWiseSaleProfitLoss(string companyId, string branchId, string categoryId, string subCategoryId, string supplierId, string productId, string productCode, string dateFrom, string dateTo)
        {
            try
            {
                var dataSet = _rawSqlService.GetCategoryWiseSaleProfitLoss(companyId, branchId, supplierId, categoryId, subCategoryId, productId, productCode, dateFrom, dateTo);
                return(View(dataSet));
            }
            catch (Exception ex)
            {
                return(JavaScript($"ShowResult('{ex.Message}','failure')"));
            }

            //try
            //{
            //    if (!string.IsNullOrEmpty(dateFrom))
            //    {
            //        DateTime? dfrom = Convert.ToDateTime(dateFrom);
            //        dfrom = new DateTime(dfrom.Value.Year, dfrom.Value.Month, dfrom.Value.Day, 0, 0, 0);
            //        dateFrom = dfrom.Value.ToString(CultureInfo.InvariantCulture);
            //    }
            //    if (!string.IsNullOrEmpty(dateTo))
            //    {
            //        DateTime? dto = Convert.ToDateTime(dateTo);
            //        dto = new DateTime(dto.Value.Year, dto.Value.Month, dto.Value.Day, 23, 59, 59);
            //        dateTo = dto.Value.ToString(CultureInfo.InvariantCulture);
            //    }
            //    IEnumerable<SuperShopSaleViewModel> sales = new List<SuperShopSaleViewModel>();
            //    if (!string.IsNullOrEmpty(companyId))
            //    {
            //        sales = Mapper.Map<IEnumerable<SuperShopSaleViewModel>>(_rawSqlService.GetCategoryWiseSaleProfitLoss(companyId, branchId, supplierId, categoryId, subCategoryId, productId, productCode, dateFrom, dateTo));
            //    }
            //    return View(sales);
            //}
            //catch (Exception ex)
            //{
            //    return JavaScript($"ShowResult('{ex.Message}','failure')");
            //}
        }