Beispiel #1
0
 public override void SaveModel()
 {
     if (this.Validation())
     {
         DIC_BENHVIEN  benhvien = (DIC_BENHVIEN)this.GetModel();
         SqlResultType flag;
         if (this.actions == Common.Common.Class.Actions.AddNew)
         {
             flag = new HospitalProvider().Insert(benhvien);
         }
         else
         {
             flag = new HospitalProvider().Update(benhvien);
         }
         SaveCompleteEventArgs args = new SaveCompleteEventArgs();
         args.Result = flag == SqlResultType.OK;
         args.Action = this.actions;
         args.Model  = benhvien;
         this.SaveCompleteSuccess(benhvien, args);
     }
     else
     {
         XtraMessageBox.Show("Thông tin chưa hợp lệ kiểm tra lại thông tin.");
     }
 }
Beispiel #2
0
 public override bool DeleteModel()
 {
     if (this.Model != null)
     {
         if (XtraMessageBox.Show("Bạn có muốn xóa bản ghi này không?", "Xóa bản ghi", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK)
         {
             DIC_BENHVIEN  benhvien   = (DIC_BENHVIEN)this.Model;
             SqlResultType resultType = new HospitalProvider().Delete(benhvien);
             if (resultType == SqlResultType.OK)
             {
                 this.ClearModel();
                 this.DisabledLayout(true);
             }
             return(resultType == SqlResultType.OK);
         }
     }
     return(false);
 }
Beispiel #3
0
        protected override void SetDataSource()
        {
            HospitalProvider hospitalProvider = new HospitalProvider();

            this.dataSource = hospitalProvider.GetAll();
        }