Esempio n. 1
0
        public async Task <IActionResult> Edit(string id, T2 studentModel)
        {
            if (id != studentModel.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                await _context.Update(studentModel);

                return(RedirectToAction(nameof(Index)));
            }
            return(View(studentModel));
        }
Esempio n. 2
0
        public async Task <IActionResult> Put(MarksModel marksModel)    //edit
        {
            if (string.IsNullOrEmpty(marksModel.ID))
            {
                return(BadRequest());
            }

            if (ModelState.IsValid)
            {
                await _context.Update(marksModel);

                return(Ok(marksModel));
            }
            return(BadRequest());
        }
Esempio n. 3
0
        private void simpleButtonSave_Click(object sender, EventArgs e)
        {
            ProcessTabKey(true);

            if (Validation() == false)
            {
                return;
            }

            if (_item.Id == 0)
            {
                _item = _repo.Add(_item);
            }
            else
            {
                _repo.Update(_item);
            }

            DialogResult = DialogResult.OK;
        }
        public virtual MessageObject <T> Update(T entity)
        {
            MessageObject <T> validationResult = ValidateUpdate(entity);

            try
            {
                BasePreProcessing(ref entity, OperationType.Update);
                if (validationResult.ProcessingStatus)
                {
                    repo.Update(entity);
                    //validationResult.Data = repo.GetById(entity.Id); //refresh
                    repo.Commit();

                    BasePostProcessing(ref entity, OperationType.Add);
                }
            }
            catch (Exception ex)
            {
                Utils.Logger.Log(ex, logSource);
                validationResult.AddException(ex);
            }
            return(validationResult);
        }
 public int Update(OrganizationInfo entity)
 {
     return(_organizationInfoRepo.Update(entity));
 }
Esempio n. 6
0
 public int Update(Designation entity)
 {
     return(_designationRepo.Update(entity));
 }
Esempio n. 7
0
 public int Update(Product entity)
 {
     entity.UpdatedBy   = Convert.ToInt32(HttpContext.Current.Session["UserId"]);
     entity.UpdatedDate = DateTime.Now;
     return(_productRepo.Update(entity));
 }
Esempio n. 8
0
 public int UpdateProductImage(ProductImage entity, IDbTransaction transaction, SqlConnection con)
 {
     return(_productImageRepo.Update(entity, transaction, con));
 }
Esempio n. 9
0
 public int UpdatePrice(ProductPrice entity)
 {
     return(_productPriceRepo.Update(entity));
 }
Esempio n. 10
0
 public int Update(FiscalYear entity, IDbTransaction transaction, SqlConnection con)
 {
     entity.UpdatedBy   = Convert.ToInt32(HttpContext.Current.Session["UserId"]);
     entity.UpdatedDate = DateTime.Now;
     return(_fiscalYearRepo.Update(entity, transaction, con));
 }
Esempio n. 11
0
 public int Update(Role entity)
 {
     return(_roleRepo.Update(entity));
 }
Esempio n. 12
0
 public int Update(AccountHead entity)
 {
     return(_accountHeadRepo.Update(entity));
 }
Esempio n. 13
0
 /// <summary>
 /// 更新实体数据
 /// </summary>
 /// <param name="entity">实体类</param>
 /// <returns></returns>
 public async Task <bool> Update(T entity)
 {
     return(await BaseDal.Update(entity));
 }
Esempio n. 14
0
 public int Update(Department entity)
 {
     return(_departmentRepo.Update(entity));
 }