public bool SaveTicket(Ticket pObjTicket, bool pBolIsUpdate) { try { TicketService lObjTicketService = new TicketService(); FoodProductionSeviceFactory lObjFoodProductionFactory = new FoodProductionSeviceFactory(); if (pBolIsUpdate) { //lObjConfig.RowCode = mObjConfigurationService.GetConfigurationService().GetConfigCode("Code", lObjConfig.Name); pObjTicket.RowCode = lObjFoodProductionFactory.GetTicketService().GetTicketCode("", pObjTicket.Folio); if (lObjTicketService.Update(pObjTicket) != 0) { return(false); } LogService.WriteSuccess("[Update Ticket] Folio:" + pObjTicket.Folio); } else { if (lObjTicketService.Add(pObjTicket) != 0) { string error = DIApplication.Company.GetLastErrorDescription(); return(false); } LogService.WriteSuccess("[Add Ticket] Folio:" + pObjTicket.Folio); } } catch (Exception ex) { LogService.WriteError("[SaveTicket]: " + ex.Message); LogService.WriteError(ex); UIApplication.ShowMessageBox(string.Format("SaveTicket: {0}", ex.Message)); return(false); } return(true); }
public string getRowCodeDetail(string pStrFolio, int pIntItem) { FoodProductionSeviceFactory lObjFoodProductionFactory = new FoodProductionSeviceFactory(); return(lObjFoodProductionFactory.GetTicketDetailService().GetTicketCode("", pStrFolio, pIntItem)); }