private void BindBorrowListDataGrid(List<QueryElement> list) { BorrowORLoanCollection coll = BorrowedMethods.GetBorrowList(list); this.BorrowListDataGrid.DataSource = coll; this.BorrowListDataGrid.DataBind(); for (int i = 0; i < coll.Count; i++) { CardInfo cardInfo = CardMethods.GetCardById(coll[i].BorrowORLoanAccountId); string bank = StaticRescourse.DisplayBank(cardInfo.BankId); this.BorrowListDataGrid.Items[i].Cells[4].Text = coll[i].BorrowedAccount + " " + bank; this.BorrowListDataGrid.Items[i].Cells[8].Text = coll[i].HappenedDate.ToString("yyyy-MM-dd"); this.BorrowListDataGrid.Items[i].Cells[2].Text = StaticRescourse.DisplayBorrowORLoanType(coll[i].BorrowORLoanType); bool dateFlag = HelperCommon.CompareAccordToRequired(coll[i].ReturnDate); if (dateFlag) { this.BorrowListDataGrid.Items[i].Cells[9].Text = coll[i].ReturnDate.ToString("yyyy-MM-dd"); } else { this.BorrowListDataGrid.Items[i].Cells[9].Text = string.Empty; } if (coll[i].Status == 2) { this.BorrowListDataGrid.Items[i].Cells[10].Text = "已还"; } else { this.BorrowListDataGrid.Items[i].Cells[10].Text = "未还"; } } }
private void BindDataGrid(List <QueryElement> list) { userColl = UserMethods.GetUser(list); this.UserListDataGrid.DataSource = userColl; this.UserListDataGrid.DataBind(); for (int i = 0; i < userColl.Count; i++) { this.UserListDataGrid.Items[i].Cells[4].Text = StaticRescourse.DisplayRole(userColl[i].Role); } }
private void BindDataGrid(List <QueryElement> list) { cardColl = CardMethods.GetCard(list); this.CardListDataGrid.DataSource = cardColl; this.CardListDataGrid.DataBind(); for (int i = 0; i < cardColl.Count; i++) { this.CardListDataGrid.Items[i].Cells[2].Text = StaticRescourse.DisplayAccountType(cardColl[i].AccountType); this.CardListDataGrid.Items[i].Cells[3].Text = StaticRescourse.DisplayBank(cardColl[i].BankId); } }
/// <summary> ///编辑时初始化dropdownlist /// </summary> private void InitializeEditDropControl(CashIncomeInfo info) { this.dropIncomeAddInComeType.DataSource = StaticRescourse.GetIncomeType(); Helper.SetDropDownList(this.dropIncomeAddInComeType); this.dropIncomeAddPreRate.DataSource = StaticRescourse.GetRateType(); Helper.SetDropDownList(this.dropIncomeAddPreRate); this.dropIncomeAddRate.DataSource = StaticRescourse.GetRate(this.dropIncomeAddPreRate.SelectedItem.Text); Helper.SetDropDownList(this.dropIncomeAddRate); this.dropIncomeAddStatus.DataSource = StaticRescourse.GetIncomeStatus(); Helper.SetDropDownList(this.dropIncomeAddStatus); this.dropIncomeAddDepositMode.DataSource = StaticRescourse.GetIncomDepositMode(); Helper.SetDropDownList(this.dropIncomeAddDepositMode); this.dropIncomeAddPreMode.DataSource = StaticRescourse.GetRateType(); Helper.SetDropDownList(this.dropIncomeAddPreMode); this.dropIncomeAddMode.DataSource = StaticRescourse.GetMode(this.dropIncomeAddPreMode.SelectedItem.Text); Helper.SetDropDownList(this.dropIncomeAddMode); if (info.Id > 0) { this.dropIncomeAddInComeType.SelectedValue = info.IncomeType.ToString(); this.dropIncomeAddPreRate.SelectedValue = info.PreRate.ToString(); this.dropIncomeAddRate.SelectedValue = info.Rate.ToString(); this.dropIncomeAddStatus.SelectedValue = info.Status.ToString(); this.dropIncomeAddDepositMode.SelectedValue = info.DepositMode.ToString(); this.dropIncomeAddPreMode.SelectedValue = info.PreMode.ToString(); this.dropIncomeAddMode.SelectedValue = info.Mode.ToString(); } else { this.dropIncomeAddInComeType.SelectedValue = "1"; this.dropIncomeAddPreRate.SelectedValue = "1"; this.dropIncomeAddRate.SelectedValue = "1"; this.dropIncomeAddStatus.SelectedValue = "1"; this.dropIncomeAddDepositMode.SelectedValue = "1"; this.dropIncomeAddPreMode.SelectedValue = "1"; this.dropIncomeAddMode.SelectedValue = "1"; } }
/// <summary> /// 初始化卡号(新增) /// </summary> private void InitializeDropExpensesDropControl() { List <CardHelper> cardNumberList = new List <CardHelper>(); List <CardHelper> cxList = new List <CardHelper>(); CardCollection cardcoll = new CardCollection(); //返回的卡的collection cardcoll = CardMethods.GetCard(new List <QueryElement>()); List <DropItem> card = new List <DropItem>(); card.Add(new DropItem { ValueField = "", DisplayField = " " }); for (int i = 0; i < cardcoll.Count; i++) { CardInfo info = cardcoll[i]; cardNumberList.Add(new CardHelper { CardId = info.Id, BankId = info.BankId, CardNumber = info.CardNumber }); } cxList.AddRange(cardNumberList.OrderBy(x => x.CardNumber)); cardNumberList.Clear(); for (int i = 0; i < cxList.Count; i++) { if (i == 0 || cxList[i].CardNumber != cxList[i - 1].CardNumber) { cardNumberList.Add(new CardHelper { CardId = cxList[i].CardId, BankId = cxList[i].BankId, CardNumber = cxList[i].CardNumber }); } } for (int i = 0; i < cardNumberList.Count; i++) { var cardInfo = cardNumberList[i]; string bank = StaticRescourse.DisplayBank(cardInfo.BankId); card.Add(new DropItem { ValueField = cardInfo.CardId.ToString(), DisplayField = cardInfo.CardNumber + " " + bank }); // +" "+bank } this.dropExpensesAddCardNumber.DataSource = card; Helper.SetDropDownList(this.dropExpensesAddCardNumber); this.dropExpensesAddSpendMode.DataSource = StaticRescourse.GetSpendMode(); Helper.SetDropDownList(this.dropExpensesAddSpendMode); this.dropExpensesAddSpendType.DataSource = StaticRescourse.GetSpendType(); Helper.SetDropDownList(this.dropExpensesAddSpendType); }
protected void dropIncomeAddPreRate_SelectedIndexChanged(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.dropIncomeAddPreRate.SelectedValue)) { this.dropIncomeAddRate.SelectedValue = string.Empty; this.dropIncomeAddRate.Enabled = false; } else { this.dropIncomeAddRate.Enabled = true; this.dropIncomeAddRate.DataSource = StaticRescourse.GetRate(this.dropIncomeAddPreRate.SelectedItem.Text); Helper.SetDropDownList(this.dropIncomeAddRate); } }
/// <summary> /// 查询时初始化 /// </summary> private void InitializeExpensesQuery() { this.txtExpensesQueryCardNumber.Text = string.Empty; this.dropExpensesQuerySpendMode.DataSource = StaticRescourse.GetSpendMode(); Helper.SetDropDownList(this.dropExpensesQuerySpendMode); this.dropExpensesQuerySpendMode.SelectedValue = string.Empty; this.dropExpensesQuerySpendType.DataSource = StaticRescourse.GetSpendType(); Helper.SetDropDownList(this.dropExpensesQuerySpendType); this.dropExpensesQuerySpendType.SelectedValue = string.Empty; this.txtExpensesQueryConsumerName.Text = string.Empty; this.txtExpensesQueryBSpendDate.Text = string.Empty; this.txtExpensesQueryESpendDate.Text = string.Empty; }
private void BindExpensesListDataGrid(List <QueryElement> list) { ExpensesCollection coll = ExpensesMethods.GetExpensesList(list); this.ExpensesListDataGrid.DataSource = coll; this.ExpensesListDataGrid.DataBind(); for (int i = 0; i < coll.Count; i++) { ExpensesInfo expenses = coll[i]; CardInfo cardInfo = CardMethods.GetCardByCardNumber(expenses.CardNumber, expenses.OwnerId); string bank = StaticRescourse.DisplayBank(cardInfo.BankId); this.ExpensesListDataGrid.Items[i].Cells[4].Text = StaticRescourse.DisplaySpendType(expenses.SpendType); this.ExpensesListDataGrid.Items[i].Cells[6].Text = expenses.SpendDate.ToString("yyyy-MM-dd"); this.ExpensesListDataGrid.Items[i].Cells[7].Text = StaticRescourse.DisplaySpendMode(expenses.SpendMode); } }
private void InitializeQuery() { List <DropItem> listQueryAccountType = new List <DropItem>(); List <DropItem> listBank = new List <DropItem>(); List <DropItem> listUser = new List <DropItem>(); UserCollection userColl = new UserCollection(); DropItem dr = new DropItem { ValueField = "", DisplayField = " " }; listQueryAccountType.Add(dr); listQueryAccountType.AddRange(StaticRescourse.GetAccountType()); this.dropCardQueryAccountType.DataSource = listQueryAccountType; Helper.SetDropDownList(this.dropCardQueryAccountType); this.dropCardQueryAccountType.SelectedValue = string.Empty; listBank.Add(dr); listBank.AddRange(StaticRescourse.GetBank()); this.dropCardQueryBank.DataSource = listBank; Helper.SetDropDownList(this.dropCardQueryBank); this.dropCardQueryBank.SelectedValue = string.Empty; userColl = UserMethods.GetUser(new List <QueryElement>()); if (userColl != null && userColl.Count > 0) { listUser.Add(dr); foreach (var userInfo in userColl) { listUser.Add(new DropItem { ValueField = userInfo.Id.ToString(), DisplayField = userInfo.Name }); } this.dropCardQueryUser.DataSource = listUser; } this.dropCardQueryUser.DataSource = listUser; Helper.SetDropDownList(this.dropCardQueryUser); this.dropCardQueryUser.SelectedValue = string.Empty; this.txtCardQueryCardNumber.Text = string.Empty; this.txtCardQueryBankName.Text = string.Empty; this.txtCardQueryBOpenDate.Text = string.Empty; this.txtCardQueryEOpenDate.Text = string.Empty; }
private void BindIncomeListDataGrid(List <QueryElement> list) { CashIncomeCollection coll = CashIncomeMethods.GetCashIncome(list); this.IncomeListDataGrid.DataSource = coll; this.IncomeListDataGrid.DataBind(); for (int i = 0; i < coll.Count; i++) { CashIncomeInfo cashInfo = coll[i]; CardInfo cardInfo = CardMethods.GetCardByCardNumber(cashInfo.CardNumber, cashInfo.OwnerId); string bank = StaticRescourse.DisplayBank(cardInfo.BankId); this.IncomeListDataGrid.Items[i].Cells[1].Text = StaticRescourse.DisplayIncomeStatus(cashInfo.Status); this.IncomeListDataGrid.Items[i].Cells[4].Text = StaticRescourse.DisplayIncomeType(cashInfo.IncomeType); this.IncomeListDataGrid.Items[i].Cells[6].Text = StaticRescourse.DisplayMode(cashInfo.Mode); this.IncomeListDataGrid.Items[i].Cells[7].Text = StaticRescourse.DisplayRate(cashInfo.Rate); this.IncomeListDataGrid.Items[i].Cells[8].Text = cashInfo.DepositDate.ToString("yyyy-MM-dd"); if (cashInfo.AutoSave == 1) { this.IncomeListDataGrid.Items[i].Cells[12].Text = "是"; } else { this.IncomeListDataGrid.Items[i].Cells[12].Text = "否"; } if (HelperCommon.CompareAccordToRequired(cashInfo.BDate)) { this.IncomeListDataGrid.Items[i].Cells[9].Text = cashInfo.BDate.ToString("yyyy-MM-dd"); } else { this.IncomeListDataGrid.Items[i].Cells[9].Text = string.Empty; } if (HelperCommon.CompareAccordToRequired(cashInfo.EDate)) { this.IncomeListDataGrid.Items[i].Cells[10].Text = cashInfo.EDate.ToString("yyyy-MM-dd"); } else { this.IncomeListDataGrid.Items[i].Cells[10].Text = string.Empty; } this.IncomeListDataGrid.Items[i].Cells[13].Text = StaticRescourse.DisplayIncomeDepositMode(cashInfo.DepositMode); } }
private void Initialize(UserInfo info) { this.dropRole.DataSource = StaticRescourse.GetRoleType(); Helper.SetDropDownList(this.dropRole); this.dropRole.DataBind(); if (info.Id > 0) { this.txtUserName.Text = !string.IsNullOrEmpty(info.Name) ? info.Name : string.Empty; this.txtIdCode.Text = info.Code; this.txtPassword.Attributes.Add("value", info.Password); this.dropRole.SelectedValue = info.Role.ToString(); this.txtEmail.Text = !string.IsNullOrEmpty(info.EMail) ? info.EMail : string.Empty; this.txtContent.Text = !string.IsNullOrEmpty(info.content) ? info.content : string.Empty; } else { this.dropRole.SelectedValue = "1"; } }
private void InitializeEdit(CardInfo info) { List <DropItem> listOwner = new List <DropItem>(); List <DropItem> listuser = new List <DropItem>(); listuser.Add(new DropItem { ValueField = "", DisplayField = " " }); this.dropAddBank.DataSource = StaticRescourse.GetBank(); Helper.SetDropDownList(this.dropAddBank); this.dropAddBank.SelectedValue = info.BankId.ToString(); UserCollection userColl = new UserCollection(); //userColl = UserMethods.GetUser(null, null); if (userColl != null && userColl.Count > 0) { foreach (var userInfo in userColl) { listOwner.Add(new DropItem { ValueField = userInfo.Id.ToString(), DisplayField = userInfo.Name }); listuser.Add(new DropItem { ValueField = userInfo.Id.ToString(), DisplayField = userInfo.Name }); } } this.dropAddCardOwner.DataSource = listOwner; Helper.SetDropDownList(this.dropAddCardOwner); this.dropAddCardOwner.SelectedValue = info.OwnerId.ToString(); this.dropAddCardUser.DataSource = listuser; Helper.SetDropDownList(this.dropAddCardUser); this.dropAddCardUser.SelectedValue = info.UserId > 0?info.UserId.ToString():string.Empty; this.txtAddCardOpenDate.Text = !string.IsNullOrEmpty(info.OpenDate.ToString("yyyy-MM-dd")) ? info.OpenDate.ToString("yyyy-MM-dd") : string.Empty; this.dropCardAddAccountType.DataSource = StaticRescourse.GetAccountType(); Helper.SetDropDownList(this.dropCardAddAccountType); this.dropCardAddAccountType.SelectedValue = info.AccountType.ToString(); this.txtAddCardNumber.Text = info.CardNumber; this.txtAddBankName.Text = !string.IsNullOrEmpty(info.BankName) ? info.BankName : string.Empty; this.txtCardAddContent.Text = !string.IsNullOrEmpty(info.Content) ? info.Content : string.Empty; }
public static List <DropItem> getLoanAccountByPerson(string loanName) { UserInfo userInfo = UserMethods.GetUserByName(loanName); if (userInfo.Id > 0) { CardCollection coll = CardMethods.GetCardByUserId(userInfo.Id); List <DropItem> list = new List <DropItem>(); //list.Add(new DropItem { ValueField = "", DisplayField = " " }); for (int i = 0; i < coll.Count; i++) { string bank = StaticRescourse.DisplayBank(coll[i].BankId); list.Add(new DropItem { ValueField = coll[i].Id.ToString(), DisplayField = coll[i].CardNumber + " " + bank }); } return(list); } return(new List <DropItem>()); }
/// <summary> /// 查询时初始化dropdownlist /// </summary> private void InitializeQueryDropControl() { this.dropIncomeQueryIncomeType.DataSource = StaticRescourse.GetIncomeType(); Helper.SetDropDownList(this.dropIncomeQueryIncomeType); this.dropIncomeQueryIncomeType.SelectedValue = string.Empty; this.dropIncomeQueryDepositMode.DataSource = StaticRescourse.GetIncomDepositMode(); Helper.SetDropDownList(this.dropIncomeQueryDepositMode); this.dropIncomeQueryDepositMode.SelectedValue = string.Empty; List <DropItem> list = new List <DropItem>(); list.Add(new DropItem { ValueField = "", DisplayField = " " }); list.AddRange(StaticRescourse.GetRateType()); this.dropIncomeQueryPreMode.DataSource = list; Helper.SetDropDownList(this.dropIncomeQueryPreMode); this.dropIncomeQueryPreMode.SelectedValue = string.Empty; }
private void Initialize() { List <DropItem> listOwner = new List <DropItem>(); List <DropItem> listuser = new List <DropItem>(); listuser.Add(new DropItem { ValueField = "", DisplayField = " " }); this.dropAddBank.DataSource = StaticRescourse.GetBank(); Helper.SetDropDownList(this.dropAddBank); this.dropAddBank.SelectedIndex = 0; UserCollection userColl = new UserCollection(); //userColl = UserMethods.GetUser(null, null); if (userColl != null && userColl.Count > 0) { foreach (var userInfo in userColl) { listOwner.Add(new DropItem { ValueField = userInfo.Id.ToString(), DisplayField = userInfo.Name }); listuser.Add(new DropItem { ValueField = userInfo.Id.ToString(), DisplayField = userInfo.Name }); } } this.dropAddCardOwner.DataSource = listOwner; Helper.SetDropDownList(this.dropAddCardOwner); this.dropAddCardOwner.SelectedIndex = 0; this.dropAddCardUser.DataSource = listuser; Helper.SetDropDownList(this.dropAddCardUser); this.dropAddCardUser.SelectedIndex = 0; this.txtAddCardOpenDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); this.dropCardAddAccountType.DataSource = StaticRescourse.GetAccountType(); Helper.SetDropDownList(this.dropCardAddAccountType); this.dropCardAddAccountType.SelectedIndex = 0; }
protected void dropIncomeQueryPreMode_SelectedIndexChanged(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.dropIncomeQueryPreMode.SelectedValue)) { List <DropItem> list = new List <DropItem>(); list.Add(new DropItem { ValueField = "", DisplayField = " " }); this.dropIncomeQueryMode.DataSource = list; Helper.SetDropDownList(this.dropIncomeQueryMode); this.dropIncomeQueryMode.Enabled = false; } else { List <DropItem> list = new List <DropItem>(); list.Add(new DropItem { ValueField = "", DisplayField = "" }); list.AddRange(StaticRescourse.GetMode(this.dropIncomeQueryPreMode.SelectedItem.Text)); this.dropIncomeQueryMode.DataSource = list; Helper.SetDropDownList(this.dropIncomeQueryMode); this.dropIncomeQueryMode.SelectedIndex = 0;; } }
/// <summary> /// 初始化卡号(新增) /// </summary> private void InitializeDropIncomeCardNumber() { CardCollection cardcoll = new CardCollection(); List <QueryElement> list = new List <QueryElement>(); cardcoll = CardMethods.GetCard(list); List <DropItem> card = new List <DropItem>(); card.Add(new DropItem { ValueField = "", DisplayField = " " }); for (int i = 0; i < cardcoll.Count; i++) { CardInfo cardInfo = cardcoll[i]; string bank = StaticRescourse.DisplayBank(cardInfo.BankId); card.Add(new DropItem { ValueField = cardInfo.Id.ToString(), DisplayField = cardInfo.CardNumber + " " + bank }); // +" "+bank } this.dropIncomeAddCardNumber.DataSource = card; Helper.SetDropDownList(this.dropIncomeAddCardNumber); this.dropIncomeAddCardNumber.SelectedValue = string.Empty; }
private void Initialize(CardInfo info) { List <DropItem> listUser = new List <DropItem>(); UserCollection userColl = new UserCollection(); UserInfo loginInfo = new UserInfo(); if (Session["UserCode"] != null) { loginInfo = UserMethods.GetUserByCode(Session["UserCode"].ToString()); } userColl = UserMethods.GetUser(new List <QueryElement>()); if (userColl != null && userColl.Count > 0) { foreach (var userInfo in userColl) { listUser.Add(new DropItem { ValueField = userInfo.Id.ToString(), DisplayField = userInfo.Name }); } } this.dropAddBank.DataSource = StaticRescourse.GetBank(); Helper.SetDropDownList(this.dropAddBank); this.dropAddCardOwner.DataSource = listUser; Helper.SetDropDownList(this.dropAddCardOwner); this.dropAddCardUser.DataSource = listUser; Helper.SetDropDownList(this.dropAddCardUser); this.dropCardAddAccountType.DataSource = StaticRescourse.GetAccountType(); Helper.SetDropDownList(this.dropCardAddAccountType); if (info.Id > 0) { string str = info.OpenDate.ToString("yyyy-MM-dd"); int date = Convert.ToInt32(str.Substring(0, 4) + str.Substring(5, 2) + str.Substring(8, 2)); this.dropAddBank.SelectedValue = info.BankId.ToString(); this.dropAddCardOwner.SelectedValue = info.OwnerId.ToString(); this.dropAddCardUser.SelectedValue = info.UserId.ToString(); this.dropCardAddAccountType.SelectedValue = info.AccountType.ToString(); this.txtAddCardNumber.Text = info.CardNumber; this.txtCardAddContent.Text = !string.IsNullOrEmpty(info.Content) ? info.Content : string.Empty; this.txtAddBankName.Text = !string.IsNullOrEmpty(info.BankName) ? info.BankName : string.Empty; this.txtAddCardOpenDate.Text = date > 20000101 ? info.OpenDate.ToString("yyyy-MM-dd") : string.Empty; this.txtAddCardNumber.Enabled = false; this.dropAddBank.Enabled = false; this.dropCardAddAccountType.Enabled = false; } else { this.txtAddCardNumber.Enabled = true; this.dropAddBank.Enabled = true; this.dropCardAddAccountType.Enabled = true; this.dropAddBank.SelectedIndex = 0; this.dropCardAddAccountType.SelectedIndex = 0; //this.dropAddCardOwner.SelectedValue = loginInfo.Id.ToString(); //this.dropAddCardUser.SelectedValue = loginInfo.Id.ToString(); this.txtAddCardOpenDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); } }
protected void btnIncomeEditSave_Click(object sender, EventArgs e) { CashIncomeInfo info = new CashIncomeInfo(); #region 验证 if (Session["editFlag"].Equals("true")) { this.ClientScript.RegisterStartupScript(this.GetType(), "", "DisplayEditIncomediv();", true); info.Id = Convert.ToInt32(Request.QueryString["IncomeId"]); } else { this.ClientScript.RegisterStartupScript(this.GetType(), "", "DisplayAddIncomediv();", true); } if (string.IsNullOrEmpty(this.dropIncomeAddCardNumber.SelectedValue)) { Alert.Show(this, "请选择卡号!"); this.dropIncomeAddCardNumber.Focus(); return; } if (string.IsNullOrEmpty(this.dropIncomeAddInComeType.SelectedValue)) { Alert.Show(this, "请输入收入类型!"); this.dropIncomeAddInComeType.Focus(); return; } if (string.IsNullOrEmpty(this.dropIncomeAddMode.SelectedValue)) { Alert.Show(this, "请输入存款状态!"); this.dropIncomeAddMode.Focus(); return; } if (string.IsNullOrEmpty(this.txtIncomeAddAmount.Text.Trim())) { Alert.Show(this, "请输入收入金额!"); this.txtIncomeAddAmount.Focus(); return; } if (string.IsNullOrEmpty(this.dropIncomeAddRate.SelectedValue)) { Alert.Show(this, "请输入利率!"); this.dropIncomeAddRate.Focus(); return; } if (string.IsNullOrEmpty(this.txtIncomeAddDepositDate.Text.Trim())) { Alert.Show(this, "请输入存款日期!"); this.txtIncomeAddDepositDate.Focus(); return; } if (string.IsNullOrEmpty(this.txtIncomeAddDepositorName.Text.Trim())) { Alert.Show(this, "请输入存款人!"); this.txtIncomeAddDepositDate.Focus(); return; } if (!string.IsNullOrEmpty(this.txtIncomeAddBDate.Text.Trim()) || !string.IsNullOrEmpty(this.txtIncomeAddEDate.Text.Trim())) { if (!string.IsNullOrEmpty(this.txtIncomeAddBDate.Text.Trim()) && string.IsNullOrEmpty(this.txtIncomeAddEDate.Text.Trim())) { Alert.Show(this, "请输入到期日期!"); this.txtIncomeAddEDate.Focus(); return; } else if (string.IsNullOrEmpty(this.txtIncomeAddBDate.Text.Trim()) && !string.IsNullOrEmpty(this.txtIncomeAddEDate.Text.Trim())) { Alert.Show(this, "请输入定存开始日期!"); this.txtIncomeAddBDate.Focus(); return; } else { bool comparflag = true; comparflag = HelperCommon.ValidDateTime(string.Format("{0:d}", this.txtIncomeAddBDate.Text.Trim()), string.Format("{0:d}", this.txtIncomeAddEDate.Text.Trim())); if (!comparflag) { Alert.Show(this, "到期日期不能小于开始日期"); this.txtIncomeAddEDate.Focus(); return; } comparflag = HelperCommon.ComparDay(string.Format("{0:d}", this.txtIncomeAddBDate.Text.Trim()), string.Format("{0:d}", this.txtIncomeAddEDate.Text.Trim())); if (!comparflag) { Alert.Show(this, "定存日期必须大于等于三个月!"); this.txtIncomeAddEDate.Focus(); return; } } } if (string.IsNullOrEmpty(this.dropIncomeAddStatus.SelectedValue)) { Alert.Show(this, "请选择收入状态!"); this.dropIncomeAddStatus.Focus(); return; } if (string.IsNullOrEmpty(this.dropIncomeAddDepositMode.SelectedValue)) { Alert.Show(this, "请选存款方式!"); this.dropIncomeAddDepositMode.Focus(); return; } if (string.IsNullOrEmpty(this.txtIncomeAddOwner.Text.Trim())) { Alert.Show(this, "请输入资产所有者!"); this.txtIncomeAddOwner.Focus(); return; } #endregion #region 赋值 UserInfo userInfo = UserMethods.GetUserByName(this.txtIncomeAddOwner.Text.Trim()); info.OwnerName = this.txtIncomeAddOwner.Text.Trim(); userInfo = UserMethods.GetUserByName(this.txtIncomeAddOwner.Text.Trim()); if (userInfo.Id > 0) { info.OwnerId = userInfo.Id; } else { info.OwnerId = 0; } CardInfo cardInfo = CardMethods.GetCardById(Convert.ToInt32(this.dropIncomeAddCardNumber.SelectedValue)); info.CardNumber = cardInfo.CardNumber; info.BankCardNumber = cardInfo.CardNumber + " " + StaticRescourse.DisplayBank(cardInfo.BankId); info.CardId = Convert.ToInt32(this.dropIncomeAddCardNumber.SelectedItem.Value); info.IncomeAmount = Convert.ToSingle(this.txtIncomeAddAmount.Text.Trim()); info.PreMode = Convert.ToInt32(this.dropIncomeAddPreMode.SelectedValue); info.Mode = Convert.ToInt32(this.dropIncomeAddMode.SelectedValue); info.PreRate = Convert.ToInt32(this.dropIncomeAddPreRate.SelectedValue); info.Rate = Convert.ToInt32(this.dropIncomeAddRate.SelectedValue); info.DepositDate = HelperCommon.ConverToDateTime(string.Format("{0:d}", this.txtIncomeAddDepositDate.Text.Trim())); if (!string.IsNullOrEmpty(this.txtIncomeAddBDate.Text.Trim())) { info.BDate = HelperCommon.ConverToDateTime(string.Format("{0:d}", this.txtIncomeAddBDate.Text.Trim())); } if (!string.IsNullOrEmpty(this.txtIncomeAddEDate.Text.Trim())) { info.EDate = HelperCommon.ConverToDateTime(string.Format("{0:d}", this.txtIncomeAddEDate.Text.Trim())); } if (this.checkIncomeAddAutoSave.Checked) { info.AutoSave = 1; } else { info.AutoSave = 0; } userInfo = UserMethods.GetUserByName(this.txtIncomeAddDepositorName.Text.Trim()); if (userInfo.Id > 0) { info.DepositorId = userInfo.Id; } else { info.DepositorId = 0; } info.DepositorName = this.txtIncomeAddDepositorName.Text.Trim(); info.DepositMode = Convert.ToInt32(this.dropIncomeAddDepositMode.SelectedValue); info.Status = Convert.ToInt32(this.dropIncomeAddStatus.SelectedValue); info.IncomeType = Convert.ToInt32(this.dropIncomeAddInComeType.SelectedValue); info.TAmount = info.IncomeAmount; info.Content = !string.IsNullOrEmpty(this.txtIncomeAddContent.Text.Trim()) ? this.txtIncomeAddContent.Text.Trim() : string.Empty; #endregion int iSuccess = CashIncomeMethods.InsertOrUpdatetocashincome(info); this.ClientScript.RegisterStartupScript(this.GetType(), "", "DisplayAddIncomediv();", true); if (iSuccess > 0) { Alert.Show(this, "新增一条收入成功!"); } else if (iSuccess == -1) { Alert.Show(this, "修改成功!"); } else { Alert.Show(this, "操作失败!"); } InitializeIncomeAdd(new CashIncomeInfo()); queryList = new List <QueryElement>(); BindIncomeListDataGrid(queryList); }