public ActionResult Copy(ReportCopyViewModel vm)//header id
        {
            if (ModelState.IsValid)
            {
                List <ReportLine> temp = _ReportLineService.GetReportLineList(vm.CopyHeaderId).ToList();

                foreach (var item in temp)
                {
                    ReportLine line = new ReportLine();
                    line.ReportHeaderId  = vm.ReportHeaderId;
                    line.DataType        = item.DataType;
                    line.Type            = item.Type;
                    line.ServiceFuncGet  = item.ServiceFuncGet;
                    line.ServiceFuncSet  = item.ServiceFuncSet;
                    line.CacheKey        = item.CacheKey;
                    line.Serial          = item.Serial;
                    line.FieldName       = item.FieldName;
                    line.DisplayName     = item.DisplayName;
                    line.NoOfCharToEnter = item.NoOfCharToEnter;
                    line.CreatedBy       = User.Identity.Name;
                    line.CreatedDate     = DateTime.Now;
                    line.ModifiedBy      = User.Identity.Name;
                    line.ModifiedDate    = DateTime.Now;

                    _ReportLineService.Create(line);
                    _unitOfWork.Save();
                }
                return(RedirectToAction("Index", new { id = vm.ReportHeaderId }).Success("Date Copied Successfully"));
            }
            ViewBag.ReporList = new ReportHeaderService(_unitOfWork).GetReportHeaderList().ToList();
            return(View(vm));
        }
        public void CopyReport(ReportCopyViewModel vm, string UserName)
        {
            List <ReportLineViewModel> temp = GetReportLineList(vm.CopyHeaderId).ToList();

            foreach (var item in temp)
            {
                ReportLine line = new ReportLine();
                line.ReportHeaderId  = vm.ReportHeaderId;
                line.DataType        = item.DataType;
                line.Type            = item.Type;
                line.ServiceFuncGet  = item.ServiceFuncGet;
                line.ServiceFuncSet  = item.ServiceFuncSet;
                line.CacheKey        = item.CacheKey;
                line.Serial          = item.Serial;
                line.FieldName       = item.FieldName;
                line.DisplayName     = item.DisplayName;
                line.NoOfCharToEnter = item.NoOfCharToEnter;
                line.CreatedBy       = UserName;
                line.CreatedDate     = DateTime.Now;
                line.ModifiedBy      = UserName;
                line.ModifiedDate    = DateTime.Now;

                Create(line);
            }
            _unitOfWork.Save();
        }
        public ActionResult Copy(int id)//header id
        {
            ReportCopyViewModel vm = new ReportCopyViewModel();

            vm.ReportHeaderId = id;
            ViewBag.ReporList = _ReportHeaderService.GetReportHeaderListForCopy(id).ToList();
            return(PartialView("_Copy", vm));
        }
        public ActionResult Copy(int id)//header id
        {
            ReportCopyViewModel vm = new ReportCopyViewModel();

            vm.ReportHeaderId = id;
            ViewBag.ReporList = new ReportHeaderService(_unitOfWork).GetReportHeaderListForCopy(id).ToList();
            return(View(vm));
        }
 public ActionResult Copy(ReportCopyViewModel vm)//header id
 {
     if (ModelState.IsValid)
     {
         _ReportLineService.CopyReport(vm, User.Identity.Name);
         return(Json(new { success = true }));
     }
     ViewBag.ReporList = _ReportHeaderService.GetReportHeaderList().ToList();
     return(PartialView("_Copy", vm));
 }