Exemple #1
0
        public static void downloadAuthenCode()
        {
            int                    total          = 0;
            int                    success        = 0;
            AuthenCodeDao          dao            = new AuthenCodeDao();
            int                    StationID      = Convert.ToInt16(ManageLOG.getValueFromRegistry(Configurations.AppRegName, "StationID"));
            List <ModelAuthenCode> listAccessCode = dao.Select("", StationID);

            if (listAccessCode != null)
            {
                total = listAccessCode.Count;
                logger.Debug("# Start Download [AUTHENCODE] from server.");

                foreach (ModelAuthenCode model in listAccessCode)
                {
                    List <ModelAuthenCode> tmp = dao.SelectOffine(" Where ath_code='" + model.ath_code + "'", StationID);
                    if (tmp != null)
                    {
                        if (tmp.Count > 0)
                        {
                        }
                        else
                        {
                            if (dao.InsertOffline(model))
                            {
                                success++;
                            }
                        }
                    }
                }
                logger.Debug("# Summary=> Total Download total: " + total + " success: " + success + " fail: " + (total - success));
                logger.Debug("# End Download data from server.");
            }
        }
Exemple #2
0
 public FrmAuthenCode()
 {
     InitializeComponent();
     authenCodeDao = new AuthenCodeDao();
 }