Ejemplo n.º 1
0
 /// <summary>
 /// 设置按钮事件逻辑
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSet_Click(object sender, EventArgs e)
 {
     if (tbNum.Enabled)//可用情况下
     {
         //TODO:设置同步时间
         tbNum.Enabled  = false;
         tbNum.ReadOnly = true;
         String _path = AppDomain.CurrentDomain.BaseDirectory + GlobalSet.appinifile;
         WindowsAPIUtility.WritePrivateProfileString("posset", "transfer_time", tbNum.Value.ToString(), _path);
     }
     else//不可用
     {
         //TODO:可用
         tbNum.Enabled  = true;
         tbNum.ReadOnly = false;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 初始化数据下载
        /// </summary>
        private static void InitSysIni()
        {
            string iniFile      = Gattr.INI_FILE_PATH;
            string errorMessage = string.Empty;

            if (!File.Exists(iniFile))
            {
                if (FileUtility.Instance.CreateFile(iniFile, false, ref errorMessage))
                {
                    //第一次初始化成最初的一个值
                    WindowsAPIUtility.WritePrivateProfileString("download", "t_product_food", Gattr.LAST_UPDATE_TIME, iniFile);
                    WindowsAPIUtility.WritePrivateProfileString("download", "t_pos_branch_stock", Gattr.LAST_UPDATE_TIME, iniFile);
                    WindowsAPIUtility.WritePrivateProfileString("download", "t_pos_branch_price", Gattr.LAST_UPDATE_TIME, iniFile);
                    WindowsAPIUtility.WritePrivateProfileString("download", "barcode", Gattr.LAST_UPDATE_TIME, iniFile);
                }
                else
                {
                    LoggerHelper.Log("MsmkLogger", "初始化系统配置文件失败:" + errorMessage, LogEnum.InitLog);
                }
            }
        }