Exemplo n.º 1
0
        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");
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(IMeiWei.Model.ticket model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(IMeiWei.Model.ticket model)
 {
     return(dal.Add(model));
 }