protected override string btnModify_Click() { lock (BLL.MHelpMatch.thisLock) { Model.MHelpMatch match = BLL.MHelpMatch.GetModel(Request.Form["hidId"]); if (match != null) { if (match.MatchState == 3) { return("您已确认过收款,申请拒绝交易失败"); } match.PicUrl1 = Request.Form["txtjujuemessage"]; //string Msg = "尊敬的会员:您好,您的手机验证码为[" + match.GetMID + "," + new Random().Next(10000, 999999).ToString() + "],请及时注册,谢谢!"; //Model.SMS model = new Model.SMS { SType = Model.SMSType.QT, Tel = BLL.MMMConfig.Model.JJJYTel, SContent = Msg, SMSKey = match.GetMID }; //string error = ""; //BLL.SMS.Insert(model, ref error); if (BLL.MHelpMatch.Update(match)) { return("1"); } else { return("提交失败!"); } } return("付款记录不存在!"); } }
protected override string btnModify_Click() { lock (BLL.MHelpMatch.thisLock) { Model.MHelpMatch match = BLL.MHelpMatch.GetModel(Request.Form["hidId"]); if (match != null) { if (match.MatchState != 1) { return("您已确认过付款,申请拒绝付款失败"); } match.PicUrl1 = Request.Form["txtjujuemessage"]; if (BLL.MHelpMatch.Update(match)) { return("1"); } else { return("提交失败!"); } } return("付款记录不存在!"); } }
protected override string btnAdd_Click() { string content = Request.Form["content"]; string ccode = Request.Form["ccode"]; string imgs = Request.Form["imgs"]; Model.MHelpMatch match = BLL.MHelpMatch.GetModelByCode(ccode); Model.HelpChat model = new Model.HelpChat() { MatchCode = ccode, SendMID = TModel.MID, SendName = TModel.MName, SendTime = DateTime.Now, TContent = content, SendType = (match.OfferMID == TModel.MID ? 1 : 2), SendImages = imgs }; if (chatBLL.Add(model)) { return("1" + GetChatHtml(model)); } else { return("0发送失败"); } }
protected override string btnAdd_Click() { lock (BLL.MHelpMatch.thisLock) { Model.MHelpMatch match = BLL.MHelpMatch.GetModel(Request.Form["hidId"]); if (match != null && match.OfferPJ == 0) { Hashtable hs = new Hashtable(); int countxj = Convert.ToInt32(Request.Form["ddlPicUrl2"]); if (countxj <= 0) { return("请选择星星评价"); } match.OfferPJ = countxj; Model.Member mget = BLL.Member.GetModelByMID(match.GetMID); int kfcount = 5 - countxj; countxj = mget.MConfig.EPXingCount < kfcount ? mget.MConfig.EPXingCount : kfcount; if (countxj > 0) { hs.Add("update MemberConfig set EPXingCount=EPXingCount-" + countxj + " where MID='" + mget.MID + "';", null); } BLL.MHelpMatch.Update(match, hs); BLL.CommonBase.RunHashtable(hs); } } return("1"); }
//protected string GetMatchState(object matchState) //{ // string result = string.Empty; // if (!string.IsNullOrEmpty(matchState.ToString())) // { // if (matchState.ToString() == "1") // result = "未付款"; // else if (matchState.ToString() == "2") // result = "已付款未确认"; // else if (matchState.ToString() == "3") // result = "已确认"; // } // return result; //} protected override void SetValue(string id) { match = BLL.MHelpMatch.GetModel(id); hidId.Value = id; if (match != null) { //付款方信息 if (match.GetMID == TModel.MID) { tdleft = "收款方"; tdright = "付款方"; model = BLL.Member.ManageMember.GetModel(match.OfferMID); tjmodel = BLL.Member.ManageMember.GetModel(model.MTJ); thismodel = BLL.Member.ManageMember.GetModel(match.GetMID); } else { tdleft = "付款方"; tdright = "收款方"; model = BLL.Member.ManageMember.GetModel(match.GetMID); tjmodel = BLL.Member.ManageMember.GetModel(model.MTJ); thismodel = BLL.Member.ManageMember.GetModel(match.OfferMID); } } }
protected override string btnAdd_Click() { string xx = Request.Form["hidId"]; Model.MHelpMatch match = BLL.MHelpMatch.GetModel(Request.Form["hidId"]); if (match != null) { //DateTime payDate = DateTime.Parse(Request.Form["txtPayTime"]); string remark = Request.Form["txtRemark"]; string pic1 = Request.Form["hduploadPic1"]; string pic2 = Request.Form["uploadPic2"]; string pic3 = Request.Form["uploadPic3"]; //打款必须上传一张图片,否则不能打款 if (string.IsNullOrEmpty(pic1) && string.IsNullOrEmpty(pic2) && string.IsNullOrEmpty(pic3)) { return("2"); } match.MatchState = 2; match.PayTime = DateTime.Now; match.PicUrl = pic1; match.PicUrl1 = pic2; match.PicUrl2 = pic3; Hashtable MyHs = new Hashtable(); ///不需要达人奖 /// //Model.MOfferHelp off = BLL.MOfferHelp.GetModel(match.OfferId); //if (Convert.ToDecimal(((DateTime)match.PayTime - match.MatchTime).TotalMinutes) <= BLL.MMMConfig.Model.HonestyHour) //{ // if (off.SincerityState == 0) // { // off.SincerityState = 1; // BLL.MOfferHelp.Update(off, MyHs); // } //} if (BLL.CommonBase.RunHashtable(BLL.MHelpMatch.Update(match, MyHs))) { //Model.Member getMember = BLL.Member.GetModelByMID(match.GetMID); //Model.MGetHelp get = BLL.MGetHelp.GetModel(match.GetId); //string Msg = "尊敬的会员您好!您订单号" + get.SQCode + "得到帮助的订单对方已汇款(匹配编号[" + match.MatchCode + "]),核实无误后请确认,感谢您的参与!祝您生活愉快!"; //Model.SMS model = new Model.SMS { SType = Model.SMSType.ZCYZ, Tel = getMember.Tel, SContent = Msg }; //string error = ""; //BLL.SMS.Insert(model, ref error); return("1"); } } return("0"); }
protected override string btnAdd_Click() { lock (BLL.MHelpMatch.thisLock) { //匹配记录 Model.MHelpMatch match = BLL.MHelpMatch.GetModel(Request.Form["hidId"]); if (match != null) { Hashtable MyHs = new Hashtable(); //收款 string result = BLL.MHelpMatch.GetMoney(match, Request.Form["ddlPicUrl3"], MyHs); if (string.IsNullOrEmpty(result)) { if (BLL.CommonBase.RunHashtable(MyHs)) { Model.Member member1 = BLL.Member.GetModelByMID(match.OfferMID); Model.MOfferHelp offer = BLL.MOfferHelp.GetModel(match.OfferId); //BLL.CommonBase.RunHashtable(BLL.Member.UpdateTran(member1.MID, "AgencyCode", "003", null, true, SqlDbType.VarChar, new Hashtable())); //Model.SHMoney shmoney = BLL.Configuration.Model.SHMoneyList["003"]; //BllModel.UpMAgencyType(shmoney, member1.MID, member1, 0, new Hashtable()); //member1.AgencyCode = "003"; //member1.MAgencyType = shmoney; //BLL.ChangeMoney.R_SJ(member1.MID); //string Msg = "尊敬的会员您好!您订单号" + offer.SQCode + "买入许愿果的订单已经确认收款(匹配编号[" + match.MatchCode + "]),请注意查看,感谢您的参与!祝您生活愉快!"; //Model.SMS model = new Model.SMS { SType = Model.SMSType.QT, Tel = member1.Tel, SContent = Msg }; //string error = ""; //BLL.SMS.Insert(model, ref error); return("1"); } else { return("确认收款失败"); } } else { return(result); } } return("付款记录不存在!"); } }
protected override void SetValue(string id) { match = BLL.MHelpMatch.GetModel(id); hidId.Value = id; if (match != null) { getMemberModel = BllModel.GetModel(match.GetMID); getTJMemberModel = BllModel.GetModel(getMemberModel.MTJ); spLeaveTime.InnerHtml = MatchTimeLeave(match, MMMMatchTimeType.PayLimitTime, "打款倒计时", ""); ////剩余付款时间 //DateTime matchTime = match.MatchTime; //DateTime matchTimeAdd = matchTime.AddMinutes(BLL.MMMConfig.Model.PayLimitTimes); //if (match.ChangeCount == 1) //{ // matchTimeAdd = matchTime.AddMinutes(BLL.MMMConfig.Model.PayLimitTimesPre); //} //TimeSpan d3 = matchTimeAdd.Subtract(DateTime.Now); //long totalMM = Convert.ToInt64(Math.Round(d3.TotalMilliseconds, 0).ToString()); //spLeaveTime.InnerHtml = (totalMM / 3600000).ToString() + "小时" + ((totalMM / 60000) % 60).ToString() + "分钟" + ((totalMM / 1000) % 60).ToString() + "秒"; } }
protected override void SetValue(string id) { match = BLL.MHelpMatch.GetModel(id); hidId.Value = id; if (match != null) { getMemberModel = BllModel.GetModel(match.OfferMID); getTJMemberModel = BllModel.GetModel(getMemberModel.MTJ); spLeaveTime.InnerHtml = MatchTimeLeave(match, MMMMatchTimeType.ConfirmLimitTime, "收款确认倒计时", ""); //DateTime PayTime = Convert.ToDateTime(match.PayTime); //DateTime matchTimeAdd = PayTime.AddMinutes(BLL.MMMConfig.Model.ConfirmLimitTimes);//以分钟计算 //TimeSpan d3 = matchTimeAdd.Subtract(DateTime.Now); //long totalMM = Convert.ToInt64(Math.Round(d3.TotalMilliseconds, 0).ToString()); ////totalMM = totalMM * 60000; //spLeaveTime.InnerHtml = (totalMM / 3600000).ToString() + "小时" + ((totalMM / 60000) % 60).ToString() + "分钟" + ((totalMM / 1000) % 60).ToString() + "秒"; if (match.MatchState == 2) { btnOK.Visible = true; } txtjujuemessage.Value = match.PicUrl1; } }
/// <summary> /// 增加一条数据 /// </summary> public static Hashtable Insert(Model.MHelpMatch model, Hashtable MyHs) { string guid = Guid.NewGuid().ToString(); StringBuilder strSql = new StringBuilder(); strSql.Append("insert into MHelpMatch("); strSql.Append("Remark,OfferMID,GetMID,MatchCode,OfferId,GetId,MatchTime,PayTime,ConfirmTime,MatchState,PicUrl,MatchMoney,PicUrl1,PicUrl2,ChangeCount,ChangeMTJTime,ChangeVIPTime,PicUrl3,MatchType,OfferPJ,GetPJ,DKNote"); strSql.Append(") values ("); strSql.Append("@Remark,@OfferMID,@GetMID,@MatchCode,@OfferId,@GetId,@MatchTime,@PayTime,@ConfirmTime,@MatchState,@PicUrl,@MatchMoney,@PicUrl1,@PicUrl2,@ChangeCount,@ChangeMTJTime,@ChangeVIPTime,@PicUrl3,@MatchType,@OfferPJ,@GetPJ,@DKNote"); strSql.Append(") "); strSql.AppendFormat(";select '{0}'", guid); SqlParameter[] parameters = { new SqlParameter("@Remark", SqlDbType.VarChar, 500), new SqlParameter("@OfferMID", SqlDbType.VarChar, 50), new SqlParameter("@GetMID", SqlDbType.VarChar, 50), new SqlParameter("@MatchCode", SqlDbType.VarChar, 50), new SqlParameter("@OfferId", SqlDbType.Int, 4), new SqlParameter("@GetId", SqlDbType.Int, 4), new SqlParameter("@MatchTime", SqlDbType.DateTime), new SqlParameter("@PayTime", SqlDbType.DateTime), new SqlParameter("@ConfirmTime", SqlDbType.DateTime), new SqlParameter("@MatchState", SqlDbType.Int, 4), new SqlParameter("@PicUrl", SqlDbType.VarChar, 500), new SqlParameter("@MatchMoney", SqlDbType.Decimal, 9), new SqlParameter("@PicUrl1", SqlDbType.VarChar, 500), new SqlParameter("@PicUrl2", SqlDbType.VarChar, 500), new SqlParameter("@ChangeCount", SqlDbType.Int, 4), new SqlParameter("@ChangeMTJTime", SqlDbType.DateTime), new SqlParameter("@ChangeVIPTime", SqlDbType.DateTime), new SqlParameter("@PicUrl3", SqlDbType.VarChar, 500), new SqlParameter("@MatchType", SqlDbType.Int, 4), new SqlParameter("@OfferPJ", SqlDbType.Int, 4), new SqlParameter("@GetPJ", SqlDbType.Int, 4), new SqlParameter("@DKNote", SqlDbType.VarChar, 500) }; parameters[0].Value = model.Remark; parameters[1].Value = model.OfferMID; parameters[2].Value = model.GetMID; parameters[3].Value = model.MatchCode; parameters[4].Value = model.OfferId; parameters[5].Value = model.GetId; parameters[6].Value = model.MatchTime; parameters[7].Value = model.PayTime; parameters[8].Value = model.ConfirmTime; parameters[9].Value = model.MatchState; parameters[10].Value = model.PicUrl; parameters[11].Value = model.MatchMoney; parameters[12].Value = model.PicUrl1; parameters[13].Value = model.PicUrl2; parameters[14].Value = model.ChangeCount; parameters[15].Value = model.ChangeMTJTime; parameters[16].Value = model.ChangeVIPTime; parameters[17].Value = model.PicUrl3; parameters[18].Value = model.MatchType; parameters[19].Value = model.OfferPJ; parameters[20].Value = model.GetPJ; parameters[21].Value = model.DKNote; MyHs.Add(strSql.ToString(), parameters); return(MyHs); }
/// <summary> /// 实体转换 /// <summary> private static Model.MHelpMatch TranEntity(DataRow dr) { if (dr != null) { Model.MHelpMatch model = new Model.MHelpMatch(); if (!string.IsNullOrEmpty(dr["Id"].ToString())) { model.Id = int.Parse(dr["Id"].ToString()); } model.Remark = dr["Remark"].ToString(); model.DKNote = dr["DKNote"].ToString(); model.OfferMID = dr["OfferMID"].ToString(); model.GetMID = dr["GetMID"].ToString(); model.MatchCode = dr["MatchCode"].ToString(); if (!string.IsNullOrEmpty(dr["OfferId"].ToString())) { model.OfferId = int.Parse(dr["OfferId"].ToString()); } if (!string.IsNullOrEmpty(dr["GetId"].ToString())) { model.GetId = int.Parse(dr["GetId"].ToString()); } if (!string.IsNullOrEmpty(dr["MatchTime"].ToString())) { model.MatchTime = DateTime.Parse(dr["MatchTime"].ToString()); } if (!string.IsNullOrEmpty(dr["PayTime"].ToString())) { model.PayTime = DateTime.Parse(dr["PayTime"].ToString()); } if (!string.IsNullOrEmpty(dr["ConfirmTime"].ToString())) { model.ConfirmTime = DateTime.Parse(dr["ConfirmTime"].ToString()); } if (!string.IsNullOrEmpty(dr["MatchState"].ToString())) { model.MatchState = int.Parse(dr["MatchState"].ToString()); } if (!string.IsNullOrEmpty(dr["MatchType"].ToString())) { model.MatchType = int.Parse(dr["MatchType"].ToString()); } model.PicUrl = dr["PicUrl"].ToString(); model.PicUrl1 = dr["PicUrl1"].ToString(); model.PicUrl2 = dr["PicUrl2"].ToString(); model.PicUrl3 = dr["PicUrl3"].ToString(); if (!string.IsNullOrEmpty(dr["MatchMoney"].ToString())) { model.MatchMoney = decimal.Parse(dr["MatchMoney"].ToString()); } if (!string.IsNullOrEmpty(dr["ChangeCount"].ToString())) { model.ChangeCount = int.Parse(dr["ChangeCount"].ToString()); } if (!string.IsNullOrEmpty(dr["ChangeMTJTime"].ToString())) { model.ChangeMTJTime = DateTime.Parse(dr["ChangeMTJTime"].ToString()); } if (!string.IsNullOrEmpty(dr["ChangeVIPTime"].ToString())) { model.ChangeVIPTime = DateTime.Parse(dr["ChangeVIPTime"].ToString()); } if (!string.IsNullOrEmpty(dr["OfferPJ"].ToString())) { model.OfferPJ = int.Parse(dr["OfferPJ"].ToString()); } if (!string.IsNullOrEmpty(dr["GetPJ"].ToString())) { model.GetPJ = int.Parse(dr["GetPJ"].ToString()); } return(model); } else { return(null); } }
/// <summary> /// 更新一条数据 /// </summary> public static bool Update(Model.MHelpMatch model) { return(DAL.CommonBase.RunHashtable(Update(model, new Hashtable()))); }
/// <summary> /// 更新一条数据 /// </summary> public static Hashtable Update(Model.MHelpMatch model, Hashtable MyHs) { string guid = Guid.NewGuid().ToString(); StringBuilder strSql = new StringBuilder(); strSql.Append("update MHelpMatch set "); strSql.Append(" Remark = @Remark , "); strSql.Append(" OfferMID = @OfferMID , "); strSql.Append(" GetMID = @GetMID , "); strSql.Append(" MatchCode = @MatchCode , "); strSql.Append(" OfferId = @OfferId , "); strSql.Append(" GetId = @GetId , "); strSql.Append(" MatchTime = @MatchTime , "); strSql.Append(" PayTime = @PayTime , "); strSql.Append(" ConfirmTime = @ConfirmTime , "); strSql.Append(" MatchState = @MatchState , "); strSql.Append(" PicUrl = @PicUrl, "); strSql.Append(" MatchMoney = @MatchMoney, "); strSql.Append(" PicUrl1 = @PicUrl1, "); strSql.Append(" PicUrl2 = @PicUrl2, "); strSql.Append(" PicUrl3 = @PicUrl3, "); strSql.Append(" ChangeCount = @ChangeCount, "); strSql.Append(" ChangeMTJTime = @ChangeMTJTime, "); strSql.Append(" MatchType = @MatchType, "); strSql.Append(" ChangeVIPTime = @ChangeVIPTime, "); strSql.Append(" OfferPJ = @OfferPJ, "); strSql.Append(" GetPJ = @GetPJ, "); strSql.Append(" DKNote = @DKNote "); strSql.Append(" where Id=@Id "); strSql.AppendFormat(" ;select '{0}'", guid); SqlParameter[] parameters = { new SqlParameter("@Id", SqlDbType.Int, 4), new SqlParameter("@Remark", SqlDbType.VarChar, 500), new SqlParameter("@OfferMID", SqlDbType.VarChar, 50), new SqlParameter("@GetMID", SqlDbType.VarChar, 50), new SqlParameter("@MatchCode", SqlDbType.VarChar, 50), new SqlParameter("@OfferId", SqlDbType.Int, 4), new SqlParameter("@GetId", SqlDbType.Int, 4), new SqlParameter("@MatchTime", SqlDbType.DateTime), new SqlParameter("@PayTime", SqlDbType.DateTime), new SqlParameter("@ConfirmTime", SqlDbType.DateTime), new SqlParameter("@MatchState", SqlDbType.Int, 4), new SqlParameter("@PicUrl", SqlDbType.VarChar, 500), new SqlParameter("@MatchMoney", SqlDbType.Decimal, 9), new SqlParameter("@PicUrl1", SqlDbType.VarChar, 500), new SqlParameter("@PicUrl2", SqlDbType.VarChar, 500), new SqlParameter("@ChangeCount", SqlDbType.Int, 4), new SqlParameter("@ChangeMTJTime", SqlDbType.DateTime), new SqlParameter("@ChangeVIPTime", SqlDbType.DateTime), new SqlParameter("@PicUrl3", SqlDbType.VarChar, 500), new SqlParameter("@MatchType", SqlDbType.Int, 4), new SqlParameter("@OfferPJ", SqlDbType.Int, 4), new SqlParameter("@GetPJ", SqlDbType.Int, 4), new SqlParameter("@DKNote", SqlDbType.VarChar, 500) }; parameters[0].Value = model.Id; parameters[1].Value = model.Remark; parameters[2].Value = model.OfferMID; parameters[3].Value = model.GetMID; parameters[4].Value = model.MatchCode; parameters[5].Value = model.OfferId; parameters[6].Value = model.GetId; parameters[7].Value = model.MatchTime; parameters[8].Value = model.PayTime; parameters[9].Value = model.ConfirmTime; parameters[10].Value = model.MatchState; parameters[11].Value = model.PicUrl; parameters[12].Value = model.MatchMoney; parameters[13].Value = model.PicUrl1; parameters[14].Value = model.PicUrl2; parameters[15].Value = model.ChangeCount; parameters[16].Value = model.ChangeMTJTime; parameters[17].Value = model.ChangeVIPTime; parameters[18].Value = model.PicUrl3; parameters[19].Value = model.MatchType; parameters[20].Value = model.OfferPJ; parameters[21].Value = model.GetPJ; parameters[22].Value = model.DKNote; MyHs.Add(strSql.ToString(), parameters); return(MyHs); }
/// <summary> /// 增加一条数据 /// </summary> public static bool Insert(Model.MHelpMatch model) { return(DAL.CommonBase.RunHashtable(Insert(model, new Hashtable()))); }