public int ShenHeloansInfo(Tz888.Model.LoansInfo loansinfo, int LoansInfoId) { string sql = "Update loansInfo set CountryID=@CountryID ,ProvinceID=@ProvinceID,CityID=@CityID,CountyID=@CountyID,Amount=@Amount,Deadline=@Deadline,Reimbursement=@Reimbursement,Guarantee=@Guarantee,BorrowingUse=@BorrowingUse,ValidityID=@ValidityID,Title=@Title,Keywords=@Keywords,Description=@Description,Reason=@Reason where loansInfoID=@loansInfoID "; SqlParameter[] ps = new SqlParameter[] { new SqlParameter("@CountryID", loansinfo.CountryID) , new SqlParameter("@ProvinceID", loansinfo.ProvinceID) , new SqlParameter("@CityID", loansinfo.CityID) , new SqlParameter("@CountyID", loansinfo.CountyID) , new SqlParameter("@Amount", loansinfo.Amount) , new SqlParameter("@Deadline", loansinfo.Deadline) , new SqlParameter("@Reimbursement", loansinfo.Reimbursement) , new SqlParameter("@Guarantee", loansinfo.Guarantee) , new SqlParameter("@BorrowingUse", loansinfo.BorrowingUse) , new SqlParameter("@ValidityID", loansinfo.ValidityID) , new SqlParameter("@Title", loansinfo.Title) , new SqlParameter("@Keywords", loansinfo.Keywords) , new SqlParameter("@Description", loansinfo.Description) , new SqlParameter("@Reason", loansinfo.Reason) , new SqlParameter("@loansInfoID", LoansInfoId) }; int result = DbHelperSQL.ExecuteSql(sql, ps); return(result); }
private void BindShow() { Tz888.BLL.Conn dal = new Tz888.BLL.Conn(); DataTable dt = dal.GetList("dicttab", "*", "idictvalue", 10, 1, 0, 0, " cdicttype='xmyxqxx' "); this.rdlValiditeTerm.DataTextField = "cdictname"; this.rdlValiditeTerm.DataValueField = "idictvalue"; this.rdlValiditeTerm.DataSource = dt; this.rdlValiditeTerm.SelectedIndex = 0; this.rdlValiditeTerm.DataBind(); this.rdlValiditeSystem.DataTextField = "cdictname"; this.rdlValiditeSystem.DataValueField = "idictvalue"; this.rdlValiditeSystem.DataSource = dt; this.rdlValiditeSystem.SelectedIndex = 0; this.rdlValiditeSystem.DataBind(); Tz888.Model.LoansInfoTab loansInfotab = (Tz888.Model.LoansInfoTab)loansInfoTabbll.GetLoansInfoTabByLoansInfoId(loansInfoID); Tz888.Model.LoansInfo loansinfo = (Tz888.Model.LoansInfo)loansinfobll.GetLoansInfoByLoansInfoId(loansInfoID); Tz888.Model.LoanscontactsTab loanscontactstab = (Tz888.Model.LoanscontactsTab)loanscontacttabbll.GetLoanscontactsTabByLoansInfoId(loansInfoID); txtCapitalTitle.Text = loansInfotab.LoansTitle.ToString(); txtCapitalMoney.Text = loansinfo.Amount.ToString(); radiohaiMoney.Items.FindByValue(loansinfo.Reimbursement.ToString().Trim()).Selected = true; radiodanbao.Items.FindByValue(loansinfo.Guarantee.ToString().Trim()).Selected = true; txtCapitalIntent.Value = loansinfo.BorrowingUse.ToString(); txtcontactsName.Text = loanscontactstab.ContactsName.ToString(); txtcontactsphone.Text = loanscontactstab.Moblie.ToString(); string[] num = loanscontactstab.Telephone.ToString().Trim().Split('-'); if (num.Length == 1) { txttel1.Text = num[0]; } else if (num.Length == 2) { txttel1.Text = num[0]; } else if (num.Length == 3) { txtcontactsTel.Text = num[0]; txttel1.Text = num[1]; txttel2.Text = num[2]; } txtcontactsemail.Text = loanscontactstab.Mail.ToString(); txtcontactsaddress.Text = loanscontactstab.Address.ToString(); this.ZoneSelectControl1.CountryID = loansinfo.CountryID.ToString().Trim(); this.ZoneSelectControl1.ProvinceID = loansinfo.ProvinceID.ToString().Trim(); this.ZoneSelectControl1.CityID = loansinfo.CityID.ToString().Trim(); this.ZoneSelectControl1.CountyID = loansinfo.CountyID.ToString().Trim(); this.rdlValiditeTerm.Items.FindByValue(loansinfo.Deadline.ToString().Trim()).Selected = true; this.rdlValiditeSystem.Items.FindByValue(loansinfo.ValidityID.ToString().Trim()).Selected = true; }
public string GetProvinceName(int LoansInfoID) { Tz888.Model.LoansInfo loansinfo = (Tz888.Model.LoansInfo)loansinfobll.GetLoansInfoByLoansInfoId(LoansInfoID); string ProvinceID = loansinfo.ProvinceID.ToString().Trim(); string provincename = loansinfobll.GetProvinceNameByProvinceId(ProvinceID).Trim(); if (provincename.Trim() == "") { provincename = "中国"; } return(provincename); }
private void BindShow() { Tz888.BLL.Conn dal = new Tz888.BLL.Conn(); DataTable dt = dal.GetList("dicttab", "*", "idictvalue", 10, 1, 0, 0, " cdicttype='xmyxqxx' "); this.rdlValiditeTerm.DataTextField = "cdictname"; this.rdlValiditeTerm.DataValueField = "idictvalue"; this.rdlValiditeTerm.DataSource = dt; this.rdlValiditeTerm.SelectedIndex = 0; this.rdlValiditeTerm.DataBind(); this.rdlValiditeSystem.DataTextField = "cdictname"; this.rdlValiditeSystem.DataValueField = "idictvalue"; this.rdlValiditeSystem.DataSource = dt; this.rdlValiditeSystem.SelectedIndex = 0; this.rdlValiditeSystem.DataBind(); Tz888.Model.LoansInfoTab loansInfotab = (Tz888.Model.LoansInfoTab)loansInfoTabbll.GetLoansInfoTabByLoansInfoId(loansInfoID); Tz888.Model.LoansInfo loansinfo = (Tz888.Model.LoansInfo)loansinfobll.GetLoansInfoByLoansInfoId(loansInfoID); Tz888.Model.LoanscontactsTab loanscontactstab = (Tz888.Model.LoanscontactsTab)loanscontacttabbll.GetLoanscontactsTabByLoansInfoId(loansInfoID); radiotuijian.Items.FindByValue(loansInfotab.RecommendID.ToString().Trim()).Selected = true; int shentype = Convert.ToInt32(loansInfotab.AuditID.ToString().Trim()); if (shentype == 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "提示f:", "changgereson(" + shentype + ");", true); shen.Checked = true; } if (shentype == 1) { ScriptManager.RegisterStartupScript(this, this.GetType(), "提示f:", "changgereson(" + shentype + ");", true); shens.Checked = true; } if (shentype == 3) { ScriptManager.RegisterStartupScript(this, this.GetType(), "提示f:", "changgereson(" + shentype + ");", true); shensss.Checked = true; } if (shentype == 5) { ScriptManager.RegisterStartupScript(this, this.GetType(), "提示f:", "changgereson(" + shentype + ");", true); shenssss.Checked = true; shen.Disabled = true; shens.Disabled = true; shensss.Disabled = true; shenssss.Disabled = true; } txtCapitalTitle.Text = loansInfotab.LoansTitle.ToString(); txtCapitalMoney.Text = loansinfo.Amount.ToString(); radiodanbao.Items.FindByValue(loansinfo.Guarantee.ToString().Trim()).Selected = true; txtCapitalIntent.Value = loansinfo.BorrowingUse.ToString(); txttitle.Text = loansinfo.Title.ToString(); txtkeywords.Text = loansinfo.Keywords.ToString(); txtdescript.Text = loansinfo.Description.ToString(); txtreson.Text = loansinfo.Reason.ToString(); txtenpricename.Text = loanscontactstab.EnterpriseName.ToString(); txtcontactsName.Text = loanscontactstab.ContactsName.ToString(); txtcontactsphone.Text = loanscontactstab.Moblie.ToString(); string[] num = loanscontactstab.Telephone.ToString().Trim().Split('-'); if (num.Length == 1) { txttel1.Text = num[0]; } else if (num.Length == 2) { txttel1.Text = num[0]; } else if (num.Length == 3) { txtcontactsTel.Text = num[0]; txttel1.Text = num[1]; txttel2.Text = num[2]; } txtcontactsemail.Text = loanscontactstab.Mail.ToString(); txtcontactsaddress.Text = loanscontactstab.Address.ToString(); this.ZoneSelectControl1.CountryID = loansinfo.CountryID.ToString().Trim(); this.ZoneSelectControl1.ProvinceID = loansinfo.ProvinceID.ToString().Trim(); this.ZoneSelectControl1.CityID = loansinfo.CityID.ToString().Trim(); this.ZoneSelectControl1.CountyID = loansinfo.CountyID.ToString().Trim(); this.rdlValiditeTerm.Items.FindByValue(loansinfo.Deadline.ToString().Trim()).Selected = true; this.rdlValiditeSystem.Items.FindByValue(loansinfo.ValidityID.ToString().Trim()).Selected = true; }
//添加贷款记录 public int InsertLoansInfoTab(Tz888.Model.LoansInfoTab loansinfotab, Tz888.Model.LoansInfo loansinfo, Tz888.Model.LoanscontactsTab loanscontactstab) { int rowsAffected = 0; SqlParameter[] parameters = { new SqlParameter("@LoginName", SqlDbType.VarChar, 50), new SqlParameter("@LoansTitle", SqlDbType.VarChar, 100), new SqlParameter("@BorrowingType", SqlDbType.Int, 4), new SqlParameter("@auditID", SqlDbType.Int, 4), new SqlParameter("@chargeID", SqlDbType.Int, 4), new SqlParameter("@recommendID", SqlDbType.Int, 4), new SqlParameter("@url", SqlDbType.VarChar, 200), new SqlParameter("@loansdate", SqlDbType.DateTime), new SqlParameter("@formID", SqlDbType.Int, 4), new SqlParameter("@price", SqlDbType.Int, 4), new SqlParameter("@refurbishtime", SqlDbType.DateTime), new SqlParameter("@enterpriseName", SqlDbType.VarChar, 100), new SqlParameter("@contactsName", SqlDbType.VarChar, 100), new SqlParameter("@telephone", SqlDbType.VarChar, 50), new SqlParameter("@Moblie", SqlDbType.VarChar, 50), new SqlParameter("@Mail", SqlDbType.VarChar, 50), new SqlParameter("@Address", SqlDbType.VarChar, 50), new SqlParameter("@ValidityID", SqlDbType.Int, 4), new SqlParameter("@CountryID", SqlDbType.NChar, 30), new SqlParameter("@ProvinceID", SqlDbType.NChar, 30), new SqlParameter("@CityID", SqlDbType.NChar, 30), new SqlParameter("@CountyID", SqlDbType.NChar, 30), new SqlParameter("@amount", SqlDbType.Int, 4), new SqlParameter("@deadline", SqlDbType.Int, 4), new SqlParameter("@reimbursement", SqlDbType.Int, 4), new SqlParameter("@guarantee", SqlDbType.Int, 4), new SqlParameter("@Borrowinguse", SqlDbType.VarChar, 2000), new SqlParameter("@title", SqlDbType.VarChar, 100), new SqlParameter("@keywords", SqlDbType.VarChar, 100), new SqlParameter("@description", SqlDbType.VarChar, 100), new SqlParameter("@reason", SqlDbType.VarChar, 100) }; parameters[0].Value = loansinfotab.LoginName; parameters[1].Value = loansinfotab.LoansTitle; parameters[2].Value = loansinfotab.BorrowingType; parameters[3].Value = loansinfotab.AuditID; parameters[4].Value = loansinfotab.ChargeID; parameters[5].Value = loansinfotab.RecommendID; parameters[6].Value = loansinfotab.Url; parameters[7].Value = loansinfotab.Loansdate; parameters[8].Value = loansinfotab.Formid; parameters[9].Value = loansinfotab.Price; parameters[10].Value = loansinfotab.Refurbishtime; parameters[11].Value = loanscontactstab.EnterpriseName; parameters[12].Value = loanscontactstab.ContactsName; parameters[13].Value = loanscontactstab.Telephone; parameters[14].Value = loanscontactstab.Moblie; parameters[15].Value = loanscontactstab.Mail; parameters[16].Value = loanscontactstab.Address; parameters[17].Value = loansinfo.ValidityID; parameters[18].Value = loansinfo.CountryID; parameters[19].Value = loansinfo.ProvinceID; parameters[20].Value = loansinfo.CityID; parameters[21].Value = loansinfo.CountyID; parameters[22].Value = loansinfo.Amount; parameters[23].Value = loansinfo.Deadline; parameters[24].Value = loansinfo.Reimbursement; parameters[25].Value = loansinfo.Guarantee; parameters[26].Value = loansinfo.BorrowingUse; parameters[27].Value = loansinfo.Title; parameters[28].Value = loansinfo.Keywords; parameters[29].Value = loansinfo.Description; parameters[30].Value = loansinfo.Reason; DbHelperSQL.RunProcedure("loansinfotab_insert", parameters, out rowsAffected); return(rowsAffected); }
protected void IbtnSubmit_Click(object sender, ImageClickEventArgs e) { string loginname = Page.User.Identity.Name.Trim(); Tz888.BLL.loansInfoTab loansinfotabbll = new Tz888.BLL.loansInfoTab(); //贷款主表添加数据 Tz888.Model.LoansInfoTab loansinfotab = new Tz888.Model.LoansInfoTab(); loansinfotab.LoginName = loginname; loansinfotab.LoansTitle = this.txtCapitalTitle.Text.Trim(); loansinfotab.BorrowingType = 0; loansinfotab.AuditID = 0; loansinfotab.ChargeID = 0; loansinfotab.RecommendID = 0; loansinfotab.Url = ""; if (txtCapitalTitle.Text.Trim() == "") { this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入标题!');", true); return; } //贷款表添加数据 loansinfotab.Loansdate = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString().Trim(); loansinfotab.Price = 0; //价格 loansinfotab.Formid = 1; //1:会员2:业务员3:协会 4:分站 loansinfotab.Refurbishtime = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString().Trim(); //刷新时间 Tz888.Model.LoansInfo loansinfo = new Tz888.Model.LoansInfo(); loansinfo.CountryID = this.ZoneSelectControl1.CountryID; loansinfo.ProvinceID = this.ZoneSelectControl1.ProvinceID; loansinfo.CityID = this.ZoneSelectControl1.CityID; loansinfo.CountyID = this.ZoneSelectControl1.CountyID; if (txtCapitalMoney.Text.Trim() == "") { this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入借款金额!');", true); return; } else if (Convert.ToInt32(txtCapitalMoney.Text.Trim().Length) > 9) { this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入小于10亿的金额!');", true); return; } else if (txtCapitalIntent.Value.Trim() == "") { this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入借款内容!');", true); return; } loansinfo.Deadline = Convert.ToInt32(rdlValiditeTerm.SelectedValue.Trim()); loansinfo.Reimbursement = Convert.ToInt32(this.radiohaiMoney.SelectedValue.Trim()); loansinfo.Guarantee = Convert.ToInt32(this.radiodanbao.SelectedValue.Trim()); loansinfo.BorrowingUse = txtCapitalIntent.Value.Trim(); loansinfo.ValidityID = Convert.ToInt32(rdlValiditeSystem.SelectedValue.Trim()); loansinfo.Amount = Convert.ToInt32(txtCapitalMoney.Text.Trim()); loansinfo.Title = ""; loansinfo.Keywords = ""; loansinfo.Description = ""; loansinfo.Reason = ""; //联系人信息表添加数据 Tz888.Model.LoanscontactsTab loanscontactstab = new Tz888.Model.LoanscontactsTab(); loanscontactstab.EnterpriseName = ""; loanscontactstab.ContactsName = txtcontactsName.Text.Trim(); loanscontactstab.Telephone = txtcontactsTel.Text.Trim() + "-" + txttel1.Text.Trim() + "-" + txttel2.Text.Trim(); loanscontactstab.Moblie = txtcontactsphone.Text.Trim(); loanscontactstab.Mail = txtcontactsemail.Text.Trim(); loanscontactstab.Address = this.txtcontactsaddress.Text.Trim(); if (txtcontactsName.Text.Trim() == "") { this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入姓名!');", true); return; } else if (txtcontactsTel.Text.Trim() == "" && txtcontactsphone.Text.Trim() == "") { this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('至少输入一个联系电话!');", true); return; } else if (txttel1.Text.Trim() == "" && txtcontactsphone.Text.Trim() == "") { this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('至少输入一个联系电话!');", true); return; } else if (txttel2.Text.Trim() == "" && txtcontactsphone.Text.Trim() == "") { this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('至少输入一个联系电话!');", true); return; } else if (txtcontactsemail.Text.Trim() == "") { this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入邮箱!');", true); return; } else { //如果result=3的话就用户添加贷款记录成功否则失败事物回滚 int result = loansinfotabbll.InsertLoansInfoTab(loansinfotab, loansinfo, loanscontactstab); ScriptManager.RegisterStartupScript(this, this.GetType(), "提示f:", "s();", true); if (result > 0) { this.ClientScript.RegisterStartupScript(this.GetType(), "", "location.href='LoansManager.aspx'", true); } } }
public string GetAmountMoney(int LoansInfoID) { Tz888.Model.LoansInfo loansinfo = (Tz888.Model.LoansInfo)loansinfobll.GetLoansInfoByLoansInfoId(LoansInfoID); return(loansinfo.Amount.ToString()); }