Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
meser
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Suryono
meser
Commits
db00e096
Commit
db00e096
authored
Aug 31, 2020
by
Muhammad Suryono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update
parent
aee372a2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
FormProductActivity.java
...rc/main/java/com/yono/messeripos/FormProductActivity.java
+17
-1
CategoryServise.java
...java/com/yono/messeripos/api/service/CategoryServise.java
+3
-0
No files found.
app/src/main/java/com/yono/messeripos/FormProductActivity.java
View file @
db00e096
...
...
@@ -63,6 +63,7 @@ public class FormProductActivity extends AppCompatActivity {
private
boolean
isUpdate
=
false
;
String
locationPath
=
null
;
int
idCategorySelected
=
0
;
public
int
id
=
0
;
private
String
[]
permissions
=
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
};
...
...
@@ -297,7 +298,22 @@ public class FormProductActivity extends AppCompatActivity {
}
private
int
getCategory
(
String
s
)
{
return
1
;
Log
.
i
(
"CATEGORY"
,
"getCategory: "
+
s
);
CategoryServise
categoryServise
=
client
.
Client
(
CategoryServise
.
class
);
categoryServise
.
getCategoryByName
(
s
).
enqueue
(
new
Callback
<
DataResponse
<
List
<
CategoryModels
>>>()
{
@Override
public
void
onResponse
(
Call
<
DataResponse
<
List
<
CategoryModels
>>>
call
,
Response
<
DataResponse
<
List
<
CategoryModels
>>>
response
)
{
Log
.
i
(
"CHDJHD"
,
"getCategory: "
+
utils
.
convertGson
(
response
.
body
()));
id
=
response
.
body
().
getData
().
get
(
0
).
getIdCategory
();
}
@Override
public
void
onFailure
(
Call
<
DataResponse
<
List
<
CategoryModels
>>>
call
,
Throwable
t
)
{
}
});
return
id
;
}
private
void
openFile
(){
...
...
app/src/main/java/com/yono/messeripos/api/service/CategoryServise.java
View file @
db00e096
...
...
@@ -23,6 +23,9 @@ public interface CategoryServise {
@GET
(
ApiHelper
.
VERSI_API_1
+
"product-category-id/{id}"
)
Call
<
DataResponse
<
List
<
ProductModels
>>>
getCategoryById
(
@Path
(
"id"
)
int
id
);
@GET
(
ApiHelper
.
VERSI_API_1
+
"category-name/{id}"
)
Call
<
DataResponse
<
List
<
CategoryModels
>>>
getCategoryByName
(
@Path
(
"id"
)
String
name
);
@POST
(
ApiHelper
.
VERSI_API_1
+
"category"
)
Call
<
DataResponse
<
CategoryModels
>>
addCategory
(
@Body
CategoryModels
categoryModels
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment