| | |
| | | return ecode.OK |
| | | } |
| | | |
| | | func (QuotationService) DeleteQuotation(id int) int { |
| | | _, err := model.NewQuotationSearch().SetId(id).Find() |
| | | if err != nil { |
| | | return ecode.QuotationNotExist |
| | | } |
| | | |
| | | err = model.NewQuotationSearch().SetId(id).Delete() |
| | | if err != nil { |
| | | return ecode.QuotationNotExist |
| | | } |
| | | return ecode.OK |
| | | } |
| | | |
| | | func (QuotationService) UpdateQuotation(quotation *model.Quotation) int { |
| | | // check quotation exist |
| | | _, err := model.NewQuotationSearch().SetId(quotation.Id).Find() |
| | |
| | | } |
| | | return contacts, total, ecode.OK |
| | | } |
| | | |
| | | func (QuotationService) DeleteQuotation(ids []int) int { |
| | | // delete client |
| | | err := model.NewQuotationSearch().SetIds(ids).Delete() |
| | | if err != nil { |
| | | return ecode.QuotationDeleteErr |
| | | } |
| | | return ecode.OK |
| | | } |