public Response <Application> Post(Application application) { try { Application app = ApplicationDAL.Create(application); return(new Response <Application>(app)); } catch (Exception ex) { return(new Response <Application>(ex.Message)); } }
public IApplication Create(string id, string customerId, string region, DateTime?dateApplied, DateTime?dateTraved, string offNoteNo, DateTime?offNoteDate, string remark) { using (var cmd = new DBCommand()) { try { IApplication instance = ApplicationDAL.Create(cmd, id, customerId, region, dateApplied, dateTraved, offNoteNo, offNoteDate, remark); cmd.Commit(); return(instance); } catch (Exception ex) { cmd.RollBack(); using (var builder = new MessageBuilder()) { string err = builder.AppendLine("创建申请单错误!").AppendLine(ex).Message; throw new Exception(err); } } } }