protected void Button1_Click(object sender, EventArgs e) { string number = Request.QueryString["number"]; string rmid = Request.QueryString["repid"]; string ip = Request.UserHostAddress.ToString(); string orderid = Request.QueryString["orderid"]; double remark = 0; if (TextBox1.Text.Trim() != "") { bool b = double.TryParse(TextBox1.Text.Trim(), out remark); if (!b) { ClientScript.RegisterStartupScript(GetType(), "aaa", "alert('实汇金额只能输入数字!');", true); return; } //if (remark > Convert.ToDouble(Label2.Text.Trim().Substring(1))) //{ // ClientScript.RegisterStartupScript(GetType(), "aaa", "alert('实汇金额不能大于汇款金额!');", true); // return; //} } else { ClientScript.RegisterStartupScript(GetType(), "aaa", "alert('实汇金额不能为空!');", true); return; } int res = -1; int res1 = -1; DataTable remittancedt = RemittancesDAL.GetRemittanceinfobyremid(rmid); string oper = Session["company"].ToString(); string opip = Request.UserHostAddress.ToString(); if (remittancedt != null && remittancedt.Rows.Count > 0) { int roltype = Convert.ToInt32(remittancedt.Rows[0]["RemitStatus"]) == 0 ? 2 : 1; string ord = remittancedt.Rows[0]["RelationOrderID"].ToString(); double totalrmbmoney = Convert.ToDouble(TextBox1.Text.Trim()); int isgsqr = Convert.ToInt32(remittancedt.Rows[0]["isgsqr"]); int dotype = 0; if (ord == "") { dotype = 2; } else { dotype = 1; } if (isgsqr == 0) { res = AddOrderDataDAL.OrderPayment(oper, ord, opip, roltype, dotype, 0, oper, "", 3, 1, 1, 1, rmid, totalrmbmoney, ""); DataTable dt_one = DAL.DBHelper.ExecuteDataTable("select Ispipei,IsJL from remittances where RemittancesID='" + rmid + "'"); string Ispipie = dt_one.Rows[0]["Ispipei"].ToString(); //汇款id string IsJL = dt_one.Rows[0]["IsJL"].ToString(); //汇款id if (Ispipie == "1" && IsJL == "1") { res1 = AddOrderDataDAL.OrderPayment1(rmid); } } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('该汇款单已确认,不能重复操作!');window.close();</script>"); } } if (res == 0) { PublicClass.SendMsg(1, remittancedt.Rows[0]["RelationOrderID"].ToString(), ""); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('确认收款成功!');window.opener.location.href='DoSeecan.aspx';window.close();;</script>"); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('确认收款失败!');</script>"); } }
public int DoControlRemit(int ctype, string rmidstr) { int errorinfo = 0; int ges = -1; NumberByBit nbt = new NumberByBit(); string desstrm = nbt.DecryptDES(rmidstr, "20120518"); string[] srmps = desstrm.Split(','); string rmid = ""; string oper = ""; string opip = ""; if (srmps.Length >= 3) { rmid = srmps[0].ToString(); oper = srmps[1].ToString(); opip = srmps[2].ToString(); } DataTable remittancedt = RemittancesDAL.GetRemittanceinfobyremid(rmid); if (remittancedt != null && remittancedt.Rows.Count > 0) { int roltype = Convert.ToInt32(remittancedt.Rows[0]["RemitStatus"]) == 0 ? 2 : 1; string orderid = remittancedt.Rows[0]["RelationOrderID"].ToString(); double totalrmbmoney = Convert.ToDouble(DBHelper.ExecuteScalar("select isnull(totalrmbmoney,0) from remtemp where remittancesid='" + rmid + "'")); int dotype = 0; if (orderid == "") { dotype = 2; } else { dotype = 1; } ges = AddOrderDataDAL.OrderPayment(oper, orderid, opip, roltype, dotype, -1, oper, "", 3, ctype, 1, 1, rmid, totalrmbmoney, "");;// AddOrderDataDAL.PaymentChongzhi(desstrm, ctype); } double tomoney = 0; //if (ges == 0 || ges == 7) //{ //// 短信 //SqlConnection con = null; //SqlTransaction tran = null; //string info = string.Empty; //tomoney = Convert.ToDouble(DBHelper.ExecuteScalar("select isnull(totalrmbmoney,0) from dbo.remtemp where remittancesid='" + rmid + "'")); //string acnumber = DBHelper.ExecuteScalar("select number from dbo.MemberRemittances where remittancesid='" + rmid + "'").ToString(); ////手机号码 //object mt = DAL.DBHelper.ExecuteScalar("select MobileTele from memberinfo where number ='" + acnumber + "'"); //string sjhm = mt == null ? "" : mt.ToString(); ////支付的金额 //string zfje = tomoney.ToString("f2"); //if (sjhm != "" && oper != "") //{ // string sendinfo = "管理员" + oper + "已经成功确认发展商 " + acnumber + " 的支付【" + zfje + "元人民币】,充值成功,请及时登录查看!"; // if (ges == 7) // { // sendinfo = "管理员" + oper + "已经成功确认发展商 " + acnumber + " 的支付【" + zfje + "元人民币】,发展商 " + acnumber + " 的账号已成功激活,请及时登录查看!"; // } // try // { // con = DAL.DBHelper.SqlCon(); // con.Open(); // tran = con.BeginTransaction(); // bool bo = true;// BLL.MobileSMS.SendMsgMode(tran, "", sendinfo, acnumber, sjhm, "", Model.SMSCategory.sms_Active); // if (bo) // tran.Commit(); // else // tran.Rollback(); // } // catch (Exception ee) // { // if (tran != null) // tran.Rollback(); // } // finally // { // con.Close(); // } //} // errorinfo = 1; //} //else //{ // errorinfo = 0; //} return(ges); }
protected void btnsureget_Click(object sender, EventArgs e) { int mtype = Convert.ToInt32(this.hidtype.Value); if (this.hidremid.Value == "") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("007813", "请选择待支付的汇款单") + "!');</script>"); return; } if (this.txtgettime.Text == "") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("007814", "请填写收款时间") + "!');</script>"); return; } DateTime time = Convert.ToDateTime(this.txtgettime.Text + " " + this.ddlhours.SelectedValue + ":" + this.ddlmins.SelectedValue + ":" + this.ddlsecs.SelectedValue); int res = -1; string opip = Request.UserHostAddress.ToString(); string opter = Session["company"].ToString(); string rmid = this.hidremid.Value; DataTable remittancedt = RemittancesDAL.GetRemittanceinfobyremid(rmid); if (remittancedt != null && remittancedt.Rows.Count > 0) { int roltype = Convert.ToInt32(remittancedt.Rows[0]["RemitStatus"]) == 0?2:1; string ord = remittancedt.Rows[0]["RelationOrderID"].ToString(); double totalrmbmoney = Convert.ToDouble(lblmoney.Text.Trim()); string remitnumber = remittancedt.Rows[0]["remitnumber"].ToString(); int isgsqr = Convert.ToInt32(remittancedt.Rows[0]["isgsqr"]); int dotype = 0; if (ord == "") { dotype = 2; } else { dotype = 1; } if (isgsqr == 0) { res = AddOrderDataDAL.OrderPayment(remitnumber, ord, opip, roltype, dotype, 0, opter, "", 4, 1, 1, 1, rmid, totalrmbmoney, ""); // } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("007815", "该汇款单已确认,不能重复操作") + "!');window.close();</script>"); } } if (res == 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("007816", "确认收款成功") + "!');</script>"); RemittancesDAL.UpdateRemittancereceivabledate(this.hidremid.Value, time);//更新收款时间 this.hidremid.Value = ""; this.lblmoney.Text = GetTran("007809", "未选择"); this.lblname.Text = GetTran("007809", "未选择"); this.lblnumber.Text = GetTran("007809", "未选择"); this.lblremid.Text = GetTran("007809", "未选择"); this.lblremittancesdate.Text = GetTran("007809", "未选择"); this.txtgettime.Text = ""; this.ddlhours.SelectedIndex = 0; this.ddlmins.SelectedIndex = 0; this.ddlsecs.SelectedIndex = 0; Binddatalist(); return; } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("007817", "确认收款失败") + "!');</script>"); return; } }