Exemplo n.º 1
0
        //private string GetDistName(string id)
        //{
        //    string query = "Select BankName from Bank where ID='" + id + "'";
        //    object obj = SQLHelper.GetInstance().ExcuteScalar(query, out msg);
        //    if (obj != null)
        //    {
        //        return obj.ToString();
        //    }

        //    return null ;
        //}
        private void AddNewEmployee_Click(object sender, EventArgs e)
        {
            LedgerDetails frmLedgerDetails = new LedgerDetails(LedgerDetails._LedgerCategory.Employee, LedgerDetails._Type.show);

            frmLedgerDetails.OnClose += FrmLedgerDetails_OnClose;
            frmLedgerDetails.ShowDialog();
        }
Exemplo n.º 2
0
        private void btnNewSupplier_Click(object sender, EventArgs e)
        {
            LedgerDetails frmPayee = new LedgerDetails(LedgerDetails._LedgerCategory.Supplier, LedgerDetails._Type.showDialog);

            frmPayee.OnClose += frmPayee_OnClose;
            frmPayee.ShowDialog();
        }
Exemplo n.º 3
0
        private void AddSuppliersDetails_Click(object sender, EventArgs e)
        {
            LedgerDetails frmLedgerDetails = new LedgerDetails(LedgerDetails._LedgerCategory.Customer, LedgerDetails._Type.show);

            frmLedgerDetails.FitOnDown();
            frmLedgerDetails.OnClose += LedgerDetails_OnClose;
            frmLedgerDetails.ShowDialog();
        }
Exemplo n.º 4
0
 protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
 {
     if (keyData == (Keys.Alt | Keys.A))
     {
         btnNewSupplier_Click(btnNewSupplier, null);
         return(true);
     }
     else if (keyData == (Keys.Alt | Keys.Shift | Keys.A))
     {
         #region MyRegion
         if (!cmbSupplierName.Text.ISNullOrWhiteSpace())
         {
             try
             {
                 string        supplierID = ((KeyValuePair <string, string>)cmbSupplierName.SelectedItem).Key.ToString();
                 LedgerDetails frm        = new LedgerDetails(LedgerDetails._LedgerCategory.Supplier, LedgerDetails._Type.showDialog, supplierID);
                 frm.OnClose += Frm_OnClose;
                 frm.ShowDialog();
             }
             catch (Exception) { }
         }
         else
         {
             MessageBox.Show("Select supplier name.", "Supplier Edit", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             //cmbCustomerName.Select();
         }
         #endregion
         return(true);
     }
     else if (keyData == (Keys.Alt | Keys.I)) ///Add New Item
     {
         btnItemADD_Click(null, null);
         return(true);
     }
     else if (keyData == (Keys.Alt | Keys.Shift | Keys.I)) ///Edit Item
     {
         #region Edit Item
         if (!cmbItemName.Text.ISNullOrWhiteSpace())
         {
             try
             {
                 string    itemID = ((KeyValuePair <string, string>)cmbItemName.SelectedItem).Key.ToString();
                 ItemEntry frm    = new ItemEntry(itemID);
                 frm.onclose += item_onclose;
                 frm.ShowDialog();
             }
             catch (Exception) { }
         }
         else
         {
             MessageBox.Show("Select item name.", "Item Edit", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             //cmbCustomerName.Select();
         }
         #endregion
         return(true);
     }
     return(base.ProcessCmdKey(ref msg, keyData));
 }
Exemplo n.º 5
0
        private void AddSuppliersDetails_Click(object sender, EventArgs e)
        {
            LedgerDetails frmLedgerDetails = new LedgerDetails(LedgerDetails._LedgerCategory.Cash_Customer, LedgerDetails._Type.show);

            //frmLedgerDetails.FitOnDown();
            frmLedgerDetails.StartPosition = FormStartPosition.CenterScreen;
            frmLedgerDetails.OnClose      += LedgerDetails_OnClose;
            frmLedgerDetails.ShowDialog();
        }
Exemplo n.º 6
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (dgvSuppliersDetails.SelectedRows.Count > 0)
     {
         string        ledgersId = dgvSuppliersDetails.SelectedRows[0].Cells["LedgersId"].Value.ToString();
         LedgerDetails frm       = new LedgerDetails(LedgerDetails._LedgerCategory.Supplier, LedgerDetails._Type.showDialog, ledgersId);
         frm.OnClose += Frm_OnClose;
         frm.ShowDialog();
     }
 }
Exemplo n.º 7
0
 private void dgvSuppliersDetails_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex != -1)
     {
         if (dgvSuppliersDetails.SelectedCells.Count > 0)
         {
             string        tableId = dgvSuppliersDetails.Rows[e.RowIndex].Cells["LedgerId"].Value.ToString();
             LedgerDetails frm     = new LedgerDetails(LedgerDetails._LedgerCategory.Cash_Customer, LedgerDetails._Type.showDialog, tableId);
             frm.StartPosition = FormStartPosition.CenterScreen;
             frm.OnClose      += Frm_OnClose;
             frm.ShowDialog();
         }
     }
 }
Exemplo n.º 8
0
 private void dgvSuppliersDetails_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex != -1)
     {
         if (dgvSuppliersDetails.SelectedCells.Count > 0)
         {
             string        ledgersId = dgvSuppliersDetails.Rows[e.RowIndex].Cells["LedgerId"].Value.ToString();
             LedgerDetails frm       = new LedgerDetails(LedgerDetails._LedgerCategory.Customer, LedgerDetails._Type.showDialog, ledgersId);
             frm.FitOnDown();
             frm.OnClose += Frm_OnClose;
             frm.ShowDialog();
         }
     }
 }
Exemplo n.º 9
0
        private void button8_Click(object sender, EventArgs e)
        {
            MainWindow.Controls.Clear();

            SidePanel.Height = button8.Height;
            SidePanel.Top    = button8.Top;

            LedgerDetails ss = new LedgerDetails();

            ss.Dock = DockStyle.Fill;
            MainWindow.Controls.Add(ss);
            ss.Show();
            label1.Text = "Account Ledger";

            entriesButtonHide();
        }
Exemplo n.º 10
0
        private void grd_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1)
            {
                if (UserTools._IsEdit)
                {
                    int    rowindex = e.RowIndex;
                    string LedgerId = grd.Rows[rowindex].Cells["LedgerId"].Value.ToString();

                    LedgerDetails frmLedgerDetailsEdit = new LedgerDetails(LedgerDetails._LedgerCategory.Employee, LedgerDetails._Type.showDialog, LedgerId);
                    frmLedgerDetailsEdit.OnClose += FrmLedgerDetails_OnClose;
                    frmLedgerDetailsEdit.ShowDialog();
                }
                else
                {
                    MessageBox.Show("Permission Denied", "Edit", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
            }
        }
Exemplo n.º 11
0
 private void dgvSuppliersDetails_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex != -1 && e.ColumnIndex >= 0 && dgvSuppliersDetails.Columns[e.ColumnIndex].Name != "Action")
     {
         if (dgvSuppliersDetails.SelectedCells.Count > 0)
         {
             if (UserTools._IsEdit)
             {
                 string        ledgersId = dgvSuppliersDetails.Rows[e.RowIndex].Cells["LedgerId"].Value.ToString();
                 LedgerDetails frm       = new LedgerDetails(LedgerDetails._LedgerCategory.Supplier, LedgerDetails._Type.showDialog, ledgersId);
                 frm.FitOnDown();
                 frm.OnClose += Frm_OnClose;
                 frm.ShowDialog();
             }
             else
             {
                 MessageBox.Show("Permission Denied", "Edit", MessageBoxButtons.OK, MessageBoxIcon.Stop);
             }
         }
     }
 }
Exemplo n.º 12
0
 private void dgvEstimate_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvEstimate.Columns[e.ColumnIndex].Name == "Action" && e.RowIndex != -1)
     {
         IsLedgerSuccess = true;
         mcustomername   = dgvEstimate.CurrentRow.Cells["PartyName"].Value.ToString();
         string estimateno = dgvEstimate.CurrentRow.Cells["EstimateNo"].Value.ToString();
         string estimateid = dgvEstimate.CurrentRow.Cells["Estimateid"].Value.ToString();
         if (!IsexsistCustomer(mcustomername))
         {
             IsLedgerSuccess = false;
             LedgerDetails ledgerdetails = new LedgerDetails(LedgerDetails._LedgerCategory.Customer, LedgerDetails._Type.showDialog, estimateid, "estimate");
             ledgerdetails.OnClose += Ledgerdetails_OnClose;
             ledgerdetails.ShowDialog();
         }
         if (IsLedgerSuccess)
         {
             OrderEntry orderentry = new OrderEntry(estimateid, mcustomername, estimateno);
             orderentry.ShowDialog();
         }
     }
 }