コード例 #1
0
        static void Main(string[] args)
        {
            DataTable dt = new DataTable();

            dt.Columns.Add(new DataColumn("colA", typeof(String)));
            dt.Columns.Add(new DataColumn("colB", typeof(String)));

            for (int i = 0; i < 10; i++)
            {
                DataRow row = dt.NewRow();
                row["colA"] = String.Format("{0} Atest", i);
                row["colB"] = String.Format("{0} Btest", i);
                dt.Rows.Add(row);
            }
            ;

            var dl = new DummyList();

            dl.AsyncFill(dt);

            foreach (var itm in dl)
            {
                Console.WriteLine(itm.colA);
            }
            ;
            Console.ReadKey();
        }
コード例 #2
0
        public bool Prepare()
        {
            if (DummyManager.InProgress)
            {
                return(false);
            }

            CurDummyIterationCount = 0;
            CurrentConnectingCount = 0;
            DummyList.Clear();

            var config = DummyManager.Config;

            DummyManager.DummyCount = config.DummyCount;

            for (int i = 0; i < config.DummyCount; ++i)
            {
                var dummy = new Dummy();
                dummy.Init(i, (config.DummyStartNumber + i));
                DummyList.Add(dummy);
            }
            InProgress = true;

            StartDummyActionMaxWaitCheckThread();

            return(true);
        }
コード例 #3
0
        public void print_account_chart(Acc_list account, int c = 0, object ths = null)
        {
            MicroAccountsEntities1 accs = new MicroAccountsEntities1();

            int count = c;

            acc_list = new Acc_list();


            if (account != null)
            {
                if (account.id != 0)
                {
                }
                if (account.children_ledgers.Count() > 0)
                {
                    count++;

                    // Store keys in a List
                    List <int> list = new List <int>(account.children_ledgers.Keys);

                    // Loop through list
                    foreach (int k in list)
                    {
                        dm        = new DummyList();
                        dm.ledger = account.children_ledgers[k].name;
                        dm.opBal  = toCurr.toCurrenc(account.children_ledgers[k].op_total_dc, account.children_ledgers[k].op_total);
                        dm.drAmt  = toCurr.toCurrenc("D", account.children_ledgers[k].dr_total);
                        dm.crAmt  = toCurr.toCurrenc("C", account.children_ledgers[k].dr_total);

                        if (account.children_ledgers[k].cl_total_dc == "D")
                        {
                            dm.clBal = toCurr.toCurrenc("D", account.children_ledgers[k].dr_total);
                        }
                        else
                        {
                            dm.clBal = toCurr.toCurrenc("C", account.children_ledgers[k].dr_total);
                        }

                        dmList.Add(dm);
                    }

                    count--;
                }

                foreach (Acc_list acc in account.children_groups)
                {
                    count++;
                    print_account_chart(acc, count, this);
                    count--;
                }



                //PlaceHolder3.Controls.Add(new Literal { Text = html.ToString() });
            }
        }
コード例 #4
0
ファイル: DataSet.cs プロジェクト: MDhondt/NoruST
        /// <summary>
        /// Update the <see cref="DataList"/> based on different settings.
        /// </summary>
        /// <param name="layout">Specifies if the data is represented in columns or rows.</param>
        /// <param name="firstIsName">The indication if the first row/column has the names of the variables.</param>
        public void UpdateDataList(Layout layout, bool firstIsName)
        {
            // Set some variables.
            Layout      = layout;
            FirstIsName = firstIsName;
            var offset = FirstIsName ? 1 : 0;

            // Remove the named ranges from the workbook.
            foreach (var data in DataList)
            {
                Globals.ExcelAddIn.Application.ActiveWorkbook.Names.Item(data.RangeName.Name).Delete();
            }

            // Clear the current list of date.
            DataList.Clear();
            LagList.Clear();
            DummyList.Clear();

            // Populate the list with data.
            if (Layout == Layout.Columns)
            {
                for (var column = 0; column < Range.Columns.Count; column++)
                {
                    // Name of the variable.
                    var header = FirstIsName
                        ? Convert.ToString(((Range)Sheet.Cells[Range.Row, Range.Column + column]).Value2)
                        : "Var_" + (column + 1);

                    // Range of the data.
                    var upperLeftCell  = Sheet.Cells[Range.Row + offset, Range.Column + column];
                    var lowerRightCell = Sheet.Cells[Range.Row + Range.Rows.Count - 1, Range.Column + column];
                    var dataRange      = Sheet.Range[upperLeftCell, lowerRightCell];

                    // Add the data to the list.
                    DataList.Add(new Data(Sheet, dataRange, header));
                }
            }
            else
            {
                for (var row = 0; row < Range.Rows.Count; row++)
                {
                    // Name of the variable.
                    var header = FirstIsName
                        ? Convert.ToString(((Range)Sheet.Cells[Range.Row + row, Range.Column]).Value2)
                        : "";

                    // Range of the data.
                    var upperLeftCell  = Sheet.Cells[Range.Row + row, Range.Column + offset];
                    var lowerRightCell = Sheet.Cells[Range.Row + row, Range.Column + Range.Columns.Count - 1];
                    var dataRange      = Sheet.Range[upperLeftCell, lowerRightCell];

                    // Add the data to the list.
                    DataList.Add(new Data(Sheet, dataRange, header));
                }
            }
        }
コード例 #5
0
        private void trailBal()
        {
            try
            {
                tbl_AccGroup  grp  = new tbl_AccGroup();
                tbl_AccLedger ledg = new tbl_AccLedger();

                acc_list               = new Acc_list();
                acc_list.group         = grp.ToString();
                acc_list.ledger        = ledg.ToString();
                acc_list.only_opening  = false;
                acc_list.start_date    = null;
                acc_list.end_date      = null;
                acc_list.affects_gross = -1;
                acc_list.start(0);

                decimal dr = acc_list.dr_total;
                decimal cr = acc_list.cr_total;

                print_account_chart(acc_list, -1, this);

                ReportDataSource datasource = new ReportDataSource("DataSet1", dmList);

                this.reportViewer1.LocalReport.DataSources.Clear();
                this.reportViewer1.LocalReport.DataSources.Add(datasource);

                dmList = new List <DummyList>();
                dm     = new DummyList();

                dm.date = DateTime.Now.Date.ToString("dd-MM-yyyy");

                dm.TotaldrAmt = toCurr.toCurrenc("D", dr);
                dm.TotalcrAmt = toCurr.toCurrenc("D", dr);

                dmList.Add(dm);

                ReportDataSource datasource1 = new ReportDataSource("DataSet2", dmList);
                this.reportViewer1.LocalReport.DataSources.Add(datasource1);
            }
            catch (Exception x)
            {
            }
        }
コード例 #6
0
 private void AddList(string name, System.Collections.IList lst, System.Type elementType, bool isArray)
 {
     var dummy = new DummyList(lst, elementType, isArray);
     _currentInfo.AddValue(name, dummy);
 }
コード例 #7
0
        private void AddList(string name, System.Collections.IList lst, System.Type elementType, bool isArray)
        {
            var dummy = new DummyList(lst, elementType, isArray);

            _currentInfo.AddValue(name, dummy, typeof(DummyList));
        }
コード例 #8
0
 public List <OrderDetailDTO> GetListByOrderId(Guid orderId)
 {
     return(DummyList.Where(s => s.OrderId == orderId).ToList());
 }
コード例 #9
0
        private void BalanceSheetData()
        {
            tbl_AccGroup  grp  = new tbl_AccGroup();
            tbl_AccLedger ledg = new tbl_AccLedger();

            acc = new MicroAccountsEntities1();

            var acc_group_id = (from c in acc.tbl_AccGroup
                                where c.groupName == "Incomes"
                                select c.id).FirstOrDefault();


            assets = new Acc_list();

            //Income
            income = new Acc_list();

            income.group        = grp.ToString();
            income.ledger       = ledg.ToString();
            income.only_opening = only_opening;
            // income.start_date = txtStartDate.Text;
            //income.end_date = txtEndDate.Text;
            income.affects_gross = -1;

            income.start(Convert.ToInt32(acc_group_id));

            //Expenses

            acc          = new MicroAccountsEntities1();
            acc_group_id = (from c in acc.tbl_AccGroup
                            where c.groupName == "Expenses"
                            select c.id).FirstOrDefault();

            assets  = new Acc_list();
            expense = new Acc_list();

            expense.group        = grp.ToString();
            expense.ledger       = ledg.ToString();
            expense.only_opening = only_opening;
            // expense.start_date = txtStartDate.Text;
            // expense.end_date = txtEndDate.Text;
            expense.affects_gross = -1;
            expense.start(Convert.ToInt32(acc_group_id));

            if (income.cl_total_dc == "C")
            {
                income_total = income.cl_total;
            }
            else
            {
                income_total = Convert.ToDecimal(income.cl_total);
            }
            if (expense.cl_total_dc == "D")
            {
                expense_total = expense.cl_total;
            }
            else
            {
                expense_total = Convert.ToDecimal(expense.cl_total);
            }

            pandl = income_total - expense_total;

            op_diff = new string[] { };
            op_diff = opening_diff();
            if (Convert.ToDecimal(op_diff[1]) == 0)
            {
                is_diff = false;
            }
            else
            {
                is_diff = true;
            }

            //------------------------------------------------------------------------


            ListViewGroup Assets = new ListViewGroup("Assets", HorizontalAlignment.Left);

            acc          = new MicroAccountsEntities1();
            acc_group_id = (from c in acc.tbl_AccGroup
                            where c.groupName == "Assets"
                            select c.id).FirstOrDefault();

            assets = new Acc_list();

            assets.group        = grp.ToString();
            assets.ledger       = ledg.ToString();
            assets.only_opening = only_opening;
            //assets.start_date = txtStartDate.Text;
            // assets.end_date = txtEndDate.Text;
            assets.affects_gross = -1;
            assets.start(Convert.ToInt32(acc_group_id));

            Account_st_short(assets, -1, "D", this, 1);

            //  dataGridView2.DataSource = dmList;

            labels = new Label[dmList.Count + 1];

            int k = 35;

            // create array elements in a loop
            for (int i = 0; i < dmList.Count; i++)
            {
                Font FNT = new Font("Century Gothic", 10.0f, FontStyle.Bold);

                labels[i] = new Label();

                labels[i].Top  = k * (i + 1);
                labels[i].Left = 546;
                labels[i].Font = FNT;
                labels[i].Size = new Size(200, 19);

                if (dmList[i].ledger == "1")
                {
                    labels[i].Text      = "    " + dmList[i].group.ToString();
                    labels[i].ForeColor = Color.Blue;
                }
                else
                {
                    labels[i].ForeColor = Color.Black;
                    labels[i].Text      = dmList[i].group.ToString();
                }

                assetsLabelTop = k * (i + 1);
            }

            this.Controls.AddRange(labels);

            labels = new Label[dmList.Count + 1];
            k      = 36;
            for (int i = 0; i < dmList.Count; i++)
            {
                Font FNT = new Font("Century Gothic", 10.0f, FontStyle.Bold);

                labels[i] = new Label();

                labels[i].Top  = k * (i + 1);
                labels[i].Left = 800;
                labels[i].Font = FNT;
                labels[i].Size = new Size(200, 19);

                labels[i].ForeColor = Color.Black;
                labels[i].Text      = dmList[i].amt.ToString();
            }

            this.Controls.AddRange(labels);


            dmList = new List <DummyList>();

            ListViewGroup LiabilitiesandOwnersEquity = new ListViewGroup("Liabilities and Owners Equity", HorizontalAlignment.Left);

            acc          = new MicroAccountsEntities1();
            acc_group_id = (from c in acc.tbl_AccGroup
                            where c.groupName == "Liabilities and Owners Equity"
                            select c.id).FirstOrDefault();

            liabilities = new Acc_list();

            liabilities.group        = grp.ToString();
            liabilities.ledger       = ledg.ToString();
            liabilities.only_opening = only_opening;
            //liabilities.start_date = txtStartDate.Text;
            //liabilities.end_date = txtEndDate.Text;
            liabilities.affects_gross = -1;
            liabilities.start(Convert.ToInt32(acc_group_id));

            Account_st_short(liabilities, -1, "C", this, 2);

            k      = 35;
            labels = new Label[dmList.Count + 1];
            // create array elements in a loop
            for (int i = 0; i < dmList.Count; i++)
            {
                Font FNT = new Font("Century Gothic", 10.0f, FontStyle.Bold);

                labels[i] = new Label();

                labels[i].Top  = k * (i + 1);
                labels[i].Left = 43;
                labels[i].Font = FNT;

                if (dmList[i].ledger == "1")
                {
                    labels[i].Text      = "    " + dmList[i].group.ToString();
                    labels[i].ForeColor = Color.Blue;
                    labels[i].Size      = new Size(200, 19);
                }
                else
                {
                    labels[i].ForeColor = Color.Black;
                    labels[i].Text      = dmList[i].group.ToString();
                    labels[i].Size      = new Size(200, 19);
                }

                libLabelTop = k * (i + 1);
            }
            this.Controls.AddRange(labels);

            k      = 36;
            labels = new Label[dmList.Count + 1];
            for (int i = 0; i < dmList.Count; i++)
            {
                FNT = new Font("Century Gothic", 10.0f, FontStyle.Bold);

                labels[i] = new Label();

                labels[i].Top  = k * (i + 1);
                labels[i].Left = 293;
                labels[i].Font = FNT;
                labels[i].Size = new Size(200, 19);

                labels[i].ForeColor = Color.Black;
                labels[i].Text      = dmList[i].amt.ToString();
            }
            this.Controls.AddRange(labels);

            if (liabilities.cl_total_dc == "C")
            {
                liabilities_total = liabilities.cl_total;
            }
            else
            {
                liabilities_total = Convert.ToDecimal(liabilities.cl_total * -1);
            }

            if (assets.cl_total_dc == "D")
            {
                assets_total = assets.cl_total;
            }
            else
            {
                assets_total = Convert.ToDecimal(assets.cl_total * -1);
            }

            /**** Final balancesheet total ****/

            final_liabilities_total = liabilities_total;
            final_assets_total      = assets_total;

            /* If net profit add to liabilities, if net loss add to assets */

            if (pandl >= 0)
            {
                final_liabilities_total = final_liabilities_total + pandl;
            }
            else
            {
                positive_pandl     = pandl * -1;
                final_assets_total = final_assets_total + positive_pandl;
            }

            /**
             * If difference in opening balance is Dr then subtract from
             * assets else subtract from liabilities
             */

            if (is_diff)
            {
                if (op_diff[0] == "D")
                {
                    final_assets_total = Convert.ToDecimal(final_assets_total + Convert.ToDecimal(op_diff[1]));
                }

                else
                {
                    final_liabilities_total = Convert.ToDecimal(final_liabilities_total + Convert.ToDecimal(op_diff[1]));
                }
            }


            panel4.Visible = true;
            panel4.Top     = assetsLabelTop + 35;


            /* Difference in opening balance */

            /* Total */

            dmList = new List <DummyList>();

            DummyList dm = new DummyList();

            if (assets_total >= 0)
            {
                Label lb = new Label();
                this.Controls.Add(lb);
                lb.Text = "Total Assets";
                lb.Top  = assetsLabelTop + 50;
                lb.Left = 549;
                lb.Font = FNT;
                lb.Size = new Size(200, 19);

                lb = new Label();
                this.Controls.Add(lb);
                lb.Text = toCurr.toCurrenc("D", assets_total);
                lb.Top  = assetsLabelTop + 50;
                lb.Left = 800;
                lb.Font = FNT;
                lb.Size = new Size(200, 19);
            }
            else
            {
                lb = new Label();
                this.Controls.Add(lb);
                lb.Text      = "Total Assets";
                lb.Top       = assetsLabelTop + 50;
                lb.Left      = 549;
                lb.Font      = FNT;
                lb.Size      = new Size(200, 19);
                lb.ForeColor = Color.Red;

                lb = new Label();
                this.Controls.Add(lb);
                lb.Text = "(Expecting positive Dr Balance)";
                lb.Top  = assetsLabelTop + 65;
                lb.Left = 549;
                Font FNTs = new Font("Century Gothic", 8.0f, FontStyle.Bold);
                lb.Font      = FNTs;
                lb.Size      = new Size(250, 19);
                lb.ForeColor = Color.Red;

                lb = new Label();
                this.Controls.Add(lb);
                lb.Text      = toCurr.toCurrenc("D", assets_total);
                lb.Top       = assetsLabelTop + 50;
                lb.Left      = 800;
                lb.Font      = FNT;
                lb.ForeColor = Color.Red;

                lb.Size = new Size(200, 19);
            }
            dmList.Add(dm);
            dm = new DummyList();

            html.Append("<tr style='font-weight:bold'>");

            if (pandl >= 0)
            {
                lb = new Label();
                this.Controls.Add(lb);
                lb.Text = "";
                lb.Top  = assetsLabelTop + 100;
                lb.Left = 549;
                lb.Font = FNT;
                lb.Size = new Size(200, 19);

                lb = new Label();
                this.Controls.Add(lb);
                lb.Text = "";
                lb.Top  = assetsLabelTop + 100;
                lb.Left = 800;
                lb.Font = FNT;
                lb.Size = new Size(200, 19);
            }
            else
            {
                lb = new Label();
                this.Controls.Add(lb);
                lb.Text = "Profit & Loss Account (Net Loss)";
                lb.Top  = assetsLabelTop + 100;
                lb.Left = 549;
                lb.Font = FNT;
                lb.Size = new Size(250, 19);

                positive_pandl = pandl * -1;

                lb = new Label();
                this.Controls.Add(lb);
                lb.Text = toCurr.toCurrenc("D", positive_pandl);
                lb.Top  = assetsLabelTop + 100;
                lb.Left = 800;
                lb.Font = FNT;
                lb.Size = new Size(200, 19);
            }



            if (is_diff)
            {
                /* If diff in opening balance is Dr */
                if (op_diff[0] == "D")
                {
                    lb = new Label();
                    this.Controls.Add(lb);
                    lb.Text = "Diff in O/P Balance";
                    lb.Top  = assetsLabelTop + 130;
                    lb.Left = 549;
                    lb.Font = FNT;
                    lb.Size = new Size(200, 19);

                    positive_pandl = pandl * -1;

                    lb = new Label();
                    this.Controls.Add(lb);
                    lb.Text = toCurr.toCurrenc("D", Convert.ToDecimal(op_diff[1]));
                    lb.Top  = assetsLabelTop + 130;
                    lb.Left = 800;
                    lb.Font = FNT;
                    lb.Size = new Size(200, 19);
                }
                else
                {
                    lb = new Label();
                    this.Controls.Add(lb);
                    lb.Text = "";
                    lb.Top  = assetsLabelTop + 130;
                    lb.Left = 549;
                    lb.Font = FNT;
                    lb.Size = new Size(200, 19);

                    positive_pandl = pandl * -1;

                    lb = new Label();
                    this.Controls.Add(lb);
                    lb.Text = "";
                    lb.Top  = assetsLabelTop + 130;
                    lb.Left = 800;
                    lb.Font = FNT;
                    lb.Size = new Size(200, 19);
                }
            }

            if (final_liabilities_total == final_assets_total)
            {
                lb = new Label();
                this.Controls.Add(lb);
                lb.Text = "Total";
                lb.Top  = assetsLabelTop + 150;
                lb.Left = 549;
                lb.Font = FNT;
                lb.Size = new Size(200, 19);

                positive_pandl = pandl * -1;

                lb = new Label();
                this.Controls.Add(lb);
                lb.Text = toCurr.toCurrenc("D", Convert.ToDecimal(final_assets_total));
                lb.Top  = assetsLabelTop + 150;
                lb.Left = 800;
                lb.Font = FNT;
                lb.Size = new Size(200, 19);
            }
            else
            {
                lb = new Label();
                this.Controls.Add(lb);
                lb.Text        = "Total";
                lb.Top         = assetsLabelTop + 150;
                lb.Left        = 549;
                lb.Font        = FNT;
                lb.ForeColor   = Color.Red;
                positive_pandl = pandl * -1;
                lb.Size        = new Size(200, 19);

                lb = new Label();
                this.Controls.Add(lb);
                lb.Text      = toCurr.toCurrenc("D", Convert.ToDecimal(final_assets_total));
                lb.Top       = assetsLabelTop + 150;
                lb.Left      = 800;
                lb.Font      = FNT;
                lb.ForeColor = Color.Red;
                lb.Size      = new Size(200, 19);
            }


            //Liablities bottom total

            panel6.Visible = true;
            panel6.Top     = libLabelTop + 35;

            if (liabilities_total >= 0)
            {
                lb = new Label();
                this.Controls.Add(lb);
                lb.Text = "Total Liability and Owners Equity";
                lb.Size = new Size(200, 19);
                lb.Top  = libLabelTop + 50;
                lb.Left = 42;
                lb.Font = FNT;

                lb = new Label();
                this.Controls.Add(lb);
                lb.Text = (toCurr.toCurrenc("C", liabilities_total));
                lb.Top  = libLabelTop + 55;
                lb.Left = 293;
                lb.Font = FNT;
                lb.Size = new Size(200, 19);
            }
            else
            {
                lb = new Label();
                this.Controls.Add(lb);
                lb.Text      = "Total Liability and Owners Equity";
                lb.Top       = libLabelTop + 50;
                lb.Left      = 42;
                lb.Font      = FNT;
                lb.Size      = new Size(200, 19);
                lb.ForeColor = Color.Red;

                lb = new Label();
                this.Controls.Add(lb);
                lb.Text      = (toCurr.toCurrenc("C", liabilities_total));
                lb.Top       = libLabelTop + 55;
                lb.Left      = 293;
                lb.Font      = FNT;
                lb.Size      = new Size(200, 19);
                lb.ForeColor = Color.Red;

                lb = new Label();
                this.Controls.Add(lb);
                lb.Text = "(Expecting positive Cr Balance)";
                lb.Top  = libLabelTop + 70;
                lb.Left = 42;
                Font FNTss = new Font("Century Gothic", 8.0f, FontStyle.Bold);
                lb.Font      = FNTss;
                lb.Size      = new Size(250, 19);
                lb.ForeColor = Color.Red;
            }

            if (pandl >= 0)
            {
                lb = new Label();
                this.Controls.Add(lb);
                lb.Text = "Profit & Loss Account (Net Loss)";
                lb.Top  = libLabelTop + 100;
                lb.Left = 42;
                lb.Font = FNT;
                lb.Size = new Size(250, 19);

                positive_pandl = pandl * -1;

                lb = new Label();
                this.Controls.Add(lb);
                lb.Text = toCurr.toCurrenc("C", pandl);
                lb.Top  = libLabelTop + 100;
                lb.Left = 293;
                lb.Font = FNT;
                lb.Size = new Size(250, 19);
            }
            else
            {
                lb = new Label();
                this.Controls.Add(lb);
                lb.Text = " ";
                lb.Top  = libLabelTop + 100;
                lb.Left = 42;
                lb.Font = FNT;
                lb.Size = new Size(250, 19);

                lb = new Label();
                this.Controls.Add(lb);
                lb.Text = "  ";
                lb.Top  = libLabelTop + 100;
                lb.Left = 293;
                lb.Font = FNT;
                lb.Size = new Size(250, 19);
            }

            if (is_diff)
            {
                html.Append("<tr style='font-weight:bold;color:red'>");
                /* If diff in opening balance is Cr */
                if (op_diff[0] == "C")
                {
                    lb = new Label();
                    this.Controls.Add(lb);
                    lb.Text      = "Diff in O/P Balance";
                    lb.Top       = libLabelTop + 130;
                    lb.Left      = 42;
                    lb.Font      = FNT;
                    lb.Size      = new Size(250, 19);
                    lb.ForeColor = Color.Red;

                    lb = new Label();
                    this.Controls.Add(lb);
                    lb.Text      = toCurr.toCurrenc("C", Convert.ToDecimal(op_diff[1]));
                    lb.Top       = libLabelTop + 130;
                    lb.Left      = 293;
                    lb.Font      = FNT;
                    lb.Size      = new Size(250, 19);
                    lb.ForeColor = Color.Red;
                }
                else
                {
                    lb = new Label();
                    this.Controls.Add(lb);
                    lb.Text = " ";
                    lb.Top  = libLabelTop + 130;
                    lb.Left = 42;
                    lb.Font = FNT;
                    lb.Size = new Size(250, 19);

                    lb = new Label();
                    this.Controls.Add(lb);
                    lb.Text = "  ";
                    lb.Top  = libLabelTop + 130;
                    lb.Left = 293;
                    lb.Font = FNT;
                    lb.Size = new Size(250, 19);
                }
            }



            if (final_liabilities_total == final_assets_total)
            {
                lb = new Label();
                this.Controls.Add(lb);
                lb.Text = "Total";
                lb.Top  = libLabelTop + 150;
                lb.Left = 42;
                lb.Font = FNT;
                lb.Size = new Size(200, 19);

                positive_pandl = pandl * -1;

                lb = new Label();
                this.Controls.Add(lb);
                lb.Text = toCurr.toCurrenc("c", Convert.ToDecimal(final_assets_total));
                lb.Top  = libLabelTop + 150;
                lb.Left = 293;
                lb.Font = FNT;
                lb.Size = new Size(200, 19);
            }
            else
            {
                lb = new Label();
                this.Controls.Add(lb);
                lb.Text        = "Total";
                lb.Top         = libLabelTop + 150;
                lb.Left        = 42;
                lb.Font        = FNT;
                lb.ForeColor   = Color.Red;
                positive_pandl = pandl * -1;
                lb.Size        = new Size(200, 19);

                lb = new Label();
                this.Controls.Add(lb);
                lb.Text      = toCurr.toCurrenc("c", Convert.ToDecimal(final_assets_total));
                lb.Top       = libLabelTop + 150;
                lb.Left      = 293;
                lb.Font      = FNT;
                lb.ForeColor = Color.Red;
                lb.Size      = new Size(200, 19);
            }
        }
コード例 #10
0
        public void Account_st_short(Acc_list account, int c = 0, string dc_type = "", object ths = null, int lisstType = 0)
        {
            int count = c;

            acc_list = new Acc_list();
            ListViewGroup grp;

            DummyList dm = new DummyList();

            if (account != null)
            {
                if (account.id > 4)
                {
                    // grp = new ListViewGroup(account.name, HorizontalAlignment.Left);

                    //if(lisstType==1)
                    // {
                    //     listBox1.Items.Add(account.name);
                    // }
                    //else if(lisstType==2)
                    // {
                    //     listBox2.Items.Add(account.name);
                    // }

                    //Font FNT = new Font("Century Gothic", 11.0f, FontStyle.Bold);
                    //this.Font = FNT;
                    //this.ForeColor = Color.Black;

                    dm       = new DummyList();
                    dm.group = account.name;
                    // dm.amt = toCurr.toCurrenc(account.cl_total_dc, Convert.ToDecimal(account.cl_total)) ;
                    dm.amt = "";
                    dmList.Add(dm);
                }
                foreach (Acc_list acc in account.children_groups)
                {
                    count++;
                    Account_st_short(acc, count, dc_type, this, lisstType);
                    count--;
                }

                if (account.children_ledgers.Count() > 0)
                {
                    count++;

                    List <int> list = new List <int>(account.children_ledgers.Keys);
                    // Loop through list
                    foreach (int k in list)
                    {
                        // listView1.Items.Add(new ListViewItem(account.children_ledgers[k].name, account.name));
                        //listBox1.Items.Add(account.children_ledgers[k].name + " --  " + toCurr.toCurrenc(account.children_ledgers[k].cl_total_dc, account.children_ledgers[k].cl_total));
                        ////html.Append(toCurr.toCurrenc(account.children_ledgers[k].cl_total_dc, account.children_ledgers[k].cl_total));
                        ////  listView1.Groups.Add(grp);

                        //if (lisstType == 1)
                        //{
                        //    listBox1.Items.Add(account.children_ledgers[k].name + " --  " + toCurr.toCurrenc(account.children_ledgers[k].cl_total_dc, account.children_ledgers[k].cl_total));

                        //}
                        //else if (lisstType == 2)
                        //{
                        //    listBox2.Items.Add(account.children_ledgers[k].name + " --  " + toCurr.toCurrenc(account.children_ledgers[k].cl_total_dc, account.children_ledgers[k].cl_total));

                        //}

                        //Font FNTs = new Font("Century Gothic",11.0f);
                        //this.Font = FNTs;
                        //this.ForeColor = Color.Blue;

                        dm        = new DummyList();
                        dm.group  = "(" + account.children_ledgers[k].name + ")";
                        dm.amt    = toCurr.toCurrenc(account.children_ledgers[k].cl_total_dc, account.children_ledgers[k].cl_total);
                        dm.ledger = "1";
                        dmList.Add(dm);
                    }
                    count--;
                }
            }
        }
コード例 #11
0
        public void print_account_chart(Acc_list account, int c = 0, object ths = null)
        {
            MicroAccountsEntities1 accs = new MicroAccountsEntities1();

            int count = c;

            acc_list = new Acc_list();
            DummyList dm = new DummyList();

            //StringBuilder html = new StringBuilder();
            if (account != null)
            {
                if (account.id != 0)
                {
                    //if (account.g_parent_id == 0)
                    //{
                    //    //    html.Append("<tr class='table table-bordered table-striped'>");
                    //    html.Append("<tr style='color:brown;background-color:#F3F3F3'>");
                    //}
                    //else
                    //{
                    //    // html.Append("<tr class='tr-group'>");
                    //    html.Append("<tr>");
                    //}

                    ////html.Append("<td class='td-group'>");
                    //html.Append("<td>");
                    //html.Append(print_space(count));


                    //html.Append("<b >" + account.name + "</b>");


                    //html.Append("</td>");

                    //html.Append("<td><b>Group<b></td>");

                    //html.Append("<td><b>"); html.Append(toCurr.toCurrenc(account.op_total_dc, account.op_total)); html.Append("</b></td>");
                    //html.Append("<td><b>"); html.Append(toCurr.toCurrenc("D", account.dr_total)); html.Append("</b></td>");
                    //html.Append("<td><b>"); html.Append(toCurr.toCurrenc("C", account.cr_total)); html.Append("</b></td>");

                    //if (account.cl_total_dc == "D")
                    //{
                    //    html.Append("<td><b>"); html.Append(toCurr.toCurrenc("D", account.cl_total)); html.Append("</b></td>");

                    //}
                    //else
                    //{
                    //    html.Append("<td><b>"); html.Append(toCurr.toCurrenc("C", account.cl_total)); html.Append("</b></td>");

                    //}

                    //html.Append("</tr>");
                }
                if (account.children_ledgers.Count() > 0)
                {
                    count++;

                    // Store keys in a List
                    List <int> list = new List <int>(account.children_ledgers.Keys);
                    // Loop through list
                    foreach (int k in list)
                    {
                        //html.Append(account.children_ledgers[k].name);



                        Label lb = new Label();
                        this.Controls.Add(lb);
                        lb.Text = account.children_ledgers[k].name;
                        //lb.Top = assetsLabelTop + 50;
                        lb.Top  = top;
                        lb.Left = 42;
                        lb.Font = FNT;
                        lb.Size = new Size(200, 19);

                        lb = new Label();
                        this.Controls.Add(lb);
                        lb.Text = toCurr.toCurrenc(account.children_ledgers[k].op_total_dc, account.children_ledgers[k].op_total);
                        //lb.Top = assetsLabelTop + 50;
                        lb.Top  = top;
                        lb.Left = 292;
                        lb.Font = FNT;
                        lb.Size = new Size(150, 19);

                        lb = new Label();
                        this.Controls.Add(lb);
                        lb.Text = toCurr.toCurrenc("D", account.children_ledgers[k].dr_total);
                        //lb.Top = assetsLabelTop + 50;
                        lb.Top  = top;
                        lb.Left = 483;
                        lb.Font = FNT;
                        lb.Size = new Size(150, 19);


                        lb = new Label();
                        this.Controls.Add(lb);
                        lb.Text = toCurr.toCurrenc("C", account.children_ledgers[k].dr_total);
                        //lb.Top = assetsLabelTop + 50;
                        lb.Top  = top;
                        lb.Left = 651;
                        lb.Font = FNT;
                        lb.Size = new Size(150, 19);


                        //html.Append("<a href=''>" + account.children_ledgers[k].name + " </a>  ");
                        //html.Append("</td>");

                        //html.Append("<td>Ledger</td>");

                        //html.Append("<td>");
                        //html.Append(toCurr.toCurrenc(account.children_ledgers[k].op_total_dc, account.children_ledgers[k].op_total));
                        //html.Append("</td>");

                        //html.Append("<td>");
                        //html.Append(toCurr.toCurrenc("D", account.children_ledgers[k].dr_total));
                        //html.Append("</td>");

                        //html.Append("<td>");
                        //html.Append(toCurr.toCurrenc("C", account.children_ledgers[k].cr_total));
                        //html.Append("</td>");

                        if (account.children_ledgers[k].cl_total_dc == "D")
                        {
                            lb = new Label();
                            this.Controls.Add(lb);
                            lb.Text = toCurr.toCurrenc("D", account.children_ledgers[k].dr_total);
                            //lb.Top = assetsLabelTop + 50;
                            lb.Top  = top;
                            lb.Left = 806;
                            lb.Font = FNT;
                            lb.Size = new Size(150, 19);
                        }
                        else
                        {
                            lb = new Label();
                            this.Controls.Add(lb);
                            lb.Text = toCurr.toCurrenc("C", account.children_ledgers[k].dr_total);
                            //lb.Top = assetsLabelTop + 50;
                            lb.Top  = top;
                            lb.Left = 806;
                            lb.Font = FNT;
                            lb.Size = new Size(150, 19);
                        }

                        //html.Append("</tr>");
                        top = top + 25;
                    }

                    count--;
                }

                foreach (Acc_list acc in account.children_groups)
                {
                    count++;

                    print_account_chart(acc, count, this);
                    count--;
                }

                //PlaceHolder3.Controls.Add(new Literal { Text = html.ToString() });
            }
        }
コード例 #12
0
 public List <OrderDTO> GetListByUserId(Guid userId)
 {
     return(DummyList.Where(s => s.UserId == userId).ToList());
 }