Beispiel #1
0
 /// <summary>
 /// 修改数据
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BtnUpdateBorrowTime_Click(object sender, EventArgs e)
 {
     if (txtBorrowTime.Text != "")
     {
         GetArgs();
         Health.Models.BorrowTimeLenthModel model = new Models.BorrowTimeLenthModel();
         int i = model.CheckDesRepeat(borrowTimeArgs.DocDes, borrowTimeArgs.BorrowTimeId);
         if (i == 0)
         {
             if (CJia.Health.Tools.Message.ShowQuery("是否修改此数据", CJia.Health.Tools.Message.Button.YesNo) == CJia.Health.Tools.Message.Result.Yes)
             {
                 OnUpdateBorrowTime(null, borrowTimeArgs);
                 OnQueryBorrowTime(null, null);
             }
             else
             {
                 return;
             }
         }
         else
         {
             Message.ShowWarning("已有此职称数据,请点击此职称修改");
         }
     }
     else
     {
         MessageBox.Show("借阅时间不能为空");
     }
 }
Beispiel #2
0
 /// <summary>
 /// 添加数据
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BtnAddBorrowTime_Click(object sender, EventArgs e)
 {
     //MessageBox.Show(int.Parse(txtBorrowTime.Text).ToString());
     //Form frm = new Form();
     //AddBorrowTimeView add = new AddBorrowTimeView();
     //frm.Controls.Add(add);
     //frm.ShowDialog();
     if (txtBorrowTime.Text != "")
     {
         GetArgs();
         borrowTimeArgs.BorrowTimeId = " ";
         Health.Models.BorrowTimeLenthModel model = new Models.BorrowTimeLenthModel();
         int i = model.CheckDesRepeat(borrowTimeArgs.DocDes, borrowTimeArgs.BorrowTimeId);
         if (i == 0)
         {
             if (CJia.Health.Tools.Message.ShowQuery("是否添加此数据", CJia.Health.Tools.Message.Button.YesNo) == CJia.Health.Tools.Message.Result.Yes)
             {
                 GetArgs();
                 OnInsertBorrowTime(null, borrowTimeArgs);
                 OnQueryBorrowTime(null, null);
             }
             else
             {
                 return;
             }
         }
         else
         {
             Message.ShowWarning("此职称数据已存在");
         }
     }
     else
     {
         MessageBox.Show("借阅时间不能为空");
     }
 }