示例#1
0
 public IActionResult _Detail(string id,string actionType)
 {
     ClauseVM clauseVM = new ClauseVM();
     ClauseModel clauseModel = new ClauseModel();
     if (actionType.ToLower().Equals("insert"))
     {
         // Insert
         clauseVM.actionType = "insert";
         clauseVM.listDocument  = documentDAL.GetAllDocuments();
         clauseVM.listVersion = menuDAL.GetAllVersion();
     }
     else
     {
         // Update
         clauseVM.actionType = "Update";
         clauseVM.clauseModel = clauseDAL.GetClauseById(id);
         clauseVM.listDocument  = documentDAL.GetAllDocuments();
         clauseVM.listVersion = menuDAL.GetAllVersion();
         //clauseModel = clauseDAL.GetDocumentByID(id);
         ////documentVM.listDocument = documentDAL.GetAllDocuments().ToList();
         //documentVM.listDocType = menuDAL.GetAllDocType();
         //documentVM.listVersion = menuDAL.GetAllVersion();
         //documentVM.listDocStatus = menuDAL.GetAllDocStatus();
         //documentVM.documentModel = document;
     }
     return PartialView("_Detail", clauseVM);
 }
示例#2
0
        public IActionResult Index()
        {
            DocumentVM documentVM = new DocumentVM();
            //documentVM.listDocument = documentDAL.GetAllDocuments().ToList();
            //documentVM.listDocType = menuDAL.GetAllDocType();
            //documentVM.listVersion = menuDAL.GetAllVersion();
            //documentVM.listDocStatus = menuDAL.GetAllDocStatus();
            //return View(documentVM);
            //int page = 1;
            int pageSize = 10;
            int totalCount;

            //int pageIndex = 1;
            //pageIndex = page > 0 ? Convert.ToInt32(page) : 1;

            //int pageIndex = 1;
            documentVM.PageNumber = 1;


            documentVM.listDocument  = documentDAL.GetAllDocuments(out totalCount).ToPagedList(documentVM.PageNumber, pageSize);
            documentVM.listDocType   = menuDAL.GetAllDocType();
            documentVM.listVersion   = menuDAL.GetAllVersion();
            documentVM.listDocStatus = menuDAL.GetAllDocStatus();
            return(View(documentVM));
        }