public ActionResult RegisterBooks(string mode, string id) { LibraryViewModel lvModel = new LibraryViewModel(); lvModel.MODE = mode; if (mode != null && string.Equals(mode, "EDIT", StringComparison.OrdinalIgnoreCase)) { //Populate edit data using id passed in URL, if id==null then show error message StatusDTO <BookMasterDTO> dto = _bookmasterSvc.Select(Convert.ToInt32(id)); lvModel.BookMasterId = dto.ReturnObj.BookMasterId; lvModel.BookName = dto.ReturnObj.BookName; lvModel.AuthorName1 = dto.ReturnObj.AuthorName1; lvModel.AuthorName2 = dto.ReturnObj.AuthorName2; lvModel.PurchaseDate = dto.ReturnObj.PurchaseDate; lvModel.AccNo = dto.ReturnObj.AccNo; lvModel.AccDate = dto.ReturnObj.AccDate; lvModel.CALLNO = dto.ReturnObj.CALLNO; lvModel.ISBNNo = dto.ReturnObj.ISBNNo; lvModel.Edition = dto.ReturnObj.Edition; lvModel.Publisher = dto.ReturnObj.Publisher; lvModel.PublishingYear = dto.ReturnObj.PublishingYear; lvModel.Place = dto.ReturnObj.Place; lvModel.Series = dto.ReturnObj.Series; lvModel.Price = dto.ReturnObj.Price; lvModel.NOFCD = dto.ReturnObj.NOFCD; lvModel.BookCategory = dto.ReturnObj.BookCategory; lvModel.Location = dto.ReturnObj.Location; } lvModel.BookCategoryList = _uiddlRepo.getBookCategoryDropDown(); lvModel.LocationList = _uiddlRepo.getLocationDropDown(); return(View(lvModel)); }