コード例 #1
0
        public virtual PaymentTypeDTO Save(PaymentTypeDTO dto)
        {
            var entity    = Mapper.Map <PaymentType>(dto);
            var savedItem = _paymentTypeRepository.Save(entity);

            return(Mapper.Map <PaymentTypeDTO>(savedItem));
        }
コード例 #2
0
        public static PaymentTypeDTO MapToDTO(PaymentTypeDAO payment)
        {
            var p = new PaymentTypeDTO();

            p.Id     = payment.Id;
            p.Type   = payment.Type;
            p.Active = payment.Active;

            return(p);
        }
コード例 #3
0
        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));
        }
コード例 #4
0
 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));
     }
 }
コード例 #5
0
        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();
                }
            }
        }
コード例 #6
0
        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());
        }
コード例 #7
0
        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"));
        }
コード例 #8
0
ファイル: frmPaymnetList.cs プロジェクト: ademaydogdu/msp
        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();
                }
            }
        }
コード例 #9
0
 public IHttpActionResult Put([FromUri] int id, [FromBody] PaymentTypeDTO PaymentType)
 {
     PaymentTypeService.PrePutDTO(ModelState, currentClient, id, PaymentType);
     return(Ok());
 }
コード例 #10
0
 public IHttpActionResult Post([FromBody] PaymentTypeDTO PaymentType)
 {
     return(Ok(PaymentTypeService.PrePostDTO(ModelState, currentClient, PaymentType)));
 }
コード例 #11
0
 public bool InsertPaymentType(PaymentTypeDTO item)
 {
     return(pssc.InsertPaymentType(PaymentTypeMapper.MapToDAO(item)));
 }
コード例 #12
0
 public bool DeletePaymentType(PaymentTypeDTO item)
 {
     return(pssc.DeletePaymentType(PaymentTypeMapper.MapToDAO(item)));
 }
コード例 #13
0
 public bool ChangePaymentType(PaymentTypeDTO item)
 {
     return(pssc.ChangePaymentType(PaymentTypeMapper.MapToDAO(item)));
 }