/// <summary> /// 保存数据 /// </summary> private void DataSave() { bool Result = false; //验证是否保存成功 EyouSoft.Model.HotelStructure.HotelAccount Model_HotelAccount = new EyouSoft.Model.HotelStructure.HotelAccount(); //结算账户实体类 EyouSoft.BLL.HotelStructure.HotelAccount Bll_HotelAccount = new EyouSoft.BLL.HotelStructure.HotelAccount(); //结算账户业务逻辑类 Model_HotelAccount.CompanyId = CompanyID; //当前登录公司的编号 if (Utils.GetInt(Utils.GetFormValue(sla_clearanceaccount.UniqueID.Trim())) == 0) //银行卡结账 { Model_HotelAccount.AccountType = (EyouSoft.Model.HotelStructure.HotelAccountType)Utils.GetInt(Utils.GetFormValue(sla_clearanceaccount.UniqueID.Trim())); //结算账户类型值 Model_HotelAccount.AccountName = Utils.GetString(Utils.GetFormValue(sla_accountname.UniqueID.Trim()), ""); //开户姓名 Model_HotelAccount.BankName = Utils.GetString(Utils.GetFormValue(sla_subbranch.UniqueID.Trim()), ""); //开户行以及支行 Model_HotelAccount.BankNo = Utils.GetString(Utils.GetFormValue(sla_cardnumber.UniqueID.Trim()), ""); //银行卡号 Model_HotelAccount.Settlement = (EyouSoft.Model.HotelStructure.HotelSettlement)Utils.GetInt(Utils.GetFormValue("sla_clearancetype")); //结算方式 if (Utils.GetInt(Utils.GetFormValue("MailInvoice")) == 1) //邮寄发票 { Model_HotelAccount.IsMailInvoice = true; } else { Model_HotelAccount.IsMailInvoice = false; //不邮寄发票 } } else //中间账户财付通结账 { Model_HotelAccount.AccountType = (EyouSoft.Model.HotelStructure.HotelAccountType)Utils.GetInt(Utils.GetFormValue(sla_clearanceaccount.UniqueID.Trim())); //结算账户类型值 Model_HotelAccount.BankNo = Utils.GetString(Utils.GetFormValue(sla_tenpaycard.UniqueID.Trim()), ""); //财付通账号 Model_HotelAccount.Settlement = (EyouSoft.Model.HotelStructure.HotelSettlement)Utils.GetInt(Utils.GetFormValue("sla_clearancetype1")); //离店后5日结算 一月一结 if (Utils.GetInt(Utils.GetFormValue("MailInvoice1")) == 1) //邮寄发票 { Model_HotelAccount.IsMailInvoice = true; } else { Model_HotelAccount.IsMailInvoice = false; //不邮寄发票 } } Model_HotelAccount.IssueTime = DateTime.Now; //添加时间 Result = Bll_HotelAccount.Add(Model_HotelAccount); //添加方法 if (Result) { SetErrorMsg(true, "保存成功!"); } else { SetErrorMsg(false, "保存失败!"); } //释放资源 Model_HotelAccount = null; Bll_HotelAccount = null; }
/// <summary> /// 获取当前公司的结算账户信息 /// </summary> private void InitHotelAccount() { EyouSoft.BLL.HotelStructure.HotelAccount Bll_Account = new EyouSoft.BLL.HotelStructure.HotelAccount(); //实例化结算账户信息业务逻辑类 EyouSoft.Model.HotelStructure.HotelAccount Model_Account = new EyouSoft.Model.HotelStructure.HotelAccount(); //实例化结算账户信息实体类 Model_Account = Bll_Account.GetModel(CompanyID); //当前公司的编号 this.div_Img.Attributes.Add("style", "display:none"); //隐藏提交按钮 if (Convert.ToInt32(Model_Account.AccountType) == 0) //银行卡结算信息 { this.sla_IsShowDDL.Attributes.Add("style", "display:none"); //隐藏结算账户下拉框 this.sla_Lblclearanceaccount.Text = Model_Account.AccountType.ToString(); //取结算账户类型 this.sla_spclearancetype.Attributes.Add("style", "display:none"); //隐藏结算方式文本框 this.lab_Sla_clearancetype.Text = Model_Account.Settlement.ToString(); //取结算方式 this.sla_accountname.Attributes.Add("style", "display:none"); //隐藏开户姓名文本框 this.lab_sla_accountname.Attributes.Add("style", "display:block"); //显示开户姓名lable标签 this.lab_sla_accountname.Text = Model_Account.AccountName; //取开户姓名 this.sla_cardnumber.Attributes.Add("style", "display:none"); //隐藏银行卡号文本框 this.lab_sla_cardnumber.Attributes.Add("style", "display:block"); //显示银行卡号lable标签 this.lab_sla_cardnumber.Text = Model_Account.BankNo; //银行卡号 this.sla_subbranch.Attributes.Add("style", "display:none"); //隐藏开户行以及支行文本框 this.lab_sla_subbranch.Attributes.Add("style", "display:block"); //显示开户行以及支行lable标签 this.lab_sla_subbranch.Text = Model_Account.BankName; //开户行以及支行 this.spn_SlaMailInvoice.Attributes.Add("style", "display:none"); //隐藏邮寄发票单选按钮 this.spn_SlaMailInvoice.Attributes.Add("style", "display:none"); if (Convert.ToInt32(Model_Account.IsMailInvoice) == 0) //转换邮寄发票 { this.lbl_SlaMailInvoice.Text = "否"; } else { this.lbl_SlaMailInvoice.Text = "是"; } } else //财付通结算信息 { this.div_1.Attributes.Add("style", "display:none"); //隐藏银行卡结算信息注册表单 this.div_2.Attributes.Add("style", "display:block"); //显示财付通结算信息 this.sla_IsShowDDL.Attributes.Add("style", "display:none"); //隐藏结算类型下拉列表框 this.sla_Lblclearanceaccount.Text = Model_Account.AccountType.ToString(); //取结算账户类型 this.sla_tenpaycard.Attributes.Add("style", "display:none"); //隐藏财付通账号文本框 this.lab_sla_tenpaycard.Attributes.Add("style", "display:block"); //显示财付通账号lable标签 this.lab_sla_tenpaycard.Text = Model_Account.BankNo; //取财付通账号 this.span_sla_clearancetype1.Attributes.Add("style", "display:none"); //隐藏结算方式单选按钮 if (Convert.ToInt32(Model_Account.Settlement) == 0) //转换结算方式 { this.lbl_sla_clearancetype1.Text = "一月一结"; } else { this.lbl_sla_clearancetype1.Text = "离店后5日结算"; } this.span_slaMailInvoice1.Attributes.Add("style", "display:none"); //隐藏邮寄发票单选按钮 if (Convert.ToInt32(Model_Account.IsMailInvoice) == 0) //转换邮寄发票 { this.lbl_slaMailInvoice1.Text = "否"; } else { this.lbl_slaMailInvoice1.Text = "是"; } } //释放资源 Model_Account = null; Bll_Account = null; }