public IHttpActionResult UpdateCustomer(CustomerTypeMaster customerTypeMaster) { var isupdate = _customerTypeRepository.UpdateCustomerType(customerTypeMaster); if (isupdate == true) { return(Ok(isupdate)); } return(BadRequest()); }
public bool UpdateCustomerType(CustomerTypeMaster customerTypeMaster) { DateTime now = DateTime.Now; customerTypeMaster.ModifiedDate = now; int rowsAffected = this._db.Execute("UPDATE CustomerTypeMaster SET Name = @Name ,Description = @Description,ModifiedBy=1, ModifiedDate = @ModifiedDate WHERE Id = " + customerTypeMaster.Id, customerTypeMaster); if (rowsAffected > 0) { return(true); } return(false); }
public bool CreateCustomerType(CustomerTypeMaster customerTypeMaster) { DateTime now = DateTime.Now; customerTypeMaster.CreatedDate = now; customerTypeMaster.ModifiedDate = now; int rowsAffected = this._db.Execute(@"INSERT CustomerTypeMaster(Name,Description,IsActive,CreatedBy,CreatedDate,ModifiedBy,ModifiedDate) values (@Name,@Description,1,1,@CreatedDate,1,@ModifiedDate)", new { Name = customerTypeMaster.Name, Description = customerTypeMaster.Description, IsActive = 1, CreatedBy = 1, CreatedDate = customerTypeMaster.CreatedDate, ModifiedBy = 1, ModifiedDate = customerTypeMaster.ModifiedDate }); if (rowsAffected > 0) { return(true); } return(false); }