Exemplo n.º 1
0
        public ActionResult SaveNewTicket(TicketCreateVM createModel)
        {
            try
            {
                using (var dbContext = new TicketCodeTestDBContext())
                {
                    var dbTicket = new Tticket();
                    var dbCustom = new Tcustomer();
                    var dbBill   = new Tbill();
                    dbCustom.Name       = createModel.custormername;
                    dbCustom.SaleMan    = createModel.saleman;
                    dbCustom.SaleCount  = createModel.salecount;
                    dbCustom.SaleAmount = createModel.saleamount;



                    dbContext.Tcustomer.Add(dbCustom);
                }


                StringBuilder sbr = new StringBuilder();
                DapperWrapper.Insert(sbr.ToString());
                return(Json(new { success = true, msg = "保存成功" }));
            }
            catch (Exception ex)
            {
                return(Json(new
                {
                    success = false,
                    msg = ex.ToString()
                }));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 新增编辑页面
        /// </summary>
        /// <param name="saledticketid"></param>
        /// <returns></returns>
        public ActionResult CreateNewSaleTicket(int saledticketid)
        {
            var model = new TicketCreateVM();

            if (saledticketid > 0)
            {
                //编辑界面
                var sql = "select * from dbo.ticketinfo where saledticketid=" + saledticketid;
                //var dbTicket = DapperWrapper.GetSingle<dbTicket>(sql);
            }

            return(View(model));
        }
Exemplo n.º 3
0
        public IActionResult Create([FromBody] TicketCreateVM ticket)
        {
            var id = ticketService.CreateTicket(ticket);

            return(Identifier(id));
        }
Exemplo n.º 4
0
        public int CreateTicket(TicketCreateVM ticket)
        {
            var dto = mapper.ConvertTo <TicketCreateDTO>(ticket);

            return(ticketRepository.CreateTicket(dto));
        }