/// <summary> /// 提现 /// </summary> /// <param name="WithdrawAccountID"></param> /// <param name="tranAmt"></param> /// <param name="Notes"></param> /// <returns></returns> public void Withdraw() { decimal tranAmt = (decimal)tools.CheckFloat(Request.Form["Withdraw"]); string Notes = "自助提交出金申请"; ZhongXinInfo PayAccountInfo = GetZhongXinBySuppleir(tools.NullInt(Session["supplier_id"])); if (PayAccountInfo == null) { pub.Msg("error", "错误信息", "您尚未绑定中信支付", false, "{back}"); } decimal accountAmount = GetAmount(PayAccountInfo.SubAccount); decimal withdrawFee = WithdrawFee(tranAmt, PayAccountInfo.ReceiptBank); if (accountAmount < (withdrawFee + tranAmt)) { pub.Msg("error", "错误信息", "本次出金金额应小于账户剩余金额", false, "{back}"); } string strResult = string.Empty; if (sendmessages.Withdraw(PayAccountInfo.SubAccount, PayAccountInfo.ReceiptAccount, PayAccountInfo.OpenAccountName, PayAccountInfo.BankCode, PayAccountInfo.BankName, tranAmt, PayAccountInfo.ReceiptBank, Notes, ref strResult)) { pub.Msg("positive", "操作成功", "您的出金申请已经提交,具体银行到账时间可能会有延迟,下午16点以后的出金申请将于次日处理,请耐心等待,不要重复提交出金。", true, "/supplier/zhongxin.aspx"); } else { pub.Msg("error", "错误信息", "您的出金申请提交失败,请核实您的出金收款银行账号、联行号、出金银行名称是否正确。", false, "{back}"); //pub.Msg("error", "错误信息", strResult, false, "{back}"); } }
/// <summary> /// 签约 /// </summary> public void AccountSign(int idInt, string mobileString) { ZhongXinInfo entity = GetZhongXinBySuppleir(idInt); if (entity == null) { Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}"); } string strResult = string.Empty; if (sendmessages.AccountSign(entity.CompanyName, ref strResult)) { entity.Register = 1; entity.SubAccount = strResult; } else { Public.Msg("error", "错误信息", strResult, false, "{back}"); } if (MyBLL.EditZhongXin(entity)) { //推送短信 SMS mySMS = new SMS(); mySMS.Send(mobileString, entity.CompanyName, "zhongxin_info"); Public.Msg("positive", "操作成功", "操作成功", true, "zhongxin_list.aspx"); } else { Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}"); } }
/// <summary> /// 转账 /// </summary> /// <param name="PayAccountID"></param> /// <param name="RecvAccount"></param> /// <param name="tranAmt"></param> /// <param name="Notes"></param> /// <returns></returns> public string Transfer(int PayAccountID, int RecvAccount, double tranAmt, string Notes) { string supplier_name = ""; ZhongXinInfo PayAccountInfo = GetZhongXinBySuppleir(PayAccountID); ZhongXinInfo RecvAccountInfo = GetZhongXinBySuppleir(RecvAccount); if (PayAccountInfo == null) { return("记录不存在"); } if (RecvAccountInfo == null) { return("记录不存在"); } string strResult = string.Empty; if (sendmessages.Transfer(PayAccountInfo.SubAccount, RecvAccountInfo.SubAccount, RecvAccountInfo.CompanyName, Notes, tranAmt, ref strResult, supplier_name)) { return("true"); } else { return(strResult); } }
/// <summary> /// 签约 /// </summary> public void AccountSign() { ZhongXinInfo entity = GetZhongXinByID(tools.CheckInt(Request["ID"])); ISupplier mysupplierBll = SupplierFactory.CreateSupplier(); SupplierInfo entitySypplier = mysupplierBll.GetSupplierByID(entity.SupplierID, Public.GetUserPrivilege()); if (entity == null) { Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}"); } string strResult = string.Empty; if (sendmessages.AccountSign(entity.CompanyName, ref strResult)) { entity.Register = 1; entity.SubAccount = strResult; } else { Public.Msg("error", "错误信息", strResult, false, "{back}"); } if (MyBLL.EditZhongXin(entity)) { //推送短信 SMS mySMS = new SMS(); mySMS.Send(entitySypplier.Supplier_Mobile, entity.CompanyName, "zhongxin_info"); Public.Msg("positive", "操作成功", "操作成功", true, "zhongxin_list.aspx"); } else { Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}"); } }
public virtual IList <ZhongXinInfo> GetZhongXins(QueryInfo Query) { int PageSize; int CurrentPage; IList <ZhongXinInfo> entitys = null; ZhongXinInfo entity = null; string SqlList, SqlField, SqlOrder, SqlParam, SqlTable; SqlDataReader RdrList = null; try { CurrentPage = Query.CurrentPage; PageSize = Query.PageSize; SqlTable = "ZhongXin"; SqlField = "*"; SqlParam = DBHelper.GetSqlParam(Query.ParamInfos); SqlOrder = DBHelper.GetSqlOrder(Query.OrderInfos); SqlList = DBHelper.GetSqlPage(SqlTable, SqlField, SqlParam, SqlOrder, CurrentPage, PageSize); RdrList = DBHelper.ExecuteReader(SqlList); if (RdrList.HasRows) { entitys = new List <ZhongXinInfo>(); while (RdrList.Read()) { entity = new ZhongXinInfo(); entity.ID = Tools.NullInt(RdrList["ID"]); entity.SupplierID = Tools.NullInt(RdrList["SupplierID"]); entity.CompanyName = Tools.NullStr(RdrList["CompanyName"]); entity.ReceiptAccount = Tools.NullStr(RdrList["ReceiptAccount"]); entity.ReceiptBank = Tools.NullStr(RdrList["ReceiptBank"]); entity.BankCode = Tools.NullStr(RdrList["BankCode"]); entity.BankName = Tools.NullStr(RdrList["BankName"]); entity.OpenAccountName = Tools.NullStr(RdrList["OpenAccountName"]); entity.SubAccount = Tools.NullStr(RdrList["SubAccount"]); entity.Audit = Tools.NullInt(RdrList["Audit"]); entity.Register = Tools.NullInt(RdrList["Register"]); entity.Addtime = Tools.NullDate(RdrList["Addtime"]); entitys.Add(entity); entity = null; } } return(entitys); } catch (Exception ex) { throw ex; } finally { if (RdrList != null) { RdrList.Close(); RdrList = null; } } }
public ZhongXinInfo GetZhongXinBySuppleir(int ID) { ZhongXinInfo zhongxininfo = MyBLL.GetZhongXinBySuppleir(ID); //if (zhongxininfo.BankCode == null || zhongxininfo.BankName == null || zhongxininfo.SubAccount == null) //{ // pub.Msg("error", "错误信息", "请维护出金账户信息", false, "/supplier/index.aspx"); //} return(zhongxininfo); }
public void RegistZhonghang(int id) { //ZhongXinInfo entity = GetZhongXinByID(tools.CheckInt(Request.Form["id"])); ZhongXinInfo entity = GetZhongXinByID(tools.CheckInt(id.ToString())); entity.Register = 2; if (MyBLL.EditZhongXin(entity)) { Public.Msg("positive", "操作成功", "操作成功", true, "zhongxin_list.aspx"); } else { Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}"); } }
public virtual bool EditZhongXin(ZhongXinInfo entity) { string SqlAdd = null; DataTable DtAdd = null; DataRow DrAdd = null; SqlAdd = "SELECT * FROM ZhongXin WHERE ID = " + entity.ID; DtAdd = DBHelper.Query(SqlAdd); try { if (DtAdd.Rows.Count > 0) { DrAdd = DtAdd.Rows[0]; DrAdd["ID"] = entity.ID; DrAdd["SupplierID"] = entity.SupplierID; DrAdd["CompanyName"] = entity.CompanyName; DrAdd["ReceiptAccount"] = entity.ReceiptAccount; DrAdd["ReceiptBank"] = entity.ReceiptBank; DrAdd["BankCode"] = entity.BankCode; DrAdd["BankName"] = entity.BankName; DrAdd["OpenAccountName"] = entity.OpenAccountName; DrAdd["SubAccount"] = entity.SubAccount; DrAdd["Audit"] = entity.Audit; DrAdd["Register"] = entity.Register; DrAdd["Addtime"] = entity.Addtime; DBHelper.SaveChanges(SqlAdd, DtAdd); } else { return(false); } } catch (Exception ex) { throw ex; } finally { DtAdd.Dispose(); } return(true); }
public virtual ZhongXinInfo GetZhongXinBySuppleir(int ID) { ZhongXinInfo entity = null; SqlDataReader RdrList = null; try { string SqlList; SqlList = "SELECT * FROM ZhongXin WHERE SupplierID = " + ID; RdrList = DBHelper.ExecuteReader(SqlList); if (RdrList.Read()) { entity = new ZhongXinInfo(); entity.ID = Tools.NullInt(RdrList["ID"]); entity.SupplierID = Tools.NullInt(RdrList["SupplierID"]); entity.CompanyName = Tools.NullStr(RdrList["CompanyName"]); entity.ReceiptAccount = Tools.NullStr(RdrList["ReceiptAccount"]); entity.ReceiptBank = Tools.NullStr(RdrList["ReceiptBank"]); entity.BankCode = Tools.NullStr(RdrList["BankCode"]); entity.BankName = Tools.NullStr(RdrList["BankName"]); entity.OpenAccountName = Tools.NullStr(RdrList["OpenAccountName"]); entity.SubAccount = Tools.NullStr(RdrList["SubAccount"]); entity.Audit = Tools.NullInt(RdrList["Audit"]); entity.Register = Tools.NullInt(RdrList["Register"]); entity.Addtime = Tools.NullDate(RdrList["Addtime"]); } return(entity); } catch (Exception ex) { throw ex; } finally { if (RdrList != null) { RdrList.Close(); RdrList = null; } } }
/// <summary> /// 转账到担保账户 /// </summary> /// <param name="PayAccountID"></param> /// <param name="tranAmt"></param> /// <param name="Notes"></param> /// <returns></returns> public string ToGuaranteeAccount(int PayAccountID, double tranAmt, string Notes, int Supplier_ID, string supplier_name) { ZhongXinInfo PayAccountInfo = GetZhongXinBySuppleir(Supplier_ID); if (PayAccountInfo == null) { return("记录不存在"); } string strResult = string.Empty; if (sendmessages.Transfer(PayAccountInfo.SubAccount, GuaranteeAccNo, GuaranteeAccNm, Notes, tranAmt, ref strResult, supplier_name)) { return("true"); } else { return(strResult); } }
/// <summary> /// 扣除佣金 /// </summary> /// <param name="PayAccountID"></param> /// <param name="tranAmt"></param> /// <param name="Notes"></param> /// <returns></returns> public string DeductingCommission(int RecvAccountID, double tranAmt, string Notes) { string supplier_name = ""; ZhongXinInfo RecvAccountInfo = GetZhongXinBySuppleir(RecvAccountID); if (RecvAccountInfo == null) { return("记录不存在"); } string strResult = string.Empty; if (sendmessages.Transfer(RecvAccountInfo.SubAccount, CommissionAccNo, CommissionAccNm, Notes, tranAmt, ref strResult, supplier_name)) { return("true"); } else { return(strResult); } }
public virtual bool AddZhongXin(ZhongXinInfo entity) { string SqlAdd = null; DataTable DtAdd = null; DataRow DrAdd = null; SqlAdd = "SELECT TOP 0 * FROM ZhongXin"; DtAdd = DBHelper.Query(SqlAdd); DrAdd = DtAdd.NewRow(); DrAdd["ID"] = entity.ID; DrAdd["SupplierID"] = entity.SupplierID; DrAdd["CompanyName"] = entity.CompanyName; DrAdd["ReceiptAccount"] = entity.ReceiptAccount; DrAdd["ReceiptBank"] = entity.ReceiptBank; DrAdd["BankCode"] = entity.BankCode; DrAdd["BankName"] = entity.BankName; DrAdd["OpenAccountName"] = entity.OpenAccountName; DrAdd["SubAccount"] = entity.SubAccount; DrAdd["Audit"] = entity.Audit; DrAdd["Register"] = entity.Register; DrAdd["Addtime"] = entity.Addtime; DtAdd.Rows.Add(DrAdd); try { DBHelper.SaveChanges(SqlAdd, DtAdd); return(true); } catch (Exception ex) { throw ex; } finally { DtAdd.Dispose(); } }
public void AddZhonghang() { Supplier_ID = tools.CheckInt(Session["supplier_id"].ToString()); ZhongXinInfo zhongxininfo = GetZhongXinBySuppleir(Supplier_ID); if (zhongxininfo == null) { pub.Msg("info", "提示信息", "系统繁忙,若多次出现请联系管理员", false, "{back}"); } SupplierInfo entitys = MySupplier.GetSupplierByID(Supplier_ID, pub.CreateUserPrivilege("1392d14a-6746-4167-804a-d04a2f81d226")); if (entitys != null) { string CompanyName = tools.CheckStr(Request.Form["CompanyName"]); string ReceiptAccount = tools.CheckStr(Request.Form["ReceiptAccount"]); string ReceiptBank = tools.CheckStr(Request.Form["ReceiptBank"]); string BankCode = tools.CheckStr(Request.Form["BankCode"]); string BankName = tools.CheckStr(Request.Form["BankName"]); string OpenAccountName = tools.CheckStr(Request.Form["OpenAccountName"]); if (CompanyName == "") { pub.Msg("info", "提示信息", "填写公司名称", false, "{back}"); } if (ReceiptAccount == "") { pub.Msg("info", "提示信息", "填写出金收款账号须真实有效", false, "{back}"); } if (ReceiptBank == "") { pub.Msg("info", "提示信息", "填写出金收款银行", false, "{back}"); } if (BankCode == "") { pub.Msg("info", "提示信息", "填写银行行号", false, "{back}"); } if (BankName == "") { pub.Msg("info", "提示信息", "填写银行名称", false, "{back}"); } if (OpenAccountName == "") { pub.Msg("info", "提示信息", "填写开户名称", false, "{back}"); } ZhongXinInfo entity = MyBLL.GetZhongXinBySuppleir(Supplier_ID); entity.ReceiptAccount = ReceiptAccount; entity.ReceiptBank = ReceiptBank; entity.BankCode = BankCode; entity.BankName = BankName; entity.Audit = 0; entity.Register = 0; if (MyBLL.EditZhongXin(entity)) { pub.Msg("positive", "操作成功", "操作成功", true, "/supplier/ZhongXin.aspx?tip=success"); } else { pub.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}"); } } else { pub.Msg("error", "错误信息", "信息保存失败,请稍后再试!", false, "{back}"); } }
public void EditZhonghang() { ZhongXinInfo entity = GetZhongXinByID(tools.CheckInt(Request.Form["ID"])); if (entity == null) { Public.Msg("info", "提示信息", "您没有权限", false, "{back}"); } string CompanyName = tools.CheckStr(Request.Form["CompanyName"]); string ReceiptAccount = tools.CheckStr(Request.Form["ReceiptAccount"]); string ReceiptBank = tools.CheckStr(Request.Form["ReceiptBank"]); string BankCode = tools.CheckStr(Request.Form["BankCode"]); string BankName = tools.CheckStr(Request.Form["BankName"]); string OpenAccountName = tools.CheckStr(Request.Form["OpenAccountName"]); int Audit = tools.CheckInt(Request.Form["Audit"]); string SubAccount = tools.CheckStr(Request.Form["SubAccount"]); if (CompanyName == "") { Public.Msg("info", "提示信息", "填写公司名称", false, "{back}"); } //if (ReceiptAccount == "") //{ // Public.Msg("info", "提示信息", "填写出金收款账号须真实有效", false, "{back}"); //} //if (ReceiptBank == "") //{ // Public.Msg("info", "提示信息", "填写出金收款银行", false, "{back}"); //} //if (BankCode == "") //{ // Public.Msg("info", "提示信息", "填写银行行号", false, "{back}"); //} //if (BankName == "") //{ // Public.Msg("info", "提示信息", "填写银行名称", false, "{back}"); //} //if (OpenAccountName == "") //{ // Public.Msg("info", "提示信息", "填写开户名称", false, "{back}"); //} entity.CompanyName = CompanyName; entity.ReceiptAccount = ReceiptAccount; entity.ReceiptBank = ReceiptBank; entity.BankCode = BankCode; entity.BankName = BankName; entity.OpenAccountName = OpenAccountName; entity.Audit = Audit; entity.SubAccount = SubAccount; if (MyBLL.EditZhongXin(entity)) { Public.Msg("positive", "操作成功", "操作成功", true, "zhongxin_list.aspx"); } else { Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}"); } }
public virtual bool EditZhongXin(ZhongXinInfo entity) { return(MyDAL.EditZhongXin(entity)); }
public virtual bool AddZhongXin(ZhongXinInfo entity) { return(MyDAL.AddZhongXin(entity)); }