public ActionResult Save(DataBase.Bill_Info entity) { var model = DB.Bill_Info.FindEntity(entity.BillId); model.ExpressCode = entity.ExpressCode; model.ExpressName = entity.ExpressName; model.SendTime = entity.SendTime; model.NickName = entity.NickName; model.Mobile = entity.Mobile; model.PostAddress = entity.PostAddress; var json = DB.Bill_Info.Save(model); if (json.Status == "y") { json.ReUrl = ControllerPath + "/Index"; } return Json(json); }
public JsonResult Save(int goods_num, int productid) { //var goods_num = int.Parse(Request["goods_num"]); //var id = int.Parse(Request["ProductId"]); var product = DB.Product_Info.FindEntity(productid); var member = DB.Member_Info.FindEntity(CurrentUser.Id); var totalPrice = goods_num * product.SalePrice; var model = new DataBase.Bill_Info(); model.ProductId = product.ProductId; model.CategoryId = product.CategoryId; model.CategoryName = product.CategoryName; model.ProductName = product.ProductName; model.ModelName = product.ModelName; model.OriginalPrice = product.OriginalPrice; model.SalePrice = product.SalePrice; model.PV = product.PV; model.Qty = goods_num; model.TotalPrice = totalPrice; model.State = "未发货"; model.MemberId = member.MemberId; model.MemberCode = member.Code; model.NickName = member.NickName; model.PostAddress = member.PostAddress; model.Mobile = member.Mobile; model.CreateTime = DateTime.Now; //model.SendTime = SendTime; model.ExpressName = string.Empty; model.ExpressCode = string.Empty; var r = DB.Bill_Info.Save(model); if (r.IsSuccess) { r.ReUrl = "/Member_Mall/MyBill/Index"; } return(Json(r)); }