public override ActionResult UpdateSubmit(FormCollection fm) { var viewModel = this.GetViewModel(fm); var model = new XCLCMS.Data.Model.Orders(); model.OrderID = viewModel.Orders.OrderID; model.RecordState = viewModel.Orders.RecordState; model.FK_MerchantAppID = viewModel.Orders.FK_MerchantAppID; model.FK_MerchantID = viewModel.Orders.FK_MerchantID; model.Remark = viewModel.Orders.Remark; model.Price = viewModel.Orders.Price; model.PayType = viewModel.Orders.PayType; model.FK_UserID = viewModel.Orders.FK_UserID; model.UserName = viewModel.Orders.UserName; model.Version = viewModel.Orders.Version; model.ContactName = viewModel.Orders.ContactName; model.Email = viewModel.Orders.Email; model.Mobile = viewModel.Orders.Mobile; model.OtherContact = viewModel.Orders.OtherContact; var request = XCLCMS.Lib.WebAPI.Library.CreateRequest <XCLCMS.Data.Model.Orders>(base.UserToken); request.Body = new Data.Model.Orders(); request.Body = model; var response = XCLCMS.Lib.WebAPI.OrdersAPI.Update(request); return(Json(response)); }
public override ActionResult AddSubmit(FormCollection fm) { var viewModel = this.GetViewModel(fm); var model = new XCLCMS.Data.Model.Orders(); model.OrderID = XCLCMS.Lib.Common.FastAPI.CommonAPI_GenerateID(base.UserToken, new Data.WebAPIEntity.RequestEntity.Common.GenerateIDEntity() { IDType = Data.CommonHelper.EnumType.IDTypeEnum.ORD.ToString() }); model.RecordState = viewModel.Orders.RecordState; model.FK_MerchantAppID = viewModel.Orders.FK_MerchantAppID; model.FK_MerchantID = viewModel.Orders.FK_MerchantID; model.Remark = viewModel.Orders.Remark; model.Price = viewModel.Orders.Price; model.FK_ProductID = viewModel.Orders.FK_ProductID; model.FK_UserID = viewModel.Orders.FK_UserID; model.UserName = viewModel.Orders.UserName; model.PayType = viewModel.Orders.PayType; model.Version = viewModel.Orders.Version; model.ContactName = viewModel.Orders.ContactName; model.Email = viewModel.Orders.Email; model.Mobile = viewModel.Orders.Mobile; model.OtherContact = viewModel.Orders.OtherContact; var request = XCLCMS.Lib.WebAPI.Library.CreateRequest <XCLCMS.Data.Model.Orders>(base.UserToken); request.Body = new Data.Model.Orders(); request.Body = model; var response = XCLCMS.Lib.WebAPI.OrdersAPI.Add(request); return(Json(response)); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(XCLCMS.Data.Model.Orders model) { Database db = base.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("sp_Orders_Update"); db.AddInParameter(dbCommand, "OrderID", DbType.Int64, model.OrderID); db.AddInParameter(dbCommand, "FK_ProductID", DbType.Int64, model.FK_ProductID); db.AddInParameter(dbCommand, "FK_MerchantID", DbType.Int64, model.FK_MerchantID); db.AddInParameter(dbCommand, "FK_MerchantAppID", DbType.Int64, model.FK_MerchantAppID); db.AddInParameter(dbCommand, "FK_UserID", DbType.Int64, model.FK_UserID); db.AddInParameter(dbCommand, "UserName", DbType.String, model.UserName); db.AddInParameter(dbCommand, "Price", DbType.Decimal, model.Price); db.AddInParameter(dbCommand, "PayStatus", DbType.AnsiString, model.PayStatus); db.AddInParameter(dbCommand, "PayType", DbType.AnsiString, model.PayType); db.AddInParameter(dbCommand, "DealDoneTime", DbType.DateTime, model.DealDoneTime); db.AddInParameter(dbCommand, "FlowStatus", DbType.Int32, model.FlowStatus); db.AddInParameter(dbCommand, "ContactName", DbType.String, model.ContactName); db.AddInParameter(dbCommand, "Email", DbType.AnsiString, model.Email); db.AddInParameter(dbCommand, "Mobile", DbType.AnsiString, model.Mobile); db.AddInParameter(dbCommand, "OtherContact", DbType.String, model.OtherContact); db.AddInParameter(dbCommand, "TransactionNO", DbType.AnsiString, model.TransactionNO); db.AddInParameter(dbCommand, "Version", DbType.Int32, model.Version); db.AddInParameter(dbCommand, "Remark", DbType.AnsiString, model.Remark); db.AddInParameter(dbCommand, "RecordState", DbType.AnsiString, model.RecordState); db.AddInParameter(dbCommand, "CreateTime", DbType.DateTime, model.CreateTime); db.AddInParameter(dbCommand, "CreaterID", DbType.Int64, model.CreaterID); db.AddInParameter(dbCommand, "CreaterName", DbType.String, model.CreaterName); db.AddInParameter(dbCommand, "UpdateTime", DbType.DateTime, model.UpdateTime); db.AddInParameter(dbCommand, "UpdaterID", DbType.Int64, model.UpdaterID); db.AddInParameter(dbCommand, "UpdaterName", DbType.String, model.UpdaterName); db.AddOutParameter(dbCommand, "ResultCode", DbType.Int32, 4); db.AddOutParameter(dbCommand, "ResultMessage", DbType.String, 1000); db.ExecuteNonQuery(dbCommand); var result = XCLCMS.Data.DAL.Common.Common.GetProcedureResult(dbCommand.Parameters); if (result.IsSuccess) { return(true); } else { throw new Exception(result.ResultMessage); } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(XCLCMS.Data.Model.Orders model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(XCLCMS.Data.Model.Orders model) { return(dal.Update(model)); }