示例#1
0
        private void updateBtn_Click(object sender, EventArgs e)
        {
            if (this.textBox1.Text == "" || this.dateTimePicker1.Text == "")
            {
                MessageBox.Show("please insert Data");
            }

            else
            {
                AccountingR i = new AccountingR();
                i.Date  = this.dateTimePicker1.Value.ToShortDateString();
                i.Money = Convert.ToDouble(this.textBox1.Text);


                AccountingRepository ar = new AccountingRepository();
                if (ar.Update(i))
                {
                    List <AccountingR> allResult = ar.GetAllTransiction();
                    this.dataGrid1.DataSource = allResult;

                    this.textBox1.Text        = "";
                    this.dateTimePicker1.Text = "";
                }
                else
                {
                    MessageBox.Show("Can Not Update Transition", "Update Error");
                }
            }
        }
示例#2
0
        private void deleteBtn_Click(object sender, EventArgs e)
        {
            if (this.textBox1.Text == "" || this.dateTimePicker1.Text == "")
            {
                MessageBox.Show("please insert Data");
            }
            else
            {
                string date = this.dateTimePicker1.Value.ToShortDateString();

                AccountingRepository ar = new AccountingRepository();
                if (ar.Delete(date))
                {
                    List <AccountingR> allResult = ar.GetAllTransiction();
                    this.dataGrid1.DataSource = allResult;

                    this.textBox1.Text        = "";
                    this.dateTimePicker1.Text = "";
                }
                else
                {
                    MessageBox.Show("Can Not Delete transition", "Delete Error");
                }
            }
        }
        protected override Task ManageRepositoryAsync(IUpdateBudgetAccountCommand command)
        {
            NullGuard.NotNull(command, nameof(command));

            IBudgetAccount budgetAccount = command.ToDomain(AccountingRepository);

            return(AccountingRepository.UpdateBudgetAccountAsync(budgetAccount));
        }
        protected override async Task ManageRepositoryAsync(ICreateAccountGroupCommand command)
        {
            NullGuard.NotNull(command, nameof(command));

            IAccountGroup accountGroup = command.ToDomain();

            await AccountingRepository.CreateAccountGroupAsync(accountGroup);
        }
示例#5
0
        protected override async Task ManageRepositoryAsync(ICreatePaymentTermCommand command)
        {
            NullGuard.NotNull(command, nameof(command));

            IPaymentTerm paymentTerm = command.ToDomain();

            await AccountingRepository.CreatePaymentTermAsync(paymentTerm);
        }
示例#6
0
        private void searchBtn_Click(object sender, EventArgs e)
        {
            string text                = this.dateTimePicker2.Value.ToShortDateString();
            AccountingRepository ar    = new AccountingRepository();
            List <AccountingR>   iList = ar.searchTransiction(text);

            this.dataGrid1.DataSource = iList;
        }
示例#7
0
        protected override async Task ManageRepositoryAsync(IUpdateBudgetAccountGroupCommand command)
        {
            NullGuard.NotNull(command, nameof(command));

            IBudgetAccountGroup budgetAccountGroup = command.ToDomain();

            await AccountingRepository.UpdateBudgetAccountGroupAsync(budgetAccountGroup);
        }
示例#8
0
        protected override async Task ManageRepositoryAsync(IUpdateAccountingCommand command)
        {
            NullGuard.NotNull(command, nameof(command));

            IAccounting accounting = command.ToDomain(CommonRepository);

            await AccountingRepository.UpdateAccountingAsync(accounting);
        }
        protected override Task ManageRepositoryAsync(ICreateAccountCommand command)
        {
            NullGuard.NotNull(command, nameof(command));

            IAccount account = command.ToDomain(AccountingRepository);

            return(AccountingRepository.CreateAccountAsync(account));
        }
示例#10
0
        public void showChart()
        {
            AccountingRepository ar             = new AccountingRepository();
            List <AccountingR>   allTransiction = ar.GetAllTransiction();

            foreach (AccountingR a in allTransiction)
            {
                this.chart1.Series["Money"].Points.AddXY(a.Date, a.Money);
            }
        }
示例#11
0
        private void DashBoard_Click(object sender, EventArgs e)
        {
            this.groupBox1.Visible = false;
            this.groupBox2.Visible = true;

            this.dataGrid.Visible  = false;
            this.dataGrid1.Visible = false;

            AccountingRepository ar = new AccountingRepository();

            this.totalCashLabel.Text = "totalCash : " + Convert.ToString(ar.countTotalCash());
        }
示例#12
0
        protected override async Task <IAccounting> GetDataAsync(IGetAccountingQuery query)
        {
            NullGuard.NotNull(query, nameof(query));

            IAccounting accounting = await AccountingRepository.GetAccountingAsync(query.AccountingNumber, query.StatusDate);

            if (accounting == null)
            {
                return(null);
            }

            _accountingHelper.ApplyLogicForPrincipal(accounting);

            return(accounting);
        }
示例#13
0
        public Accounting()
        {
            InitializeComponent();

            this.groupBox1.Visible = false;
            this.groupBox2.Visible = true;

            this.dataGrid.Visible  = false;
            this.dataGrid1.Visible = false;

            AccountingRepository ar = new AccountingRepository();

            this.totalCashLabel.Text = "totalCash : " + Convert.ToString(ar.countTotalCash());

            showChart();
        }
示例#14
0
        private void cashInTab_Click(object sender, EventArgs e)
        {
            this.dataGrid.Visible  = false;
            this.dataGrid1.Visible = true;

            this.groupBox1.Visible = true;
            this.groupBox2.Visible = false;

            this.chart1.Visible = false;


            AccountingRepository result    = new AccountingRepository();
            List <AccountingR>   allResult = result.GetAllTransiction();

            this.dataGrid1.DataSource = allResult;
        }
示例#15
0
        public void showChart()
        {
            AccountingRepository ar             = new AccountingRepository();
            List <AccountingR>   allTransiction = ar.GetAllTransiction();

            foreach (var series in chart1.Series)
            {
                series.Points.Clear();
            }

            foreach (AccountingR a in allTransiction)
            {
                //this.chart1.Series.Add("taka");

                this.chart1.Series["Money"].Points.AddXY(a.Date, a.Money);
            }
        }
示例#16
0
        public QuickBooksSynchService(string companyName)
        {
            // Make sure the name of QODBC company is same as passed in
            using (var con = new OdbcConnection(qodbcConnectionString))
                using (var cmd = new OdbcCommand("select top 1 CompanyName from Company", con))
                {
                    con.Open();
                    string currentCompany = (string)cmd.ExecuteScalar();
                    if (companyName != currentCompany)
                    {
                        throw new Exception("Wrong company - expecting " + companyName + ", got " + currentCompany);
                    }
                }

            // Get the company ID using the name passed in (row with matching name must exist)
            using (var repo = new AccountingRepository(new AccountingContext(), true))
            {
                this.companyID = repo.CompanyFileByName(companyName).CompanyId;
            }
        }
示例#17
0
        protected override async Task <IContactAccountCollection> GetDataAsync(IGetDebtorAccountCollectionQuery query)
        {
            NullGuard.NotNull(query, nameof(query));

            IContactAccountCollection contactAccountCollection = await AccountingRepository.GetContactAccountsAsync(query.AccountingNumber, query.StatusDate);

            if (contactAccountCollection == null)
            {
                return(null);
            }

            IContactAccountCollection calculatedAccountCollection = await contactAccountCollection.CalculateAsync(query.StatusDate);

            if (calculatedAccountCollection == null)
            {
                return(null);
            }

            return(await calculatedAccountCollection.FindDebtorsAsync());
        }
示例#18
0
        protected override Task <IPostingLineCollection> GetDataAsync(IGetPostingLineCollectionQuery query)
        {
            NullGuard.NotNull(query, nameof(query));

            return(AccountingRepository.GetPostingLinesAsync(query.AccountingNumber, query.StatusDate, query.NumberOfPostingLines));
        }
        protected override Task <IContactAccount> GetDataAsync(IGetContactAccountQuery query)
        {
            NullGuard.NotNull(query, nameof(query));

            return(AccountingRepository.GetContactAccountAsync(query.AccountingNumber, query.AccountNumber, query.StatusDate));
        }
        public AdminDashboard()
        {
            InitializeComponent();

            //marketing Info
            MarketingRepository mr = new MarketingRepository();

            //  this.totalCampaigns.Text = "Total Campaigns : " + Convert.ToString(mr.countAllCampaigns());

            // this.appCampaign.Text = "Approved Campaigns : " + Convert.ToString(mr.countAllApprovedCampaigns("Approved"));



            //Hr Info


            EmployeeRepository m = new EmployeeRepository();


            /*
             * EmployeeRepository m = new EmployeeRepository();
             * this.label123.Text += Convert.ToString(m.countAllEmployee());
             * this.label129.Text += Convert.ToString(m.countEmployee("Admin"));
             * this.label125.Text += Convert.ToString(m.countEmployee("Sales"));
             * this.label127.Text += Convert.ToString(m.countEmployee("Marketing"));
             * this.label124.Text += Convert.ToString(m.countEmployee("Human Resource"));
             * this.label126.Text += Convert.ToString(m.countEmployee("Accounting"));
             * this.label128.Text += Convert.ToString(m.countEmployee("Finance"));
             *
             * this.label120.Text += Convert.ToString(m.countAllStatus("Full Time"));
             * this.label119.Text += Convert.ToString(m.countAllStatus("Probationary"));
             * this.label118.Text += Convert.ToString(m.countAllStatus("Intern"));
             *
             *
             * this.label120.Text += Convert.ToString(m.countAllStatus("Full Time"));
             * this.label119.Text += Convert.ToString(m.countAllStatus("Probationary"));
             * this.label118.Text += Convert.ToString(m.countAllStatus("Intern"));*/

            this.hrGraph2.Visible = false;

            this.hrGraph.Series["emp"].Points.AddXY("Admin", m.countEmployee("Admin"));
            this.hrGraph.Series["emp"].Points.AddXY("Sales", m.countEmployee("Sales"));
            this.hrGraph.Series["emp"].Points.AddXY("HR", m.countEmployee("Human Resource"));
            this.hrGraph.Series["emp"].Points.AddXY("IT", m.countEmployee("IT"));
            this.hrGraph.Series["emp"].Points.AddXY("Accounts", m.countEmployee("Accounting"));
            this.hrGraph.Series["emp"].Points.AddXY("Finance", m.countEmployee("Finance"));
            this.hrGraph.Series["emp"].Points.AddXY("Marketing", m.countEmployee("Marketing"));

            this.hrGraph2.Series["Status"].Points.AddXY("Full Time", m.countAllStatus("Full Time"));
            this.hrGraph2.Series["Status"].Points.AddXY("Probationary", m.countAllStatus("Probationary"));
            this.hrGraph2.Series["Status"].Points.AddXY("Intern", m.countAllStatus("Intern"));

            //sales Info



            //get all the data
            // count the total order in groupBox3

            OrderRepository or = new OrderRepository();

            /*  this.label117.Text = "Total Order : " + Convert.ToString(or.countAllOrder());
             * this.label114.Text = "Bike : " + Convert.ToString(or.countOrder("Bike"));
             * this.label108.Text = "Car : " + Convert.ToString(or.countOrder("Car"));
             * this.label111.Text = "Cng : " + Convert.ToString(or.countOrder("Cng"));
             * this.label112.Text = "Microbus : " + Convert.ToString(or.countOrder("Microbus"));
             * this.label92.Text = "Pickup : " + Convert.ToString(or.countOrder("Pickup"));
             * this.label90.Text = "Truck : " + Convert.ToString(or.countOrder("Truck")); */


            /* this.orderGraph.Series["Order"].Points.AddXY("Bike:" + Convert.ToString(or.countOrder("Bike")), or.countOrder("Bike"));
             * this.orderGraph.Series["Order"].Points.AddXY("Car:" + Convert.ToString(or.countOrder("Car")), or.countOrder("Car") );
             * this.orderGraph.Series["Order"].Points.AddXY("Cng:" + Convert.ToString(or.countOrder("Cng")), or.countOrder("Cng"));
             * this.orderGraph.Series["Order"].Points.AddXY("Microbus:" + Convert.ToString(or.countOrder("Microbus")), or.countOrder("Microbus"));
             * this.orderGraph.Series["Order"].Points.AddXY("Pickup:" + Convert.ToString(or.countOrder("Pickup")), or.countOrder("Pickup"));
             * this.orderGraph.Series["Order"].Points.AddXY("Truck:"+ Convert.ToString(or.countOrder("Truck")), or.countOrder("Truck"));*/


            this.orderGraph.Series["Order"].Points.AddXY("Bike", or.countOrder("Bike"));
            this.orderGraph.Series["Order"].Points.AddXY("Car", or.countOrder("Car"));
            this.orderGraph.Series["Order"].Points.AddXY("Cng", or.countOrder("Cng"));
            this.orderGraph.Series["Order"].Points.AddXY("Microbus", or.countOrder("Microbus"));
            this.orderGraph.Series["Order"].Points.AddXY("Pickup", or.countOrder("Pickup"));
            this.orderGraph.Series["Order"].Points.AddXY("Truck", or.countOrder("Truck"));



            //count the total Inventory in groupBox4

            InventoryRepository ir = new InventoryRepository();

            /* this.label73.Text = "Total Inventory : " + Convert.ToString(ir.countAllInventory());
             * this.label138.Text = "Bike :" + Convert.ToString(ir.countInventory("Bike"));
             * this.label135.Text = "Car :" + Convert.ToString(ir.countInventory("Car"));
             * this.label136.Text = "Cng :" + Convert.ToString(ir.countInventory("Cng"));
             * this.label137.Text = "Microbus :" + Convert.ToString(ir.countInventory("Microbus"));
             * this.label134.Text = "Pickup :" + Convert.ToString(ir.countInventory("Pickup"));
             * this.label133.Text = "Truck :" + Convert.ToString(ir.countInventory("Truck")); */

            this.inventoryGraph.Series["Inventory"].Points.AddXY("Bike", ir.countInventory("Bike"));
            this.inventoryGraph.Series["Inventory"].Points.AddXY("Car", ir.countInventory("Car"));
            this.inventoryGraph.Series["Inventory"].Points.AddXY("Cng", ir.countInventory("Cng"));
            this.inventoryGraph.Series["Inventory"].Points.AddXY("Microbus", ir.countInventory("Microbus"));
            this.inventoryGraph.Series["Inventory"].Points.AddXY("Pickup", ir.countInventory("Pickup"));
            this.inventoryGraph.Series["Inventory"].Points.AddXY("Truck", ir.countInventory("Truck"));


            //count all shipment

            ShipmentRepository sr = new ShipmentRepository();

            /*  this.label52.Text = "Total Shipment : " + Convert.ToString(sr.countAllShipment());
             * this.label72.Text = "At Origin : " + Convert.ToString(sr.countShipment("At Origin"));
             * this.label66.Text = "On the Way : " + Convert.ToString(sr.countShipment("On the Way"));
             * this.label70.Text = "Stucked : " + Convert.ToString(sr.countShipment("Stuked"));
             * this.label71.Text = "At Destination : " + Convert.ToString(sr.countShipment("At Destination"));
             * this.label68.Text = "Shipped : " + Convert.ToString(sr.countShipment("Shipped")); */

            this.shipmentGraph.Series["Shipment"].Points.AddXY("At Origin", sr.countShipment("At Origin"));
            this.shipmentGraph.Series["Shipment"].Points.AddXY("On the Way", sr.countShipment("On the Way"));
            this.shipmentGraph.Series["Shipment"].Points.AddXY("Stucked", sr.countShipment("Stuked"));
            this.shipmentGraph.Series["Shipment"].Points.AddXY("At Destination", sr.countShipment("At Destination"));
            this.shipmentGraph.Series["Shipment"].Points.AddXY("Shipped", sr.countShipment("Shipped"));

            //accounting

            AccountingRepository ar = new AccountingRepository();
            //  this.totalCashLabel.Text = "totalCash : " + Convert.ToString(ar.countTotalCash());
        }
 public AccountingController(AccountingRepository repo)
 {
     _repo = repo;
 }
示例#22
0
        protected override async Task ManageRepositoryAsync(IDeletePaymentTermCommand command)
        {
            NullGuard.NotNull(command, nameof(command));

            await AccountingRepository.DeletePaymentTermAsync(command.Number);
        }
示例#23
0
        protected override async Task ManageRepositoryAsync(IDeleteBudgetAccountGroupCommand command)
        {
            NullGuard.NotNull(command, nameof(command));

            await AccountingRepository.DeleteBudgetAccountGroupAsync(command.Number);
        }
示例#24
0
        protected override Task <IAccountCollection> GetDataAsync(IGetAccountCollectionQuery query)
        {
            NullGuard.NotNull(query, nameof(query));

            return(AccountingRepository.GetAccountsAsync(query.AccountingNumber, query.StatusDate));
        }
        protected override Task ManageRepositoryAsync(IDeleteBudgetAccountCommand command)
        {
            NullGuard.NotNull(command, nameof(command));

            return(AccountingRepository.DeleteBudgetAccountAsync(command.AccountingNumber, command.AccountNumber));
        }