protected void btnImport_Click(object sender, EventArgs e)
        {
            if (btnBrowse != null && !string.IsNullOrEmpty(btnBrowse.FileName))
            {
                try
                {
                    switch (ddlFileExtension.SelectedItem.Text)
                    {
                    case "mdb":
                    {
                        string         savePath     = ConfigurationManager.AppSettings["AttendanceFile"];
                        var            fileInfo     = new FileInfo(btnBrowse.FileName);
                        var            path         = System.Web.HttpContext.Current.Server.MapPath(savePath);
                        var            fullFileName = path + Guid.NewGuid().ToString() + fileInfo.Extension;
                        TextFileHelper helper       = new TextFileHelper(btnBrowse, fullFileName);

                        if (helper.ImportFile())
                        {
                            string            connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fullFileName + ";Persist Security Info=False;Jet OLEDB:Database Password=fdmsamho;";
                            OleDbConnection   OledConnStr      = new OleDbConnection(connectionString);
                            List <DiviceData> items            = processFileData(OledConnStr);
                            processList(items);
                        }
                        else
                        {
                            ((PageBase)this.Page).ErrorPage = "File did not import successfully";
                        }
                        break;
                    }

                    case "txt":
                    {
                        string savePath     = ConfigurationManager.AppSettings["AttendanceFile"];
                        var    fileInfo     = new FileInfo(btnBrowse.FileName);
                        var    path         = System.Web.HttpContext.Current.Server.MapPath(savePath);
                        var    fullFileName = path + Guid.NewGuid().ToString() + fileInfo.Extension;

                        TextFileHelper helper = new TextFileHelper(btnBrowse, fullFileName);

                        if (helper.ImportFile())
                        {
                            //save daily attendance info in database
                            string fileContent = File.ReadAllText(fullFileName);

                            //saving attendance data into database
                            //: Separated
                            //List<ATT_IO_Temp> items = processFileData(fileContent, fullFileName);
                            //; Separated
                            List <ATT_IO_Temp> items = processFileDataSemicolonSeparated(fileContent, fullFileName);
                            if (items.Count() == 0)
                            {
                                //, Separated
                                items = processFileDataComaSeparated(fileContent, fullFileName);
                            }
                            //group by empcode and attdate - setting intime(Min) and out time(Max)
                            //creating dao object
                            processList(items);
                        }
                        else
                        {
                            ((PageBase)this.Page).ErrorPage = "File did not import successfully";
                        }
                        break;
                    }
                    }
                }
                catch (Exception ex)
                {
                    ((PageBase)this.Page).ErrorMessage = "Import failed:" + ex.Message;
                }
            }

            else
            {
                CustomList <Atten_Device> lstAttDevice = _manager.GetAllAtten_DeviceSQL();
                TimeSpan fromDate       = txtFromDate.Text.ToDateTime().Subtract(new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc));//Unix Epoch on January 1st, 1970
                Int32    FDTotalSeconds = Convert.ToInt32(fromDate.TotalSeconds);
                DateTime toDate         = txtToDate.Text.ToDateTime().AddHours(23);
                toDate = toDate.AddMinutes(59);
                toDate = toDate.AddSeconds(59);
                TimeSpan startDate      = toDate.Subtract(new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc));
                Int32    TDTotalSeconds = Convert.ToInt32(startDate.TotalSeconds);

                if (lstAttDevice.Count != 0)
                {
                    CustomList <DiviceData> items = _manager.GetAllDeviceData(lstAttDevice[0].SqlConnectionString, lstAttDevice[0].QueryString + " And (nDateTime Between " + FDTotalSeconds.ToString() + " And " + TDTotalSeconds.ToString() + ")");
                    processList(items);
                }
            }
        }