public ActionResult Entry(MovementEntryVM movementM)
        {
            var username = Session["username"].ToString();
            int orgid    = 0;
            var list     = userManager.GetAll().Where(c => c.UserName == username);

            foreach (var t in list)
            {
                orgid = t.OrganizationId;
            }

            ViewBag.orglist = organizationManager.GetAll();
            MovementEntryVM model = new MovementEntryVM()
            {
                OrganizationLookUp = loader.GetOrganizationByUserOrgIdSelectitems(orgid),
                //AssetLookUp = loader.GetAssetSelectListItems()
                AssetLookUp = loader.GetAssetSelectListItemsJoinwithAssetDetails(orgid)
            };

            string format = "d";

            model.RegistrationDate = DateTime.Today.ToString(format);
            List <MovementEntryVM> aList = (List <MovementEntryVM>)Session["CartList"];

            if (aList != null && aList.Any())
            {
                List <PdfView> pdfList = new List <PdfView>();
                foreach (var mo in aList)
                {
                    MovementEntryVM movementVM = new MovementEntryVM();
                    movementVM = mo;

                    movementVM.MoveBy = Session["username"].ToString();
                    AssetRegistrationDetails details = assetdetailsmanager.GetIdAssetId(movementVM.AssetId);
                    int detailsId = details.Id;
                    details = assetdetailsmanager.GetById(detailsId);
                    details.OrganizationId = movementVM.OrganizationId;
                    details.BranchId       = movementVM.OrganizationId;

                    var movement = Mapper.Map <Movement>(movementVM);

                    MovementPermision mvp = new MovementPermision();
                    mvp.Permision = false;
                    var  movementPermision = Mapper.Map <MovementPermision>(movementVM);
                    bool isSaved;
                    if (Session["Designation"].ToString() == "Manager")
                    {
                        isSaved = movementPermisionManager.Add(movementPermision);
                    }
                    else
                    {
                        isSaved = movementManager.Add(movement);
                    }



                    if (isSaved)
                    {
                        details.BranchId = movementVM.BranchId;
                        if (assetdetailsmanager.Update(details))
                        {
                            ModelState.Clear();
                            ViewBag.message = "Save Successfully";



                            PdfView aPdfView = new PdfView();

                            aPdfView.OrganizationId   = movement.OrganizationId;
                            aPdfView.OrganizationName = movement.OrganizationName;
                            aPdfView.AssetId          = movement.AssetId;
                            aPdfView.AssecCode        = movementVM.Code;
                            aPdfView.AssetSerialNo    = movementVM.SerialNo;
                            aPdfView.GeneralCategory  = movementVM.GeneralCategoryName;
                            aPdfView.Category         = movementVM.CategoryNme;
                            aPdfView.Brand            = movementVM.BrandName;
                            aPdfView.FromBranch       = movement.BranchName;
                            aPdfView.ToBranch         = branchManager.GetById(movement.BranchId).Name;
                            aPdfView.MovedBy          = movement.MoveBy;
                            aPdfView.Date             = movement.RegistrationDate;

                            pdfList.Add(aPdfView);
                        }
                    }
                }

                GeneratePdf(pdfList, DateTime.Now.Date.ToString(), Session["username"].ToString());
                Session["Printed"] = "YES";
            }

            return(RedirectToAction("Entry"));
        }