public bool SavePayList(PatiPayListEntity newPayment, UserCardEntity usercard) { using (TransactionScope trans = new TransactionScope()) { try { bool isTrue = access.Save(newPayment); if (isTrue == false) { return(false); } isTrue = cardAccess.Update(usercard); if (isTrue == false) { return(false); } trans.Complete(); return(true); } catch (Exception ex) { return(false); } } }
public bool Update(PatiPayListEntity obj) { try { Update("PatiPayListMap.Update", obj); return(true); } catch { return(false); } }
public bool Save(PatiPayListEntity obj) { try { Insert("PatiPayListMap.Insert", obj); return(true); } catch { return(false); } }
public PatiPayListEntity Load(string PayId) { try { PatiPayListEntity payEntity = QueryForObject <PatiPayListEntity>("PatiPayListMap.Load", PayId); return(payEntity); } catch (Exception) { throw; } }
public ActionResult SavePatiPayList(PatiPayListEntity payInfo) { string CreateUser = HttpContext.ApplicationInstance.Context.Request.Cookies["UserId"].Value; payInfo.PayId = CreateUser + DateTime.Now.ToString("yyMMddHHmmssff"); payInfo.Direction = 1; payInfo.CreateDate = DateTime.Now; payInfo.CreateUser = CreateUser; UserCardEntity cardEnty = usercardLogic.Load(payInfo.CardId); cardEnty.PreAmount = cardEnty.PreAmount + payInfo.PayAmount; bool isok = payLogic.SavePayList(payInfo, cardEnty); return(Json(isok, JsonRequestBehavior.AllowGet)); }
public JsonResult CancelPayment(string payid, string CNote) { string userid = HttpContext.ApplicationInstance.Context.Request.Cookies["UserId"].Value; string orgid = HttpContext.ApplicationInstance.Context.Request.Cookies["OrgId"].Value; if (string.IsNullOrEmpty(payid)) { return(Json(false)); } PatiPayListEntity paOld = payLogic.Load(payid); if (paOld == null) { return(Json(false)); } PatiPayListEntity newPay = payLogic.Load(payid); newPay.CancId = newPay.PayId; newPay.PayId = userid + "-PayId-" + DateTime.Now.ToString("yyMMddHHmmss"); newPay.Direction = -1; newPay.CancReason = ""; newPay.CancDate = DateTime.Now; newPay.CancUser = userid; paOld.CancDate = DateTime.Now; paOld.CancUser = userid; paOld.CancReason = CNote; paOld.CancId = newPay.PayId; //OldPersonInvisitEntity person = oldLogic.Load(paOld.SerialNum); //person.UpdateDate = DateTime.Now; //person.UpdateUser = userid; //person.PreAmount = person.PreAmount - paOld.PayAmount; //PatiIn_Pay_InvoiceEntity voice = voiceLogic.LoadByPayId(payid); //voice.CancDate = DateTime.Now; //voice.CancUser = userid; //voice.CancReason = CNote; //bool isOK = payLogic.CancelPayAndVoice(newPay,paOld,person,voice); return(Json(true)); }
public bool SavePayListVoice(PatiPayListEntity payEnty, PatiIn_Pay_InvoiceEntity payInVoice) { try { SqlMapClientTemplate.mapper.BeginTransaction(); Insert("PatiPayListMap.Insert", payEnty); Insert("PatiIn_Pay_InvoiceMap.Insert", payInVoice); //Update("OldPersonInvisitMap.Update", visit); //Fin_Invoice_StoreEntity store = new Fin_Invoice_StoreEntity(); //Update("Fin_Invoice_StoreMap.UpdateNowInvoice", store); SqlMapClientTemplate.mapper.CommitTransaction(); return(true); } catch (Exception ex) { SqlMapClientTemplate.mapper.RollBackTransaction(); return(false); } }
public bool BackUserFee(string applyId, string backUserId) { using (TransactionScope trans = new TransactionScope()) { try { bool isok = true; RefundsApplyEntity entity = access.Load(applyId); entity.BackUserId = backUserId; entity.BackDate = DateTime.Now; entity.IsBack = "1"; isok = access.Update(entity); if (isok == false) { return(false); } UserInfoEntity user = userAccess.Load(entity.UserId); if (user != null) { UserCardEntity cardEnty = usercardAccess.Load(user.CardId); cardEnty.PreAmount = cardEnty.PreAmount - entity.Amount; cardEnty.UpdateDate = DateTime.Now; cardEnty.UpdateUser = backUserId; isok = usercardAccess.Update(cardEnty); if (isok == false) { return(false); } } PatiPayListEntity payInfo = new PatiPayListEntity(); payInfo.PayId = backUserId + DateTime.Now.ToString("yyMMddHHmmssff"); payInfo.UserId = entity.UserId; payInfo.CardId = user.CardId; payInfo.Direction = -1; payInfo.CreateDate = DateTime.Now; payInfo.CreateUser = backUserId; payInfo.PayAmount = entity.Amount; isok = paylistLogic.Save(payInfo); // 保存数据。 if (isok == true) { trans.Complete(); return(true); } else { return(false); } } catch (Exception ex) { return(false); } } }
public bool Update(PatiPayListEntity obj) { return(access.Update(obj)); }