Ejemplo n.º 1
0
        public JsonResult DeleteCustomer([FromBody] DeleteCustomerRequest request)
        {
            BaseResponse baseResponse = new BaseResponse();

            Bayi.DataAccess.Customer byId = this._customerService.GetById(request.CustomerId);
            byId.IsActive = false;
            this._customerService.Update(byId);
            baseResponse.Number  = 1;
            baseResponse.Message = "Kullanıcı başarıyla silinmiştir..";
            return(this.Json((object)baseResponse));
        }
Ejemplo n.º 2
0
 public IActionResult Update(int customerId)
 {
     Bayi.DataAccess.Customer byId = this._customerService.GetById(customerId);
     return((IActionResult)this.View((object)new ListCustomerResponse()
     {
         CompanyName = byId.CompanyName,
         Email = byId.Email,
         Phone = byId.Phone,
         Address = byId.Address,
         Authorized = byId.AuthorizedPerson,
         Id = byId.Id
     }));
 }
Ejemplo n.º 3
0
        public JsonResult UpdateCustomer([FromBody] UpdateCustomerRequest request)
        {
            BaseResponse baseResponse = new BaseResponse();

            Bayi.DataAccess.Customer byId = this._customerService.GetById(request.Id);
            byId.Email            = request.Email;
            byId.Phone            = request.Phone;
            byId.Address          = request.Address;
            byId.CompanyName      = request.CompanyName;
            byId.AuthorizedPerson = request.Authorized;
            this._customerService.Update(byId);
            baseResponse.Message = "Bilgiler başarıyla değiştirilmiştir..";
            baseResponse.Number  = 1;
            return(this.Json((object)baseResponse));
        }