コード例 #1
0
        public FinancePage <AccountingItem> getList2(FinancePage <AccountingItem> financePage, string company, int classId, string code)
        {
            //类别
            var classParam = new SqlParameter("@class", classId);
            //公司
            var companyParam = new SqlParameter("@company", company);
            //查询最小行号
            var minPageParam = new SqlParameter("@minPageParam", financePage.getMin());
            //查询最大行号
            var maxPageParam = new SqlParameter("@maxPageParam", financePage.getMax());

            var kemudaima = new SqlParameter("@code", code);

            string sql = "select (case len(code) when 4 then 'I' when 6 then 'II' when 8 then 'III' else '' end) as grade,*,isnull((SELECT SUM(money) FROM VoucherSummary WHERE VoucherSummary.code = a.code),0) as money,isnull((select top 1 name from Accounting as ac where ac.code = LEFT(a.code,4)),'') + isnull((select top 1 '-'+name from Accounting as ac where ac.code = LEFT(a.code,6) and ac.code != LEFT(a.code,4)),'') + isnull((select top 1 '-'+name from Accounting as ac where ac.code = LEFT(a.code,8) and ac.code != LEFT(a.code,6)),'') as fullName from (select *,ROW_NUMBER() over(order by LEN(code),id) as rownum from (select * from (SELECT *,LEFT(code, 1) AS class from Accounting) as t where t.class = @class and t.company = @company) as c )as a where a.rownum > @minPageParam and a.rownum < @maxPageParam";

            if (code != "")
            {
                sql = sql + " and code like '%" + code + "%'";
            }

            var result = fin.Database.SqlQuery <AccountingItem>(sql, classParam, companyParam, minPageParam, maxPageParam);

            try
            {
                financePage.pageList = result.ToList();
            }
            catch (Exception ex)
            {
                FinanceToError.getFinanceToError().toError();
            }
            return(financePage);
        }
コード例 #2
0
        public string getExpenditureList(string financePageJson)
        {
            //分页对象
            FinancePage <ManagementExpenditure> financePage = null;

            try
            {
                //创建service层实例
                managementService = new ManagementService();
                //处理json
                financePage = FinanceJson.getFinanceJson().toObject <FinancePage <ManagementExpenditure> >(financePageJson);
                //获取处理过的分页对象
                financePage = managementService.getManagementExpenditureList(financePage);

                return(FinanceResultData.getFinanceResultData().success(200, financePage, "成功"));
            }
            catch (InvalidOperationException ex)
            {
                //身份验证不通过
                return(FinanceResultData.getFinanceResultData().fail(401, null, ex.Message));
            }
            catch (Exception ex)
            {
                //未知的错误
                return(FinanceResultData.getFinanceResultData().fail(500, null, "未知的错误"));
            }
        }
コード例 #3
0
        public string getSimpleAccountingList(string financePageJson)
        {
            using (fin = new FinanceEntities())
            {
                //分页对象
                FinancePage <SimpleAccountingSummary> financePage = null;
                try
                {
                    //创建service层实例
                    simpleAccountingService = new SimpleAccountingService();
                    //处理json
                    financePage = FinanceJson.getFinanceJson().toObject <FinancePage <SimpleAccountingSummary> >(financePageJson);
                    //获取处理过的分页对象
                    financePage = simpleAccountingService.getSimpleAccountingList(financePage);

                    return(FinanceResultData.getFinanceResultData().success(200, financePage, "成功"));
                }
                catch (InvalidOperationException ex)
                {
                    //身份验证不通过
                    return(FinanceResultData.getFinanceResultData().fail(401, null, ex.Message));
                }
                catch (Exception ex)
                {
                    //未知的错误
                    return(FinanceResultData.getFinanceResultData().fail(500, null, "未知的错误"));
                }
            }
        }
コード例 #4
0
        /// <summary>
        /// 获取集合
        /// </summary>
        /// <param name="financePage">分页对象</param>
        /// <param name="company">公司名</param>
        /// <returns>有pegeList的分页对象</returns>
        public FinancePage <Liabilities> getLiabilitiesList(FinancePage <Liabilities> financePage, string company)
        {
            var companyParam = new SqlParameter("@company", company);

            var minPageParam = new SqlParameter("@minPage", financePage.getMin());

            var maxPageParam = new SqlParameter("@maxPage", financePage.getMax());

            var classParam = new SqlParameter("@class", financePage.selectParamsMap["classId"]);

            var start_date = new SqlParameter("@start_date", financePage.selectParamsMap["start_date"]);

            var stop_date = new SqlParameter("@stop_date", financePage.selectParamsMap["stop_date"]);

            //string sql = "select all_.name,all_.load,all_.borrowed,all_.money from (select row_number() over(order by a.name) as rownum,a.name,sum(a.load) as load,sum(a.borrowed) as borrowed,isnull(sum(v.money),0) as money from Accounting as a left join VoucherSummary as v on a.code = v.code and v.company = @company and year(v.voucherDate) = @year and month(v.voucherDate) = @month where a.company = @company and left(a.code,1) = @class group by a.name,left(a.code,1)) as all_ where all_.rownum > @minPage and all_.rownum < @maxPage";
            string sql = "select name,[load],borrowed,CONVERT(Decimal,0) as money from (select row_number() over(order by a.name) as rownum, a.name,left(a.code,1) as class,v.company,(CASE @class WHEN 1 THEN sum(load-borrowed) ELSE sum(borrowed-load) END) as [load],(CASE @class WHEN 1 THEN sum([load]-borrowed+ISNULL(v.money, 0)) ELSE sum(borrowed-[load]+ISNULL(v.money, 0)) END) as borrowed from Accounting as a left join VoucherSummary as v on a.code = v.code WHERE left(a.code,1) = @class and a.company = @company and v.voucherDate >= convert(date,@start_date) and v.voucherDate <= convert(date,@stop_date) GROUP BY a.code,a.name,v.company) as a where (a.company = @company or a.company is null) and a.rownum > @minPage and a.rownum < @maxPage";
            //string sql = "select all_.name,all_.load,all_.borrowed,all_.money from (select row_number() over(order by a.name) as rownum,a.name,sum(a.load) as load,sum(a.borrowed) as borrowed,isnull(sum(v.money),0) as money from Accounting as a left join VoucherSummary as v on a.code = v.code and v.company = @company and v.voucherDate >= CONVERT(date,@start_date) and v.voucherDate <= CONVERT(date,@stop_date) where a.company = @company and left(a.code,1) = 1 group by a.name,left(a.code,1)) as all_ where all_.rownum > @minPage and all_.rownum < @maxPage";
            var result = fin.Database.SqlQuery <Liabilities>(sql, companyParam, minPageParam, maxPageParam, classParam, start_date, stop_date);

            try
            {
                financePage.pageList = result.ToList();
            }
            catch (Exception ex)
            {
                FinanceToError.getFinanceToError().toError();
            }
            return(financePage);
        }
コード例 #5
0
        public string getVoucherSummaryList(string financePageJson)
        {
            //分页对象
            FinancePage <VoucherSummaryItem> financePage = null;

            try
            {
                //创建service层实例
                voucherSummaryService = new VoucherSummaryService();
                //处理json
                financePage = FinanceJson.getFinanceJson().toObject <FinancePage <VoucherSummaryItem> >(financePageJson);
                //获取处理过的分页对象
                financePage = voucherSummaryService.getVoucherSummaryList(financePage);

                return(FinanceResultData.getFinanceResultData().success(200, financePage, "成功"));
            }
            catch (InvalidOperationException ex)
            {
                //身份验证不通过
                return(FinanceResultData.getFinanceResultData().fail(401, null, ex.Message));
            }
            catch (Exception ex)
            {
                //未知的错误
                return(FinanceResultData.getFinanceResultData().fail(500, null, "未知的错误"));
            }
        }
コード例 #6
0
        /// <summary>
        /// 获取list
        /// </summary>
        /// <param name="financePage">分页对象</param>
        /// <param name="classId">科目类别id</param>
        /// <returns>有pageList的分页对象</returns>
        public FinancePage <AccountingItem> getList(FinancePage <AccountingItem> financePage, int classId)
        {
            FinancePage <AccountingItem> page = accountingModel.getList(financePage, account.company, classId);

            page.total = accountingModel.getPageCount(account.company, classId);
            return(page);
        }
コード例 #7
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            FinancePage fp = new FinancePage();

            fp.SaveNetWorth(emailaddress.Text, totalAsset.Text, totalDebt.Text, netWorth.Text);

            emailaddress.Text = "";
            totalAsset.Text   = "";
            totalDebt.Text    = "";
            netWorth.Text     = "";

            if (!string.IsNullOrEmpty(emailaddress.Text) || string.IsNullOrEmpty(emailaddress.Text))
            {
                emailaddress.Text = "Email: " + MainWindow.copyEmail;
            }

            MessageBox.Show("Please Refresh History.");

            retirementAccount.Clear();
            bankAccount.Clear();
            homeValue.Clear();
            otherAsset.Clear();
            totalAsset.Clear();
            carLoan.Clear();
            mortgage.Clear();
            studentLoans.Clear();
            otherDebt.Clear();
            totalDebt.Clear();
            netAsset.Clear();
            netDebt.Clear();
            netWorth.Clear();
        }
コード例 #8
0
ファイル: CommonModel.cs プロジェクト: yhltd/YH_jinxiaocun_PC
        /// <summary>
        /// 获取泛型类的集合
        /// </summary>
        /// <typeparam name="T">泛型</typeparam>
        /// <param name="entity">泛型对象</param>
        /// <param name="financePage">分页对象</param>
        /// <param name="company">公司名</param>
        /// <param name="columnName">特殊字段处理</param>
        /// <returns>有pageList的分页对象</returns>
        public FinancePage <T> getComList <T>(T entity, FinancePage <T> financePage, string company, string columnName)
        {
            var companyParam = new SqlParameter("@company", company);
            var maxPageParam = new SqlParameter("@maxPage", financePage.getMax());
            var minPageParam = new SqlParameter("@minPage", financePage.getMin());


            string sqlString = fin.Set(entity.GetType()).ToString();
            string sql       = "select l.*,l." + columnName + " as " + columnName + "1 from (select ROW_NUMBER() over(order by id) as rownum,a.* from (" + sqlString + ") as a) as l where l.rownum > @minPage and l.rownum < @maxPage and l.company = @company";

            var result = fin.Set(entity.GetType()).SqlQuery(sql, companyParam, maxPageParam, minPageParam);

            try
            {
                var selectList = result.GetEnumerator();
                while (selectList.MoveNext())
                {
                    financePage.pageList.Add((T)selectList.Current);
                }
            }
            catch (Exception ex)
            {
                FinanceToError.getFinanceToError().toError();
            }
            return(financePage);
        }
コード例 #9
0
 public string getList2(string financePageJson, int classId, string code)
 {
     if (financePageJson != "")
     {
         FinancePage <AccountingItem> financePage = new FinancePage <AccountingItem>();
         financePage = FinanceJson.getFinanceJson().toObject <FinancePage <AccountingItem> >(financePageJson);
         try
         {
             asc         = new AccountingService();
             financePage = asc.getList2(financePage, classId, code);
             return(FinanceResultData.getFinanceResultData().success(200, financePage, "成功"));
         }
         catch (InvalidOperationException ex)
         {
             //身份验证不通过
             return(FinanceResultData.getFinanceResultData().fail(401, null, ex.Message));
         }
         catch (Exception ex)
         {
             //未知的错误
             return(FinanceResultData.getFinanceResultData().fail(500, null, "未知的错误"));
         }
     }
     else
     {
         return(FinanceResultData.getFinanceResultData().fail(500, null, "失败"));
     }
 }
コード例 #10
0
        /// <summary>
        /// 获取分页对象的pageList和总页数
        /// </summary>
        /// <param name="financePage">分页对象</param>
        /// <returns>处理过的分页对象</returns>
        public FinancePage <Liabilities> getLiabilitiesList(FinancePage <Liabilities> financePage)
        {
            //获取pageList
            financePage = liabilitiesModel.getLiabilitiesList(financePage, account.company);
            int classId = int.Parse(financePage.selectParamsMap["classId"]);

            //foreach (Liabilities l in financePage.pageList) {
            //    decimal load = l.load;
            //    decimal borrowed = l.borrowed;
            //    decimal money = l.money;
            //    if (classId == 1)
            //    {
            //        l.load = load - borrowed;
            //        l.borrowed = load - borrowed + money;
            //    }
            //    else {
            //        l.load = borrowed - load;
            //        l.borrowed = borrowed - load + money;
            //    }
            //}
            //获取总行数
            financePage.total = liabilitiesModel.getCount(account.company, classId);

            return(financePage);
        }
コード例 #11
0
        public string getSimpleDataList(string financePageJson, string start_date, string stop_date)
        {
            //分页对象
            FinancePage <SimpleData> financePage = null;

            try
            {
                //创建service层实例
                simpleDataService = new SimpleDataService();
                //处理json
                financePage = FinanceJson.getFinanceJson().toObject <FinancePage <SimpleData> >(financePageJson);
                //获取处理过的分页对象
                financePage = simpleDataService.getSimpleDataList(financePage, start_date, stop_date);

                return(FinanceResultData.getFinanceResultData().success(200, financePage, "成功"));
            }
            catch (InvalidOperationException ex)
            {
                //身份验证不通过
                return(FinanceResultData.getFinanceResultData().fail(401, null, ex.Message));
            }
            catch (Exception ex)
            {
                //未知的错误
                return(FinanceResultData.getFinanceResultData().fail(500, null, "未知的错误"));
            }
        }
コード例 #12
0
        public string getList2(string financePageJson, string dep)
        {
            //分页对象
            FinancePage <DepartmentItem> financePage = null;

            try
            {
                //创建service层实例
                departmentService = new DepartmentService();
                //处理json
                financePage = FinanceJson.getFinanceJson().toObject <FinancePage <DepartmentItem> >(financePageJson);
                //获取处理过的分页对象
                financePage = departmentService.getListService2(financePage, dep);

                return(FinanceResultData.getFinanceResultData().success(200, financePage, "成功"));
            }
            catch (InvalidOperationException ex)
            {
                //身份验证不通过
                return(FinanceResultData.getFinanceResultData().fail(401, null, ex.Message));
            }
            catch (Exception ex)
            {
                //未知的错误
                return(FinanceResultData.getFinanceResultData().fail(500, null, "未知的错误"));
            }
        }
コード例 #13
0
ファイル: ProfitModel.cs プロジェクト: yhltd/YH_jinxiaocun_PC
        /// <summary>
        /// 获取总行数
        /// </summary>
        /// <param name="company">公司名</param>
        /// <returns>总条数</returns>
        public int getCount(FinancePage <Profit> financePage, string company)
        {
            var companyParam = new SqlParameter("@company", company);

            var directionsParam = new SqlParameter("@direction", financePage.selectParamsMap["direction"]);

            var start_date = new SqlParameter("@start_date", financePage.selectParamsMap["start_date"]);

            var stop_date = new SqlParameter("@stop_date", financePage.selectParamsMap["stop_date"]);

            string sql = "select name,y.sum_month,y.sum_year from Accounting as a,(SELECT code,isnull((SELECT sum(money) FROM VoucherSummary WHERE voucherDate >= CONVERT(date,@start_date) and voucherDate <= CONVERT(date,@stop_date) AND code = y.code),0) AS sum_month,isnull((SELECT sum(money) FROM VoucherSummary WHERE YEAR(voucherDate) = year(CONVERT(date,@start_date)) AND code = y.code),0) AS sum_year FROM VoucherSummary AS y WHERE company = @company and YEAR(voucherDate) = year(CONVERT(date,@start_date)) GROUP BY y.code) as y where a.code = y.code and a.company = @company and a.direction = @direction";

            var result = fin.Database.SqlQuery <Liabilities>(sql, companyParam, directionsParam, start_date, stop_date);
            int count  = 0;

            try
            {
                count = result.ToList().Count;
            }
            catch (Exception ex)
            {
                FinanceToError.getFinanceToError().toError();
            }
            return(count);
        }
コード例 #14
0
ファイル: ProfitModel.cs プロジェクト: yhltd/YH_jinxiaocun_PC
        /// <summary>
        /// 获取集合
        /// </summary>
        /// <param name="financePage">分页对象</param>
        /// <param name="company">公司名</param>
        /// <returns>有pegeList的分页对象</returns>
        public FinancePage <Profit> getProfitList(FinancePage <Profit> financePage, string company)
        {
            var companyParam = new SqlParameter("@company", company);

            var minPageParam = new SqlParameter("@minPage", financePage.getMin());

            var maxPageParam = new SqlParameter("@maxPage", financePage.getMax());

            var directionsParam = new SqlParameter("@direction", financePage.selectParamsMap["direction"]);

            var start_date = new SqlParameter("@start_date", financePage.selectParamsMap["start_date"]);

            var stop_date = new SqlParameter("@stop_date", financePage.selectParamsMap["stop_date"]);

            string sql = "select name,sum_month,sum_year from (select name,y.sum_month,y.sum_year,row_number() over(order by name) as rownum from Accounting as a,(SELECT code,isnull((SELECT sum(money) FROM VoucherSummary WHERE voucherDate >= CONVERT(date,@start_date) and voucherDate <= CONVERT(date,@stop_date) AND code = y.code),0) AS sum_month,isnull((SELECT sum(money) FROM VoucherSummary WHERE YEAR(voucherDate) = year(CONVERT(date,@start_date)) AND code = y.code),0) AS sum_year FROM VoucherSummary AS y WHERE company = @company and YEAR(voucherDate) = year(CONVERT(date,@start_date)) GROUP BY y.code) as y where a.code = y.code and a.company = @company and a.direction = @direction) as t  where t.rownum > @minPage and t.rownum < @maxPage";

            var result = fin.Database.SqlQuery <Profit>(sql, companyParam, minPageParam, maxPageParam, directionsParam, start_date, stop_date);

            try
            {
                financePage.pageList = result.ToList();
            }
            catch (Exception ex)
            {
                FinanceToError.getFinanceToError().toError();
            }
            return(financePage);
        }
コード例 #15
0
        /// <summary>
        /// 获取集合
        /// </summary>
        /// <param name="financePage">分页对象</param>
        /// <param name="company">公司名</param>
        /// <returns>有pegeList的分页对象</returns>
        public FinancePage <Flow> getFlowList(FinancePage <Flow> financePage, string company)
        {
            var companyParam = new SqlParameter("@company", company);

            var minPageParam = new SqlParameter("@minPage", financePage.getMin());

            var maxPageParam = new SqlParameter("@maxPage", financePage.getMax());

            var start_date = new SqlParameter("@start_date", financePage.selectParamsMap["start_date"]);

            var stop_date = new SqlParameter("@stop_date", financePage.selectParamsMap["stop_date"]);

            //string sql = "select all_.expenditure,all_.money_month,all_.money_year from (select row_number() over(order by expenditure) as rownum,expenditure,isnull((select sum(s.money) from VoucherSummary as s where company = @company and year(voucherDate) = @year and month(voucherDate) = @month and s.expenditure = v.expenditure),0) as money_month,isnull((select sum(s.money) from VoucherSummary as s where company = @company and year(voucherDate) = @year and s.expenditure = v.expenditure),0) as money_year from VoucherSummary as v where company = @company GROUP BY expenditure) as all_ where all_.rownum > @minPage and all_.rownum < @maxPage";
            string sql    = "select all_.expenditure,all_.money_month,all_.money_year from (select row_number() over(order by expenditure) as rownum,expenditure,isnull((select sum(s.money) from VoucherSummary as s where company = @company and voucherDate >= CONVERT(date,@start_date) and voucherDate <= CONVERT(date,@stop_date) and s.expenditure = v.expenditure),0) as money_month,isnull((select sum(s.money) from VoucherSummary as s where company = @company and year(voucherDate) = year(CONVERT(date,@start_date)) and s.expenditure = v.expenditure),0) as money_year from VoucherSummary as v where company = @company GROUP BY expenditure) as all_ where all_.rownum > @minPage and all_.rownum < @maxPage";
            var    result = fin.Database.SqlQuery <Flow>(sql, companyParam, minPageParam, maxPageParam, start_date, stop_date);

            try
            {
                financePage.pageList = result.ToList();
            }
            catch (Exception ex)
            {
                FinanceToError.getFinanceToError().toError();
            }
            return(financePage);
        }
コード例 #16
0
 public FinancePage <DepartmentItem> getListService2(FinancePage <DepartmentItem> financePage, string dep)
 {
     //获取pageList
     financePage = departmentModel.getList2(financePage, account.company, dep);
     //获取总页数
     financePage.total = departmentModel.getPageCount(account.company);
     return(financePage);
 }
コード例 #17
0
 /// <summary>
 /// 获取分页对象的pageList和总页数
 /// </summary>
 /// <param name="financePage">分页对象</param>
 /// <returns>处理过的分页对象</returns>
 public FinancePage <VoucherWord> getVoucherWordList(FinancePage <VoucherWord> financePage)
 {
     //获取pageList
     financePage = voucherWordModel.getList(financePage, account.company);
     //获取总行数
     financePage.total = voucherWordModel.getCount(account.company);
     return(financePage);
 }
コード例 #18
0
 /// <summary>
 /// 获取分页对象的pageList和总页数
 /// </summary>
 /// <param name="financePage">分页对象</param>
 /// <returns>处理过的分页对象</returns>
 public FinancePage <Profit> getProfitList(FinancePage <Profit> financePage)
 {
     //获取pageList
     financePage = profitModel.getProfitList(financePage, account.company);
     //获取总行数
     financePage.total = profitModel.getCount(financePage, account.company);
     return(financePage);
 }
コード例 #19
0
 public FinancePage <User_ManagementItem> getListService(FinancePage <User_ManagementItem> financePage)
 {
     //获取pageList
     financePage = user_managementmodel.getList(financePage, account.company);
     //获取总页数
     financePage.total = user_managementmodel.getPageCount(account.company);
     return(financePage);
 }
コード例 #20
0
        /// <summary>
        /// 获取分页对象的pageList和总页数
        /// </summary>
        /// <param name="financePage">分页对象</param>
        /// <returns>处理过的分页对象</returns>
        public FinancePage <Flow> getFlowList(FinancePage <Flow> financePage)
        {
            //获取pageList
            financePage = flowModel.getFlowList(financePage, account.company);
            //获取总行数
            financePage.total = flowModel.getCount(account.company);

            return(financePage);
        }
コード例 #21
0
        /// <summary>
        /// 获取分页对象的pageList和总页数
        /// </summary>
        /// <param name="financePage">分页对象</param>
        /// <returns>处理过的分页对象</returns>
        public FinancePage <ManagementIncome> getManagementIncomeList(FinancePage <ManagementIncome> financePage)
        {
            ManagementIncome managementIncome = new ManagementIncome();

            //获取pageList
            financePage = commonModel.getComList <ManagementIncome>(managementIncome, financePage, account.company, "managementIncome");
            //获取总行数
            financePage.total = commonModel.getComTotal <ManagementIncome>(managementIncome, account.company, "managementIncome");
            return(financePage);
        }
コード例 #22
0
        /// <summary>
        /// 获取分页对象的pageList和总页数
        /// </summary>
        /// <param name="financePage">分页对象</param>
        /// <returns>处理过的分页对象</returns>
        public FinancePage <FinancingIncome> getFinancingIncomeList(FinancePage <FinancingIncome> financePage)
        {
            FinancingIncome financingIncome = new FinancingIncome();

            //获取pageList
            financePage = commonModel.getComList <FinancingIncome>(financingIncome, financePage, account.company, "financingIncome");
            //获取总行数
            financePage.total = commonModel.getComTotal <FinancingIncome>(financingIncome, account.company, "financingIncome");
            return(financePage);
        }
コード例 #23
0
        /// <summary>
        /// 获取分页对象的pageList和总页数
        /// </summary>
        /// <param name="financePage">分页对象</param>
        /// <returns>处理过的分页对象</returns>
        public FinancePage <InvestmentIncome> getInvestmentIncomeList(FinancePage <InvestmentIncome> financePage)
        {
            InvestmentIncome investmentIncome = new InvestmentIncome();

            //获取pageList
            financePage = commonModel.getComList <InvestmentIncome>(investmentIncome, financePage, account.company, "investmentIncome");
            //获取总行数
            financePage.total = commonModel.getComTotal <InvestmentIncome>(investmentIncome, account.company, "investmentIncome");
            return(financePage);
        }
コード例 #24
0
        public void IsChangedDropDownMenuCurrency_AreEqual()
        {
            string cashAmountFirstField = "4.26";

            FinancePage financePage = homePage.OpenFinancePage();

            financePage.SetCurrencyConverterFirstField(cashAmountFirstField);
            financePage.SetCurrencyConverterFirstCurrency("USD");

            AllureLifecycle.Instance.Verify.That($"cash in first field: {cashAmountFirstField} should correspond to cash in second field: {financePage.GetCurrencyConverterSecondField()}", cashAmountFirstField, Is.EqualTo(financePage.GetCurrencyConverterSecondField()));
        }
コード例 #25
0
        public void IsChangedDropDownMenuCurrency_AreEqual()
        {
            string cashAmountFirstField = "4.26";

            FinancePage financePage = homePage.OpenFinancePage();

            financePage.SetCurrencyConverterFirstField(cashAmountFirstField);
            financePage.SetCurrencyConverterFirstCurrency("USD");

            string cashAmountSecondField = financePage.GetCurrencyConverterSecondField();

            Assert.AreEqual(cashAmountFirstField, cashAmountSecondField);
        }
コード例 #26
0
        public void FT_12M_main()
        {
            MainPage    mainPage    = new MainPage();
            FinancePage financePage = new FinancePage();

            webDriver.Url = UsefullMethods.OpenTytbySite;
            webDriver.FindElement(By.XPath(mainPage.headerResourses)).Click();
            webDriver.FindElement(By.XPath(mainPage.resourceFinance)).Click();
            IWebElement FinElement = webDriver.FindElement(By.XPath(financePage.asideMenu));

            Assert.IsTrue(FinElement.Displayed);
            webDriver.FindElement(By.XPath(financePage.returnToMainPage)).Click();
            webDriver.FindElement(By.XPath(mainPage.headerResourses)).Click();
        }
コード例 #27
0
        public void CheckVisibilityOfAdditionalNews()
        {
            FinancePage fp = new FinancePage();

            fp.Load();
            Assert.AreEqual(fp.AdditionalNewsCount, 5);
            //  Assert.IsFalse(fp.isSeachFormDisplayed);
            var    news  = fp.GetSideNews();
            string text  = fp.GetSideNews().ElementAt(1).Text;
            string date  = fp.GetSideNews().ElementAt(1).Date;
            int    count = fp.GetSideNews().ElementAt(1).Count;

            Assert.IsTrue(news.First().Text.Contains("Forbes назвал богатейшего человека мира"));
        }
コード例 #28
0
        public void TestToBePassed()
        {
            FinancePage fp = new FinancePage();

            fp.Load();
            IWebElement container  = Driver.Instance.FindElement(By.CssSelector("div.additional_news li"));
            By          subElement = By.ClassName("_title");
            var         test1      = container.FindElement(new ByChained(subElement)).Text;

            System.Console.WriteLine(test1);
            var test = DriverExtensions.GetElement(container, subElement).Text;

            System.Console.WriteLine(test);
            Assert.IsTrue(true);
        }
コード例 #29
0
        /// <summary>
        /// 查询list
        /// </summary>
        /// <param name="financePage">分页对象</param>
        /// <param name="company">公司</param>
        /// <returns>有pageList的分页对象</returns>
        public FinancePage <VoucherSummaryItem> getList(FinancePage <VoucherSummaryItem> financePage, string company)
        {
            //年
            string start_date = financePage.selectParamsMap["start_date"];
            //月
            string stop_date = financePage.selectParamsMap["stop_date"];

            var @params = new SqlParameter[6] {
                //公司
                new SqlParameter("@company", company),
                //查询最小行数
                new SqlParameter("@minPage", financePage.getMin()),
                //查询最大行数
                new SqlParameter("@maxPage", financePage.getMax()),
                //凭证字
                new SqlParameter("@word", financePage.selectParamsMap["word"]),
                //年
                new SqlParameter("@start_date", start_date),
                //月
                new SqlParameter("@stop_date", stop_date)
            };

            string sql = "select * from (select isnull((select name from Accounting where code = LEFT (vs.code, 4)),'')+isnull((select top 1 '-'+name from Accounting where code = LEFT (vs.code, 6) and code != LEFT (vs.code, 4)),'')+isnull((select top 1 '-'+name from Accounting where code = LEFT (vs.code, 8) and code != LEFT (vs.code, 6)),'') as fullName,vs.id,vs.word,vs.[no],voucherDate,vs.abstract,vs.code,vs.department,vs.expenditure,vs.note,vs.man,ac.name,isnull(ac.load,0) as load,isnull(ac.borrowed,0) as borrowed,vs.money,vs.real,ROW_NUMBER() over(order by vs.id) rownum from VoucherSummary as vs left join Accounting as ac on vs.code = ac.code and ac.company = @company where vs.company = @company) t where t.rownum > @minPage and t.rownum < @maxPage and t.word like '%'+@word+'%'";

            if (!start_date.Equals(string.Empty))
            {
                sql += " and t.voucherDate >= @start_date";
            }
            if (!stop_date.Equals(string.Empty))
            {
                sql += " and t.voucherDate <= @stop_date";
            }

            var result = fin.Database.SqlQuery <VoucherSummaryItem>(sql, @params);

            try
            {
                financePage.pageList = result.ToList();
            }
            catch (Exception ex)
            {
                FinanceToError.getFinanceToError().toError();
            }
            return(financePage);
        }
コード例 #30
0
ファイル: InvoiceBillsReports.cs プロジェクト: magnus80/at
        public void step_13()
        {
            Logger.PrintStepName("Step 13");
            Logger.PrintAction("Перейти в раздел Финансовая информация ", "");

            string rezult = homePage.GoToFinancePage();

            if (rezult != "success")
            {
                globalR = false;
                Logger.PrintRezult(false, rezult);
            }
            else
            {
                Logger.PrintRezult(true, "Страница  Финансовой информация корректна ");
            }
            financePage = homePage.financePage;
        }