public ActionResult Display(GridCommand command, int id) { int totalRows = 0; //Get all parent logs. string dbContextConnectionString = ConfigurationHelper.GetsmARTDBContextConnectionString(); QuickBookLibrary lib = new smART.Library.QuickBookLibrary(); lib.Initialize(dbContextConnectionString); IEnumerable <QBLog> resultList = lib.GetByPrentIDWithPagging(id, out totalRows, command.Page, command.PageSize, "ID", "Asc", null, (command.FilterDescriptors.Count == 0 ? null : command.FilterDescriptors) ); return(View(new GridModel { Data = resultList, Total = totalRows })); }
private void UpdateDetails(QBLog parent, bool isParent = true) { //Get all parent logs. string dbContextConnectionString = ConfigurationHelper.GetsmARTDBContextConnectionString(); QuickBookLibrary lib = new smART.Library.QuickBookLibrary(dbContextConnectionString); IEnumerable <QBLog> childList = lib.GetByParentID(isParent ? parent.ID : parent.Parent_ID); foreach (var item in childList) { if (isParent) { item.Status = parent.Status; item.Name = parent.Name; } else { item.Account_Name = parent.Account_Name; } lib.Modify(item); } }