Esempio n. 1
0
        public LoginWait()
        {
            InitializeComponent();
            //取最新的版本,与当前的版本号
            ConfigHelper config = new ConfigHelper();

            config.SetConfigName(@"\Alading.exe.config");
            string currentVersionCode = config.ReadConfig("CurrentVersion");
            string versionType        = config.ReadConfig("VersionType");

            Alading.WebService.Version version = ServiceHelper.GetNewVersion(versionType);
            if (version != null && version.VersionCode != null && version.VersionCode != currentVersionCode)
            {
                DialogResult result = XtraMessageBox.Show("检测到阿拉丁有最新版本,是否现在更新?", Constants.SYSTEM_PROMPT, MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                if (result == DialogResult.OK)
                {
                    string updatePath = Application.StartupPath + "\\Alading.Updater.exe";
                    if (File.Exists(updatePath))
                    {
                        Process.Start(updatePath);
                    }
                }
            }
            waitTimer          = new Timer();
            waitTimer.Interval = 600000;
            waitTimer.Tick    += new EventHandler(waitTimer_Tick);

            backWorker = new BackgroundWorker {
                WorkerReportsProgress = true, WorkerSupportsCancellation = false
            };
            backWorker.DoWork             += new DoWorkEventHandler(backWorker_DoWork);
            backWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backWorker_RunWorkerCompleted);
            backWorker.ProgressChanged    += new ProgressChangedEventHandler(backWorker_ProgressChanged);

            LocalUserList = new List <Alading.Entity.User>();
            LocalShopList = new List <Alading.Entity.Shop>();
            NetShopList   = new List <Shop>();
            NetUserList   = new List <User>();
            mainUser      = new Alading.Entity.User();
        }
Esempio n. 2
0
        /// <summary>
        /// 保存新增员工信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bntSave_Click(object sender, EventArgs e)
        {
            Alading.Entity.User user = new Alading.Entity.User();

            user.UserCode   = System.Guid.NewGuid().ToString();
            user.nick       = txName.Text;
            user.account    = txAccount.Text;
            user.bankAddr   = txBankAddr.Text;
            user.password   = txPassword.Text;
            user.department = txDept.Text;
            user.email      = txMail.Text;
            user.created    = DateTime.Now;
            user.last_visit = DateTime.Now;
            if (dateEdit.Text != string.Empty)
            {
                user.birthday = Convert.ToDateTime(dateEdit.Text);
            }
            user.Remark = memo_Remark.Text;
            user.tel    = txPhone.Text;
            user.addr   = txAddr.Text;
            user.status = "0";
            if (rgSex.SelectedIndex == 0)
            {
                user.sex = "男";
            }
            else
            {
                user.sex = "女";
            }

            Alading.Business.UserService.AddUser(user);
            selectedUser = user;
            SaveRole();
            SaveUserShop();
            SaveUserStockHouse();
        }