Ejemplo n.º 1
0
        private void MakeSelectedAccountDetails()
        {
            dgvAccount.Rows.Clear();
            foreach (DataGridViewRow item in dtpGRNDetals.Rows)
            {
                if (Convert.ToBoolean(item.Cells["Select"].Value))
                {
                    int     i      = -1;
                    string  AcName = MyAccount.GetAccountName(item.Cells["AccNo"].Value.ToString());
                    string  Memo1  = "Purchase of " + AcName + " - " + cmbGRN.Text;
                    decimal Exrate = 0;
                    bool    rmd    = decimal.TryParse(lblExchangerate.Text, out Exrate);
                    i = ExistInGrid(item.Cells["AccNo"].Value.ToString());

                    decimal LKR = 0, d2 = 0, USD = 0;
                    bool    resp = decimal.TryParse(item.Cells["Amount"].Value.ToString(), out USD);
                    LKR  = USD * Exrate;
                    resp = decimal.TryParse(txtVat.Text, out d2);

                    if (i == -1)
                    {
                        int      Ref  = dgvAccount.Rows.Count + 1;
                        string[] row1 = { item.Cells["AccNo"].Value.ToString(), AcName, Memo1, LKR.ToString("#0.00"), USD.ToString("##0.00"), d2.ToString("#0.00"), GetNextLinNumber("dgvAccount_LineRef") };
                        dgvAccount.Rows.Add(row1);
                    }
                    else
                    {
                        UpdateAutoAddLine(i, LKR, USD, d2);
                    }
                    CalTotalAmount();
                }
            }
        }
Ejemplo n.º 2
0
        private void AddNewRow()
        {
            string  supid     = MyCommon.GetSelectedID(cmbSupplier, true);
            int     SupID1    = int.Parse(supid);
            string  AccountID = MyInvoice.GetSalesAccount(SupID1);
            string  acname    = MyAccount.GetAccountName(AccountID);
            decimal TotalLKR  = 0;
            bool    resp      = decimal.TryParse(lblGrnToala.Text, out TotalLKR);

            TotalLKR = TotalLKR * decimal.Parse(lblExchangerate.Text);
            string[] row1 = { AccountID, acname, "Salse of " + cmbGRN.Text, TotalLKR.ToString("##0.00"), lblGrnToala.Text, "0", GetNextLinNumber("dgvAccount_LineRef") };
            dgvAccount.Rows.Add(row1);
            CalTotalAmount();
        }
Ejemplo n.º 3
0
        private void cmbPayTo_SelectedIndexChanged(object sender, EventArgs e)
        {
            string PayToID = MyCommon.GetSelectedID(cmbPayTo, true);

            int    CusSupID = 0;
            bool   resp5    = int.TryParse(PayToID, out CusSupID);
            string respond  = "";
            string PayTo    = MyCommon.GetSelectedID(cmbPayFor, true);

            switch (PayTo)
            {
            case "1":
                lblToID.Text         = MyAccount.GetSupplierAccountNumber(CusSupID);
                txtToAccount.Text    = MyAccount.GetAccountName(lblToID.Text);
                txtToAccount.Enabled = false;
                HanchyGrid.Visible   = false;
                lblAcCurrency.Text   = MyAccount.GetCurrrencyType(lblToID.Text);
                cmbCurrency.Text     = lblAcCurrency.Text;
                break;

            case "2":
                lblToID.Text         = MyAccount.GetCustomerAccountNumber(CusSupID);
                txtToAccount.Text    = MyAccount.GetAccountName(lblToID.Text);
                lblAcCurrency.Text   = MyAccount.GetCurrrencyType(lblToID.Text);
                txtToAccount.Enabled = false;
                HanchyGrid.Visible   = false;

                cmbCurrency.Text = lblAcCurrency.Text;
                break;

            default:
                lblToID.Text         = "";
                txtToAccount.Text    = "";
                txtToAccount.Enabled = true;
                break;
            }
        }
Ejemplo n.º 4
0
        private void cmbPayTo_SelectedIndexChanged(object sender, EventArgs e)
        {
            Supplier MySupplier = new Supplier();

            DataType.CustomerDataType _ExCustomer = new DataType.CustomerDataType();
            DataType.SupplierDataType _ExSupplier = new DataType.SupplierDataType();
            Customer MyCustomer = new Customer();
            string   PayTo      = MyCommon.GetSelectedID(cmbPayFor, true);
            string   PayToID    = MyCommon.GetSelectedID(cmbPayTo, true);

            int    CusSupID = 0;
            bool   resp5    = int.TryParse(PayToID, out CusSupID);
            string respond  = "";

            switch (PayTo)
            {
            case "1":
                respond              = MySupplier.GetSupplier(CusSupID, out _ExSupplier, Program.AccountStatic.LoggingAsLocal);
                lblAddress.Text      = _ExSupplier.Address1 + " " + _ExSupplier.Address2 + " " + _ExSupplier.Address3;
                lblToID.Text         = MyAccount.GetSupplierAccountNumber(CusSupID);
                txtToAccount.Text    = MyAccount.GetAccountName(lblToID.Text);
                txtToAccount.Enabled = false;
                HanchyGrid.Visible   = false;
                break;

            case "2":
                lblToID.Text         = MyAccount.GetCustomerAccountNumber(CusSupID);
                respond              = MyCustomer.GetGetExistCustomer(CusSupID, out _ExCustomer, Program.AccountStatic.LoggingAsLocal);
                lblAddress.Text      = _ExCustomer.Address1 + " " + _ExCustomer.Address2 + " " + _ExCustomer.Address3;
                txtToAccount.Text    = MyAccount.GetAccountName(lblToID.Text);
                txtToAccount.Enabled = false;
                HanchyGrid.Visible   = false;
                break;

            case "5":
                lblToID.Text         = "";
                txtToAccount.Text    = "";
                txtToAccount.Enabled = true;
                lblAddress.Text      = MyAccount.GetOtherPayeeAdd(cmbPayTo.Text);
                break;

            default:
                lblToID.Text         = "";
                txtToAccount.Text    = "";
                txtToAccount.Enabled = true;
                break;
            }
        }
Ejemplo n.º 5
0
        private void cmbPayTo_SelectedIndexChanged(object sender, EventArgs e)
        {
            //Added by Manjula
            string SupName = "";

            if (cmbPayTo.SelectedValue != null)
            {
                SupName = cmbPayTo.SelectedValue.ToString();
            }
            LINKPayment objLink = new LINKPayment();

            objLink.SupName = SupName;
            LINKPayment[] objSuppID = objService.GetCreditorFinalSupplier(objLink);

            if (objSuppID.Length > 0)
            {
                SuppID = objSuppID[0].SupplierID.ToString();
            }

            BusinessLayer.Supplier.Supplier MySupplier  = new BusinessLayer.Supplier.Supplier();
            DataType.CustomerDataType       _ExCustomer = new DataType.CustomerDataType();
            DataType.SupplierDataType       _ExSupplier = new DataType.SupplierDataType();
            Customer MyCustomer = new Customer();
            string   PayTo      = MyCommon.GetSelectedID(cmbPayFor, true);
            string   PayToID    = MyCommon.GetSelectedID(cmbPayTo, true);
            int      CusSupID   = 0;
            bool     resp5      = int.TryParse(PayToID, out CusSupID);
            string   respond    = "";

            switch (PayTo)
            {
            case "1":
                // respond = MySupplier.GetSupplier(CusSupID, out _ExSupplier, Program.AccountStatic.LoggingAsLocal);
                lblAddress.Text      = _ExSupplier.Address1 + " " + _ExSupplier.Address2 + " " + _ExSupplier.Address3;
                lblToID.Text         = MyAccount.GetSupplierAccountNumber(CusSupID);
                txtToAccount.Text    = MyAccount.GetAccountName(lblToID.Text);
                txtToAccount.Enabled = false;
                HanchyGrid.Visible   = false;
                break;

            case "2":
                lblToID.Text         = MyAccount.GetCustomerAccountNumber(CusSupID);
                respond              = MyCustomer.GetGetExistCustomer(CusSupID, out _ExCustomer, Program.AccountStatic.LoggingAsLocal);
                lblAddress.Text      = _ExCustomer.Address1 + " " + _ExCustomer.Address2 + " " + _ExCustomer.Address3;
                txtToAccount.Text    = MyAccount.GetAccountName(lblToID.Text);
                txtToAccount.Enabled = false;
                HanchyGrid.Visible   = false;
                break;

            case "5":
                lblToID.Text         = "";
                txtToAccount.Text    = "";
                txtToAccount.Enabled = true;
                lblAddress.Text      = MyAccount.GetOtherPayeeAdd(cmbPayTo.Text);
                break;

            default:
                lblToID.Text         = "";
                txtToAccount.Text    = "";
                txtToAccount.Enabled = true;
                break;
            }
        }