Ejemplo n.º 1
0
        public Order_BaseInfo GetOrderByID(int id)
        {
            var order = new Order_BaseInfo();
            if (id <= 0)
                return order;

            try
            {
                using (var context = new EntityMember())
                {
                    var query = from f in context.Order_BaseInfo
                                where
                                    f.ID == id
                                select f;

                    order = query.FirstOrDefault();
                }
            }
            catch (Exception error)
            {
                LogHelper.AppError(error.Message);
            }

            return order;
        }
Ejemplo n.º 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            var name = this.txtName.Text.Trim();
            var email = this.txtEmail.Text.Trim();
            var mobile = this.txtMobile.Text.Trim();
            var cardNo = this.txtIDCardNo.Text.Trim();

            var order = new Order_BaseInfo
            {

            };
            var item = new Order_ItemInfo
            {

            };
            var policyHolder = new Order_PolicyHolder
            {
                 
            };

            var itemList = new List<Order_ItemInfo>();
            itemList.Add(item);
            order.Order_ItemInfo = itemList;

            //item. todo 

            try
            {
                new Repository().AddOrder(order);

                Response.Redirect("confirm.aspx?id=" + order.ID);
            }
            catch
            {

            }
        }
Ejemplo n.º 3
0
        public void AddOrder(Order_BaseInfo order)
        {
            if (order != null)
                return;

            try
            {
                using (var context = new EntityMember())
                {
                    context.Order_BaseInfo.Add(order);

                    foreach (var item in order.Order_ItemInfo)
                        context.Order_ItemInfo.Add(item);

                    context.SaveChanges();
                }

                this.AddLog(JsonConvert.SerializeObject(order), "增加订单", 20, order.CreateMemberID.Value);
            }
            catch (Exception error)
            {
                LogHelper.AppError(error.Message);
            }
        }