public static List <ErrorModel> GetActiveErrorList(string siteUrl, string listName)
        {
            List <ErrorModel> errorModels = new List <ErrorModel>();

            try
            {
                using (MSC.ClientContext context = CustomSharePointUtility.GetContext(siteUrl))
                {
                    if (context != null)
                    {
                        MSC.List list = context.Web.Lists.GetByTitle(listName);
                        MSC.ListItemCollectionPosition itemPosition = null;

                        while (true)
                        {
                            MSC.CamlQuery camlQuery = new MSC.CamlQuery();
                            camlQuery.ListItemCollectionPosition = itemPosition;

                            camlQuery.ViewXml = @"<View><Query><Where><Eq><FieldRef Name='SystemUpdated' /><Value Type='Choice'>No</Value></Eq></Where></Query><ViewFields><FieldRef Name='UserDisplayName' /><FieldRef Name='DisplayNo' /><FieldRef Name='URL' /><FieldRef Name='SystemUpdated' /><FieldRef Name='ID' /></ViewFields><QueryOptions /></View>";



                            MSC.ListItemCollection Items = list.GetItems(camlQuery);

                            context.Load(Items);
                            context.ExecuteQuery();
                            itemPosition = Items.ListItemCollectionPosition;
                            foreach (MSC.ListItem item in Items)
                            {
                                errorModels.Add(new ErrorModel
                                {
                                    ID           = Convert.ToInt32(item["ID"]),
                                    URL          = Convert.ToString(item["URL"]).Trim(),
                                    SystemUpdate = Convert.ToString(item["SystemUpdated"]).Trim(),
                                });
                            }
                            if (itemPosition == null)
                            {
                                break; // TODO: might not be correct. Was : Exit While
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(errorModels);
        }
        public static void UpdateStatus(int ID, string siteUrl, string ListName)
        {
            using (MSC.ClientContext context = CustomSharePointUtility.GetContext(siteUrl))
            {
                if (context != null)
                {
                    MSC.List     list     = context.Web.Lists.GetByTitle(ListName);
                    MSC.ListItem listItem = null;

                    MSC.ListItemCreationInformation itemCreateInfo = new MSC.ListItemCreationInformation();
                    listItem = list.GetItemById(ID);

                    listItem["SystemUpdated"] = "Yes";
                    listItem.Update();
                    try
                    {
                        context.ExecuteQuery();
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }
        }