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 = "未还";
                }
            }
        }
Beispiel #2
0
 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);
     }
 }
Beispiel #3
0
        /// <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);
        }
Beispiel #4
0
        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 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);
            }
        }
Beispiel #6
0
        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>
        /// 初始化卡号(新增)
        /// </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;
        }
        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);
        }