public virtual PaymentTypeDTO Save(PaymentTypeDTO dto) { var entity = Mapper.Map <PaymentType>(dto); var savedItem = _paymentTypeRepository.Save(entity); return(Mapper.Map <PaymentTypeDTO>(savedItem)); }
public static PaymentTypeDTO MapToDTO(PaymentTypeDAO payment) { var p = new PaymentTypeDTO(); p.Id = payment.Id; p.Type = payment.Type; p.Active = payment.Active; return(p); }
public async Task <ActionResult <PaymentTypeDTO> > PostPaymentType(PaymentTypeDTO paymentTypeDTO) { var bllEntity = _mapper.Map(paymentTypeDTO); _bll.PaymentTypes.Add(bllEntity); await _bll.SaveChangesAsync(); paymentTypeDTO.Id = bllEntity.Id; return(CreatedAtAction("GetPaymentType", new { id = paymentTypeDTO.Id, version = HttpContext.GetRequestedApiVersion()?.ToString() ?? "0" }, paymentTypeDTO)); }
public LogicResult <PaymentTypeDTO> Save(PaymentTypeDTO entity) { try { var dto = _paymentTypeBusinessLogic.Save(entity); return(LogicResult <PaymentTypeDTO> .Succeed(dto)); } catch (Exception exception) { return(LogicResult <PaymentTypeDTO> .Failure(exception)); } }
private void bbi_Delete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { PaymentTypeDTO oRow = (PaymentTypeDTO)gridView1.GetFocusedRow(); if (oRow != null) { if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Delete, (int)DocumentType.CurrentGroupDefinitions, AppMain.CompanyRecId)) { return; } if (oTool.get_Question("Kayıt Silinecektir. Onaylıyor musunuz?")) { var result = _repository.Run <DepotStockService, ActionResponse <CurrentGroupDefinitionsDTO> >(x => x.Delete__CurrentGroupDefinitions(oRow.RecId)); do_refresh(); } } }
public async Task <IActionResult> PutPaymentType(Guid id, PaymentTypeDTO paymentTypeDTO) { if (id != paymentTypeDTO.Id) { return(BadRequest(new MessageDTO("Id and paymentTypeEditDTO.id do not match"))); } if (!await _bll.PaymentTypes.ExistsAsync(paymentTypeDTO.Id)) { return(NotFound(new MessageDTO($"Payment type with this id {id} not found"))); } await _bll.PaymentTypes.UpdateAsync(_mapper.Map(paymentTypeDTO)); await _bll.SaveChangesAsync(); return(NoContent()); }
public RedirectToRouteResult CreateOrder(OrderDTO order, string returnUrl, int store, int paymentOption) { if (store != 0 && paymentOption != 0) { StoreDTO Store = data.GetStore(store); PaymentTypeDTO Payment = data.GetPaymentType(paymentOption); order.Customer = (CustomerDTO)Session["Customer"]; order.Store = Store; order.Payment = Payment; if (data.InsertOrder(order)) { order = data.GetOrders().Last(); Session["Order"] = order; return(RedirectToAction("Order")); } } return(RedirectToAction("StartOrder")); }
private void bbi_Delete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { PaymentTypeDTO oRow = (PaymentTypeDTO)gridView1.GetFocusedRow(); if (oRow != null) { if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Delete, (int)DocumentType.PaymentType, AppMain.CompanyRecId)) { return; } if (oRow.Remark.Trim() == "Nakit" || oRow.Remark.Trim() == "Pos" || oRow.Remark.Trim() == "Pos & Nakit") { XtraMessageBox.Show("Silinemiycek Kayıtdır.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (oTool.get_Question("Kayıt Silinecektir. Onaylıyor musunuz?")) { var result = _repository.Run <DepotStockService, ActionResponse <PaymentTypeDTO> >(x => x.DeletePayment(oRow.RecId)); do_refresh(); } } }
public IHttpActionResult Put([FromUri] int id, [FromBody] PaymentTypeDTO PaymentType) { PaymentTypeService.PrePutDTO(ModelState, currentClient, id, PaymentType); return(Ok()); }
public IHttpActionResult Post([FromBody] PaymentTypeDTO PaymentType) { return(Ok(PaymentTypeService.PrePostDTO(ModelState, currentClient, PaymentType))); }
public bool InsertPaymentType(PaymentTypeDTO item) { return(pssc.InsertPaymentType(PaymentTypeMapper.MapToDAO(item))); }
public bool DeletePaymentType(PaymentTypeDTO item) { return(pssc.DeletePaymentType(PaymentTypeMapper.MapToDAO(item))); }
public bool ChangePaymentType(PaymentTypeDTO item) { return(pssc.ChangePaymentType(PaymentTypeMapper.MapToDAO(item))); }