private void buttonCreateClassify_Click(object sender, EventArgs e) { string classifyName = textBoxClassifyName.Text; string classifyDetail = textBoxClassifyDetail.Text; ClassifyDTO classify = new ClassifyDTO(); classify.ClassifyName = classifyName; classify.ClassifyDetail = classifyDetail; service.createClassify(classify); loadClassifies(); }
private void buttonEditClassify_Click(object sender, EventArgs e) { int classifyId = Convert.ToInt32(textBoxIdClassify.Text); string classifyName = textBoxClassifyName.Text; string classifyDetail = textBoxClassifyDetail.Text; ClassifyDTO classify = new ClassifyDTO(); classify.Id = classifyId; classify.ClassifyName = classifyName; classify.ClassifyDetail = classifyDetail; service.editClassify(classify); loadClassifies(); }
private void textBoxId_TextChanged(object sender, EventArgs e) { if (!textBoxId.Text.Equals("0") && !textBoxId.Text.Equals("")) { int idProduct = Convert.ToInt32(textBoxId.Text); ClassifyDTO classify = service.getClassifyByIdProduct(idProduct); int index = -1; int i = 0; foreach (ClassifyDTO item in comboBoxClassify2.Items) { if (item.Id == classify.Id) { index = i; break; } i++; } comboBoxClassify2.SelectedIndex = index; } }
public void editClassify(ClassifyDTO classify) { classifyService.edit(classify); }
public void createClassify(ClassifyDTO classify) { classifyService.create(classify); }
public void edit(ClassifyDTO classify) { classifyRepository.edit(mapper.Map <ClassifyDTO, Classify>(classify)); }
public void create(ClassifyDTO classify) { classifyRepository.create(mapper.Map <ClassifyDTO, Classify>(classify)); }