Exemple #1
0
        public bool EditPostReport(ReportVM r)
        {
            r.ModifiedBy   = 1;
            r.ModifiedDate = DateTime.Now;
            bool flag = false;

            if (r.ReportUrl == null)
            {
                r.ReportUrl = ExcellentMarketResearch.Areas.Admin.Models.Common.GenerateSlug(r.ReportTitle) + "-" + r.ReportId;
            }

            if (IsSameReportData(r))
            {
                JavaScriptSerializer serializer = new JavaScriptSerializer();
                var          report             = serializer.Serialize(r);
                ReportMaster repo = serializer.Deserialize <ReportMaster>(report);
                repo.LongDescritpion      = r.FullDescription;
                repo.SinglePrice          = r.PriceSingleUser;
                repo.MultiUserPrice       = r.PriceMultiUser;
                repo.CorporateUserPrice   = r.PriceCUL;
                repo.NumberOfPages        = r.NumberOfPage;
                repo.PublishereId         = r.PublisherId;
                repo.ReportDeliveryTypeId = r.DeliveryTypeId;
                db.Entry(repo).State      = EntityState.Modified;
                db.SaveChanges();
                flag = true;
            }
            else
            {
                flag = false;
            }
            return(flag);
        }
        public JsonResult GetSaleDetail(int id)
        {
            var sale = rpsale.Find(id);
            List <SaleDetailInfo> infoList = new List <SaleDetailInfo>();
            var detailList = rpsaledetails.GetListWithQuery(x => x.SaleID == sale.ID);

            foreach (var item in detailList)
            {
                var itemInfoList = rpsaledetailinfo.GetListWithQuery(x => x.SaleDetailID == item.ID);
                infoList.AddRange(itemInfoList);
            }

            List <string> imeiList = new List <string>();

            foreach (var item in infoList)
            {
                imeiList.Add(item.IMEI);
            }

            var vm = new ReportVM
            {
                PaymentType   = sale.PaymentType,
                SaleDate      = sale.AddDate.ToLongDateString(),
                SaleTime      = String.Format("{0:HH:mm}", sale.AddDate),
                AdminUserName = rpadminuser.Find(sale.UserID).FullName,
                InvoiceDate   = sale.InvoiceDate.Value.ToLongDateString(),
                ImeiList      = imeiList
            };

            return(Json(vm, JsonRequestBehavior.AllowGet));
        }
        public bool EditPostReport(ReportVM r)
        {
            r.ModifiedBy   = 1;
            r.ModifiedDate = DateTime.Now;
            bool flag = false;

            if (r.ReportUrl == null)
            {
                r.ReportUrl = ModernMarketResearch.Areas.Admin.Models.Common.GenerateSlug(r.ReportTitle) + "-" + r.ReportId;
            }

            if (IsSameReportData(r))
            {
                JavaScriptSerializer serializer = new JavaScriptSerializer();
                var          report             = serializer.Serialize(r);
                ReportMaster repo = serializer.Deserialize <ReportMaster>(report);
                db.Entry(repo).State = EntityState.Modified;
                db.SaveChanges();
                flag = true;
            }
            else
            {
                flag = false;
            }
            return(flag);
        }
Exemple #4
0
        // GET: ReportVM
        public ActionResult Report()
        {
            List <ReportVM> CustomerVMlist = new List <ReportVM>();

            var customerlist = (from Cust in db.Plaintiffs

                                join Ord in db.Cases on Cust.PlaintiffID equals Ord.PlaintiffID
                                join judg in db.CaseJudges on Ord.CaseID equals judg.CaseID
                                select new
            {
                Cust.PlaintiffID,
                Ord.CaseID,
                judg.CaseStatus
            }).ToList();

            foreach (var item in customerlist)

            {
                ReportVM objcvm = new ReportVM(); // ViewModel

                objcvm.PlaintiffID = item.PlaintiffID;

                objcvm.CaseID = item.CaseID;

                objcvm.CaseStatus = item.CaseStatus;

                CustomerVMlist.Add(objcvm);
            }

            return(View(CustomerVMlist));
        }
Exemple #5
0
        public ReportPage(Report report)
        {
            InitializeComponent();

            ViewModel      = new ReportVM(report);
            BindingContext = ViewModel;
            Title          = report.ClientName;

            ToolbarItems.Add(new ToolbarItem("Share", "share.png", async() => {
                var page   = new ContentPage();
                var result = await page.DisplayAlert("Share Report", "Would you like to share this report?", "Yes", "No");

                if (result)
                {
                    if (CrossConnectivity.IsSupported && CrossConnectivity.Current.IsConnected)
                    {
                        if (!await ViewModel.SendReportToServer(report))
                        {
                            await page.DisplayAlert("Oops!", "There was a problem sending the report to the server. Please try again", "OK");
                        }
                    }
                    else if (CrossConnectivity.IsSupported && !CrossConnectivity.Current.IsConnected)
                    {
                        await page.DisplayAlert("Connection Error", "It appears that you aren't connected to the internet. Please check your internet" +
                                                " connection and try again", "OK");
                    }
                }
            }));
        }
Exemple #6
0
        public async Task <IActionResult> CalculateAsync()
        {
            var            data    = JsonConvert.DeserializeObject <RequestHoursVM>((string)TempData["modelData"]);
            ReportVM       model   = null;
            RequestHoursAM request = new RequestHoursAM {
                Identification = data.Identification, Week = data.Week
            };
            var apiEndpoint = Configuration["ApiEndpoint"];
            var apiClient   = new HttpClient();

            HttpContent content  = new StringContent(JsonConvert.SerializeObject(request), Encoding.UTF8, "application/json");
            var         response = await apiClient.PostAsync(apiEndpoint + "/api/Report/CalculateHours", content);

            if (response.IsSuccessStatusCode)
            {
                var strJson = await response.Content.ReadAsStringAsync();

                var deserialize = JsonConvert.DeserializeObject <ReportAM>(strJson);
                model = new ReportVM
                {
                    NormalHours    = deserialize.NormalHours,
                    SundayHours    = deserialize.SundayHours,
                    NightHours     = deserialize.NightHours,
                    NormalOvertime = deserialize.NormalOvertime,
                    NightOvertime  = deserialize.NightOvertime,
                    SundayOvertime = deserialize.SundayOvertime
                };
            }

            return(View(model));
        }
        public void DeleteTest()
        {
            Report v = new Report();

            using (var context = new DataContext(_seed, DBTypeEnum.Memory))
            {
                v.Temperature = 36;
                context.Set <Report>().Add(v);
                context.SaveChanges();
            }

            PartialViewResult rv = (PartialViewResult)_controller.Delete(v.ID.ToString());

            Assert.IsInstanceOfType(rv.Model, typeof(ReportVM));

            ReportVM vm = rv.Model as ReportVM;

            v         = new Report();
            v.ID      = vm.Entity.ID;
            vm.Entity = v;
            _controller.Delete(v.ID.ToString(), null);

            using (var context = new DataContext(_seed, DBTypeEnum.Memory))
            {
                Assert.AreEqual(context.Set <Report>().Count(), 0);
            }
        }
Exemple #8
0
        public ActionResult EditMentorsReport(Guid id)
        {
            try
            {
                ReportVM reportVM = PLAutomapper.Mapper.Map <ReportVM>(_reportLogic.GetById(id));
                if (!reportVM.MentorsId.HasValue)
                {
                    return(new HttpStatusCodeResult(403));
                }

                int requestersId = int.Parse(User.Identity.Name);
                if (reportVM.MentorsId != requestersId)
                {
                    return(new HttpStatusCodeResult(403));
                }

                if (!reportVM.IsDraft)
                {
                    return(new HttpStatusCodeResult(404));
                }

                return(View(reportVM));
            }
            catch (Exception e)
            {
                _customLogger.RecordError(e);
                return(new HttpStatusCodeResult(500));
            }
        }
Exemple #9
0
 public int Save(ReportVM report)
 {
     report.ReportArName = new ArabicPrepocessor().StripArabicWords(report.ReportArName);
     report.ReportEnName = new ArabicPrepocessor().StripArabicWords(report.ReportEnName);
     report.ReportFrName = new ArabicPrepocessor().StripArabicWords(report.ReportFrName);
     return(_repo.Save(report));
 }
        public JsonResult DashboarData()
        {
            var NumberMessage = db.Chats.Where(h => h.IsSent == true).ToList();
            var Dateonly      = NumberMessage.Select(h => h.CreatedDate).Distinct();
            var Lecture       = db.Users.Where(h => h.Role.id == 2).ToList();
            // var MesageToLect = db.Chats.Where(h)
            var MessageLast7Days = new List <ReportVM>();

            foreach (var item in Dateonly)
            {
                var date = item.ToString();
                date = date.Substring(0, 10);
                ReportVM model = new ReportVM();
                model.DateString   = date;
                model.MessageCount = NumberMessage.Count(h => h.CreatedDate == item);
                MessageLast7Days.Add(model);
            }
            var LectCount = new List <LectMessageCountVM>();

            foreach (var item in Lecture)
            {
                var MessageToLect        = db.Chats.Where(h => h.ReceivePersonId == item.id && h.IsSent == true).ToList();
                LectMessageCountVM model = new LectMessageCountVM();
                model.Name  = item.Profile.Name;
                model.Count = MessageToLect.Count(h => h.ReceivePersonId == item.id);
                LectCount.Add(model);
            }
            Summary list = new Summary();

            list.Report  = MessageLast7Days;
            list.Lecture = LectCount;
            return(Json(list, JsonRequestBehavior.AllowGet));
        }
        public ActionResult AllClientReports(int reqId) // Gets all reports for a given request
        {
            var reports = _db.Reports.Where(r => r.RequestId == reqId);

            List <ReportVM> PageReports = new List <ReportVM>();

            foreach (var r in reports)
            {
                var tempRep = new ReportVM
                {
                    RequestNum = r.RequestId.ToString(),
                    Title      = r.Name,
                    BriefNotes = r.Notes.Substring(0, 25),
                    Date       = r.ReportDate,
                    RepId      = r.ProgressReportId
                };

                if (r.Notes.Length > tempRep.BriefNotes.Length)
                {
                    tempRep.BriefNotes += "...";
                }

                PageReports.Add(tempRep);
            }

            return(View(PageReports));
        }
Exemple #12
0
 public Report()
 {
     InitializeComponent();
     CurrentVM             = new ReportVM();
     CurrentVM.ViewService = (IAddReportViewService)this;
     DataContext           = CurrentVM;
 }
        public ActionResult ReportManager()
        {
            List <ReportVM> Report = new List <ReportVM>();

            var customerlist = (from plaintiff in db.Plaintiffs

                                join caselist in db.Cases on plaintiff.PlaintiffID equals caselist.PlaintiffID
                                join judg in db.CaseJudges on caselist.CaseID equals judg.CaseID
                                select new
            {
                plaintiff.PlaintiffID,
                caselist.CaseID,
                caselist.Date,
                caselist.CaseType,
                judg.CaseStatus,
                judg.JudgmentDate
            }).ToList();


            foreach (var item in customerlist)

            {
                ReportVM report = new ReportVM(); // ViewModel

                report.PlaintiffID  = item.PlaintiffID;
                report.CaseID       = item.CaseID;
                report.CaseRegDate  = item.Date;
                report.CaseType     = item.CaseType;
                report.CaseStatus   = item.CaseStatus;
                report.JudgmentDate = item.JudgmentDate;
                Report.Add(report);
            }

            return(View(Report));
        }
        public void EditTest()
        {
            Report v = new Report();

            using (var context = new DataContext(_seed, DBTypeEnum.Memory))
            {
                v.Temperature = 36;
                context.Set <Report>().Add(v);
                context.SaveChanges();
            }

            PartialViewResult rv = (PartialViewResult)_controller.Edit(v.ID.ToString());

            Assert.IsInstanceOfType(rv.Model, typeof(ReportVM));

            ReportVM vm = rv.Model as ReportVM;

            v    = new Report();
            v.ID = vm.Entity.ID;

            v.Temperature = 44;
            vm.Entity     = v;
            vm.FC         = new Dictionary <string, object>();

            vm.FC.Add("Entity.Temperature", "");
            _controller.Edit(vm);

            using (var context = new DataContext(_seed, DBTypeEnum.Memory))
            {
                var data = context.Set <Report>().FirstOrDefault();

                Assert.AreEqual(data.Temperature, 44);
            }
        }
Exemple #15
0
        public IActionResult Get([FromRoute] string orgRoleId, [FromRoute] string reportId)
        {
            if (string.IsNullOrWhiteSpace(orgRoleId) || string.IsNullOrEmpty(orgRoleId))
            {
                return(StatusCode(StatusCodes.Status400BadRequest,
                                  new BadRequestError($"'{nameof(orgRoleId)}' cannot be null or whitespace")));
            }

            if (string.IsNullOrWhiteSpace(reportId) || string.IsNullOrEmpty(reportId))
            {
                return(StatusCode(StatusCodes.Status400BadRequest,
                                  new BadRequestError($"'{nameof(reportId)}' cannot be null or whitespace")));
            }

            OrganizationRole organizationRole = organizationRoleService
                                                .Get <OrganizationRole>(orgRole => orgRole.Id == orgRoleId, asNoTracking: true);

            if (organizationRole == null)
            {
                return(StatusCode(StatusCodes.Status404NotFound, new NotFoundError($"organizationRole not found")));
            }

            ReportVM reportVM = reportService.Get <ReportVM>(
                report => report.Id == reportId,
                asNoTracking: true,
                r => r.CreatedBy);

            if (reportVM == null)
            {
                return(StatusCode(StatusCodes.Status404NotFound, new NotFoundError($"report not found")));
            }

            return(StatusCode(StatusCodes.Status200OK, reportVM));
        }
        public static ReportVM GetCorrectMentorsReportVM()
        {
            ReportVM report = GetCorrectInternsReportVM();

            report.MentorsId = 2;
            return(report);
        }
Exemple #17
0
        public ActionResult PaymentTypeWiseBankTransaction(ReportVM model)
        {
            ViewBag.Title = "Payment Wise Bank Transaction Report";
            logger.Info("Payment Wise Bank Transaction Report Access");
            if (!PermissionControl.CheckPermission(UserAppPermissions.PaymentTypeWiseBankTransactionReport_View))
            {
                logger.Info("Don't have rights to access Payment Wise Bank Transaction Report");
                return(RedirectToAction("Restricted", "Home"));
            }

            if (model != null)
            {
                DateTime frdate = DateTime.Now;
                if (!string.IsNullOrWhiteSpace(model.FromDate))
                {
                    frdate = DateTime.Parse(model.FromDate);
                }

                DateTime tdate = DateTime.Now;
                if (!string.IsNullOrWhiteSpace(model.ToDate))
                {
                    tdate = DateTime.Parse(model.ToDate);
                }

                if (string.IsNullOrEmpty(model.PaymentType))
                {
                    model.PaymentType = "ach,wire";
                }

                logger.DebugFormat("Getting Payment Wise Bank Transaction Report with From Date [{0}] and To Date [{1}] and Payment Type [{2}]", frdate.ToShortDateString(), tdate.ToShortDateString(), model.PaymentType);


                ReportViewer reportViewer = new ReportViewer();
                try
                {
                    ReportParameter rp = new ReportParameter("ReportDates", string.Format("Date: {0} - {1}", frdate.ToShortDateString(), tdate.ToShortDateString()));
                    reportViewer.ProcessingMode      = ProcessingMode.Local;
                    reportViewer.SizeToReportContent = true;
                    reportViewer.Width           = Unit.Percentage(100);
                    reportViewer.Height          = Unit.Percentage(100);
                    reportViewer.ZoomMode        = ZoomMode.Percent;
                    reportViewer.ShowZoomControl = true;
                    reportViewer.AsyncRendering  = false;
                    reportViewer.ShowPrintButton = true;

                    var data = bankTransactionManagement.PaymentTypeWiseBankTransaction(frdate, tdate, model.PaymentType);
                    reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + "/Reports/BankTransactionPaymentTypeWise.rdlc";
                    reportViewer.LocalReport.SetParameters(new ReportParameter[] { rp });
                    reportViewer.LocalReport.DataSources.Add(new ReportDataSource("BankTransactionPaymentTypeWise", data));
                }
                catch (Exception ex)
                {
                    logger.ErrorFormat("Exception Raised : Message[{0}] Stack Trace [{1}] ", ex.Message, ex.StackTrace);
                }
                ViewBag.ReportViewer = reportViewer;
                logger.Info("Payment Wise Bank Transaction Report Successfully Accessed");
            }
            return(View(model));
        }
Exemple #18
0
        public int Save(ReportVM report)
        {
            var _rep = (from rep in Context.Reports
                        where rep.ThemeID == report.ThemeID &&
                        string.IsNullOrEmpty(report.ReportEnName) || rep.ReportEnName == report.ReportEnName &&
                        string.IsNullOrEmpty(report.ReportArName) || rep.ReportArName == report.ReportArName &&
                        string.IsNullOrEmpty(report.ReportFrName) || rep.ReportFrName == report.ReportFrName &&
                        rep.ReportID != report.ReportID

                        select rep).FirstOrDefault();

            if (_rep != null)
            {
                return(0);
            }
            if (report.ReportID > 0)
            {
                _rep = (from th in Context.Reports
                        where th.ThemeID == report.ThemeID && th.ReportID == report.ReportID

                        select th).FirstOrDefault();
                _rep.ReportEnName = report.ReportEnName;
                _rep.ReportArName = report.ReportArName;
                _rep.ReportFrName = report.ReportFrName;
                _rep.Source       = report.Source;
                _rep.SourceAr     = report.SourceAr;
                _rep.SourceFr     = report.SourceFr;
                _rep.PublishYear  = report.PublishYear;
                _rep.ThemeID      = report.ThemeID;
                _rep.YearTo       = report.YearTo;
                Context.Reports.Attach(_rep);

                Context.Entry(_rep).State = EntityState.Modified;
            }
            else
            {
                Report repor = new Report
                {
                    ReportID     = report.ReportID,
                    ReportEnName = report.ReportEnName,
                    ReportArName = report.ReportArName,
                    ReportFrName = report.ReportFrName,
                    Source       = report.Source,
                    SourceAr     = report.SourceAr,
                    SourceFr     = report.SourceFr,

                    ThemeID            = report.ThemeID,
                    RunningVariableID  = report.RunningVariableID,
                    changingVariableID = report.changingVariableID,
                    YearTo             = report.YearTo
                };
                Context.Reports.Add(repor);
            }

            int affectedRows = Context.SaveChanges();

            return(affectedRows);
        }
Exemple #19
0
        public async Task <IActionResult> ReportMessageAsync(ReportVM report)
        {
            var reportDTO = mapper.Map <ReportDTO>(report);

            reportDTO.Reporter.Id = GetCurrentUserId();
            await messageService.ReportMessageAsync(reportDTO);

            return(NoContent());
        }
 public NewReportView()
 {
     InitializeComponent();
     CurrentVM              = new ReportVM();
     this.DataContext       = CurrentVM;
     SaveButton.IsEnabled   = false;
     TimeDatePicker.Text    = DateTime.Now.ToString();
     PredictionAndRealFalls = AssessmentAndlFallsVM.Instance;
 }
Exemple #21
0
        // GET: Report
        public ActionResult Index()
        {
            ReportVM report = new ReportVM();

            report.Carts        = db.Carts.ToList();
            report.Payouts      = db.PayOuts.ToList();
            report.Transactions = db.TransactionRecords.ToList();

            return(View(report));
        }
 public Information()
 {
     InitializeComponent();
     CurrentReportVM         = new ReportVM();
     CurrentFallPredictionVM = new AssessmentVM();
     DataContext             = this;
     fallLocation            = "";
     CalculatedLocation      = "";
     ReportsNumber           = 0;
 }
        public IActionResult Index()
        {
            var ReportVM = new ReportVM();

            ReportVM.ListEmployees = adamUnit.EmployeeRepository.GetAllInclude().ToList();
            ReportVM.ListCustomers = adamUnit.CustomerRepository.GetAll().Select(x => x.ToModel()).ToList();
            ReportVM.ListProjects  = adamUnit.ProjectRepository.GetAll().Select(x => x.ToModelRep()).ToList();
            ReportVM.ListTasks     = adamUnit.TaskRepository.GetAll().Select(x => x.ToModel()).ToList();
            return(View(ReportVM));
        }
Exemple #24
0
        public ActionResult PublisherRelatedReports(string puburl, int?pageno)
        {
            var pubreport = (from r in db.ReportMasters
                             join p in db.PublisherMasters on r.PublishereId equals p.PublisherId
                             join c in db.CategoryMasters on r.CategoryId equals c.CategoryId
                             where p.publisherUrl == puburl
                             orderby r.CreatedDate
                             select new ReportVM
            {
                ReportTitle = r.ReportTitle,
                ReportUrl = r.ReportUrl,
                CategoryId = r.CategoryId,
                CategoryName = c.CategoryName,
                ShortCatDesc = c.ShortDescription,
                LongCatDesc = c.LongDescription,
                PublisherName = p.ContactName,
                FullDescription = r.LongDescritpion.Substring(0, 300),
                PublishingDate = r.PublishingDate,
                PublisherId = r.PublishereId,
                CategoryUrl = c.CategoryUrl
            }).ToList();


            var pubrelatedreport = (from x in pubreport
                                    select new ReportVM
            {
                ReportTitle = x.ReportTitle,
                ReportUrl = x.ReportUrl,
                CategoryId = x.CategoryId,
                CategoryName = x.CategoryName,
                ShortCatDesc = x.ShortCatDesc,
                LongCatDesc = x.LongCatDesc,
                FullDescription = Regex.Replace(x.FullDescription, @"<[^>]+>|&nbsp;", "").Trim(),
                PublishingDate = x.PublishingDate,
                PublisherId = x.PublisherId,
                PublisherName = x.PublisherName,
                CategoryUrl = x.CategoryUrl,
                ReportImage = DDLGetparents(x.CategoryId)
            }).ToPagedList(pageno ?? 1, 10);


            ReportVM reportvm = new ReportVM();

            reportvm = (from p in db.PublisherMasters
                        where p.publisherUrl == puburl
                        select new ReportVM
            {
                LongPublisherDesc = p.LongDescription,
                ShortPublisherDesc = p.ShortDescription
            }).FirstOrDefault();
            //ViewBag.ShortPubDesc = reportvm.ShortPublisherDesc;
            //ViewBag.LongPubDesc = reportvm.LongPublisherDesc;
            return(View(pubrelatedreport));
        }
        public Information(Fall CurrentFall)
        {
            InitializeComponent();
            CurrentReportVM         = new ReportVM();
            CurrentFallPredictionVM = new AssessmentVM();
            Location_ Assessmentlocation = GetAssessmentLocationOfFall(CurrentFall);

            DataContext        = this;
            fallLocation       = CurrentFall.location.latitude.ToString() + " " + "," + " " + CurrentFall.location.longitude.ToString();
            CalculatedLocation = Assessmentlocation.latitude.ToString() + " " + "," + " " + Assessmentlocation.longitude.ToString();
            ReportsNumber      = CalculateReportNumber(CurrentFall);
        }
Exemple #26
0
        public static bool IsExistWithSameTitleAndSameDate(ReportVM reportVM)
        {
            SearchModel searchVM = new SearchModel()
            {
                Title     = reportVM.Title,
                DateTo    = reportVM.Date,
                DateFrom  = reportVM.Date,
                InternsId = reportVM.InternsId,
                MentorsId = reportVM.MentorsId
            };

            return(_reportLogic.SearchForValidation(searchVM).Any());
        }
Exemple #27
0
        private void ReportPreview(ReportVM report)
        {
            if (_selectedReport == null)
            {
                return;
            }

            reoGrid.Save($"{Funs.StoreFolder}/temp.xlsx");
            var dataRows = LoadDataRow($"{Funs.StoreFolder}/temp.xlsx", reoGrid.CurrentWorksheet.Name);

            _report.RegisterData(dataRows, "DataRows");
            _designer.InitReport();
            _designer.cmdPreview.Invoke();
        }
        public void InsertReport(ReportVM r)
        {
            r.CreatedBy   = 1;
            r.CreatedDate = DateTime.Now;
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            var          s  = serializer.Serialize(r);
            ReportMaster re = serializer.Deserialize <ReportMaster>(s);

            db.ReportMasters.Add(re);
            db.SaveChanges();
            re.ReportUrl       = re.ReportUrl + "-" + re.ReportId;
            db.Entry(re).State = EntityState.Modified;
            db.SaveChanges();
        }
        public ActionResult Report()
        {
            var UserRole = CheckUser();

            if (UserRole == 1)
            {
                var _reoprtVM = new ReportVM();
                return(View(_reoprtVM));
            }
            else
            {
                return(RedirectToAction("Login"));
            }
        }
        public JsonResult GetProductDetails(int id)
        {
            var    expiry    = rpsupplierexpiry.Find(id);
            var    product   = rpproduct.Find(expiry.ProductID);
            string trademark = rptrademark.Find(product.TradeMarkID).Name;
            string model     = rpproductmodel.Find(product.ProductModelID).Name;
            var    pro       = new ReportVM()
            {
                Quantity = expiry.ProductCount,
                Price    = Calculate(product, expiry.ProductCount),
                Note     = trademark + " " + model
            };

            return(Json(pro, JsonRequestBehavior.AllowGet));
        }