Ejemplo n.º 1
0
        public void DeleteCheck(Model.CheckViewModel check)
        {
            var existsCheck = db.Checks.Find(check.CheckID);

            db.Checks.Remove(existsCheck);

            db.SaveChanges();
        }
Ejemplo n.º 2
0
 public void UpdateBy(CheckViewModel instance)
 {
     CheckID         = instance.CheckID;
     AccountNumber   = instance.AccountNumber;
     Amount          = instance.Amount;
     Bank            = instance.Bank;
     Date            = instance.Date;
     Description     = instance.Description;
     Number          = instance.Number;
     Phone           = instance.Phone;
     ReturnCheckDate = instance.ReturnCheckDate;
     SchoolCode      = instance.SchoolCode;
     StatusType      = instance.StatusType;
     StudentName     = instance.StudentName;
 }
Ejemplo n.º 3
0
        public int SaveCheck(Model.CheckViewModel check)
        {
            var existsCheck = db.Checks.Find(check.CheckID);

            if (existsCheck == null)
            {
                existsCheck = (Check)check;
                db.Checks.Add(existsCheck);
            }
            else
            {
                existsCheck.UpdateBy(check);
            }

            db.SaveChanges();

            return(existsCheck.CheckID);
        }