Exemple #1
0
        public static void AddNewItem2PickList(string tblName, string NewListItem)
        {
            string FilePath = HttpContext.Current.Server.MapPath("content\\PickList.xlsx");

            ExcelFile ef = new ExcelFile(FilePath);

            ef.InsertPickListItem(tblName, NewListItem);
        }
Exemple #2
0
        public static List<string> GetListFromExcel(string term, int tableIndex)
        {
            string FilePath = HttpContext.Current.Server.MapPath("content\\PickList.xlsx");

            ExcelFile ef = new ExcelFile(FilePath);
            DataSet ds = ef.GetDropDownList();

            List<string> list = new List<string>();

            foreach (DataRow row in ds.Tables[tableIndex].Rows)      // 0 => Observation table
            {
                if (row[0].ToString().Contains(term))
                {
                    list.Add(row[0].ToString());
                }
            }

            return list;
        }
Exemple #3
0
        //----------------------------------------------------
        protected void PopulateDropdownFromExcel()
        {
            string FilePath = Server.MapPath("content\\PickList.xlsx");

            ExcelFile ef = new ExcelFile(FilePath);

            DataSet ds = ef.GetDropDownList();

            //--------------------------------------------------
            DropDownListDataBind("ddObservation", ds.Tables[0]);
            DropDownListDataBind("ddDeficiency", ds.Tables[1]);
        }