public string GenTicketInfo(int num, int amount, DateTime limitTime) { IMeiWei.BLL.ticket bll_tickect = new IMeiWei.BLL.ticket(); IMeiWei.Model.ticket model_ticket = new IMeiWei.Model.ticket(); model_ticket.TicketReferenceId = Guid.NewGuid().ToString(); model_ticket.TicketNumber = num; model_ticket.TicketAmount = amount; model_ticket.LimitTime = limitTime; model_ticket.CreateTime = DateTime.Now; model_ticket.CreateBy = "admin"; bll_tickect.Add(model_ticket); IMeiWei.BLL.ticketinfo bll_ticketInfo = new IMeiWei.BLL.ticketinfo(); for (int i = 1; i <= num; i++) { IMeiWei.Model.ticketinfo model_ticketinfo = new IMeiWei.Model.ticketinfo(); model_ticketinfo.Status = "0"; model_ticketinfo.TicketReferenceId = model_ticket.TicketReferenceId; model_ticketinfo.Code = DateTime.Now.ToString("yyyyMMddHHmmss") + GenCode(i.ToString()); bll_ticketInfo.Add(model_ticketinfo); } return("SUCCESS"); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(IMeiWei.Model.ticketinfo model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(IMeiWei.Model.ticketinfo model) { return(dal.Add(model)); }