Beispiel #1
0
        /// <summary>
        /// 确定按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            bool    result = false;
            AppInfo model  = new AppInfo();

            model.AppName  = txtName.Text;
            model.AppParam = txtParam.Text;
            model.AppPath  = txtPath.Text;
            model.AppType  = (int)(rdbCommand.Checked ? ExcuteType.ExcuteCommand : ExcuteType.ExcuteFile);
            if (string.IsNullOrEmpty(txtID.Text))
            {
                result = service.Add(model);
            }
            else
            {
                model.ID = int.Parse(txtID.Text);
                result   = service.Update(model);
            }
            if (result)
            {
                ResetInput();
                pnAdd.Hide();
                InitData();
            }
            else
            {
                MessageBox.Show("保存失败!");
            }
        }
Beispiel #2
0
 public static bool Update(APP_INFO appInfo)
 {
     appInfo.MODIFY_TIME = DateTime.Now;
     return(appInfoDal.Update(appInfo));
 }