Exemplo n.º 1
0
 /// <summary>
 /// Function to call this form from frmProductCreation to view details, Save and updation 
 /// </summary>
 /// <param name="frmProduct"></param>
 /// <param name="strProductName"></param>
 public void CallFromProdutCreation(frmProductCreation frmProduct, string strProductName)
 {
     try
     {
         frmProductCreationObj = frmProduct;
         txtProduct.Text = strProductName;
         base.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show("PB:1" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Function to call this form from ProductCreation form
 /// </summary>
 /// <param name="frmProduct"></param>
 public void CallFromProdutCreation(frmProductCreation frmProduct)
 {
     try
     {
         frmProduct.Enabled = false;
         this.frmProductCreationObj = frmProduct;
         base.Show();
         dgvGodown.Enabled = false;
     }
     catch (Exception ex)
     {
         MessageBox.Show("G1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Function to do when calling from productcreation form
 /// </summary>
 /// <param name="frmProduct"></param>
 /// <param name="strProductName"></param>
 /// <param name="decUnitId"></param>
 /// <param name="strUnit"></param>
 public void CallFromProdutCreation(frmProductCreation frmProduct, string strProductName, decimal decUnitId, string strUnit)
 {
     try
     {
         decUnitIdExcludeToFillCombo = decUnitId;
         decUnitIdToSend = decUnitId;
         UnitComboFill(decUnitId);
         frmProductCreationObj = frmProduct;
         txtProductName.Text = strProductName;
         strUnitName = strUnit;
         isCheckVariable = true;
         base.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show("PMU:5" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Function to call this form from frmProductCreation to view details, Save and updation ifthe product was not saved
 /// </summary>
 /// <param name="frmProduct"></param>
 /// <param name="strProductName"></param>
 /// <param name="dtblBomAgain"></param>
 public void CallFromProdutCreationAgain(frmProductCreation frmProduct, string strProductName, DataTable dtblBomAgain)
 {
     try
     {
         base.Show();
         frmProductCreationObj = frmProduct;
         txtProduct.Text = strProductName;
         for (int inI = 0; inI < dtblBomAgain.Rows.Count; inI++)
         {
             dgvProductBOM.Rows.Add();
             dgvProductBOM.Rows[inI].Cells["dgvtxtQty"].Value = dtblBomAgain.Rows[inI]["dgvtxtQty"];
             dgvProductBOM.Rows[inI].Cells["dgvcmbRawMaterial"].Value = dtblBomAgain.Rows[inI]["dgvcmbRawMaterial"];
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PB:2" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        /// <summary>
        /// Form keydown for quick access
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmPurchaseOrder_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Escape)
                {
                    if (PublicVariables.isMessageClose)
                    {
                        Messages.CloseMessage(this);
                    }
                    else
                    {
                        this.Close();
                    }
                }
                if (e.KeyCode == Keys.S && Control.ModifierKeys == Keys.Control)
                {
                    btnSave.Focus();
                    btnSave_Click(sender, e);
                }
                if (btnDelete.Enabled == true)
                {
                    if (e.KeyCode == Keys.D && Control.ModifierKeys == Keys.Control)
                    {

                        btnDelete_Click(sender, e);
                    }
                }
                if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt)
                {
                    if (dgvPurchaseOrder.CurrentCell != null)
                    {
                        if (dgvPurchaseOrder.CurrentCell == dgvPurchaseOrder.CurrentRow.Cells["dgvtxtProductName"] || dgvPurchaseOrder.CurrentCell == dgvPurchaseOrder.CurrentRow.Cells["dgvtxtProductCode"])
                        {
                            SendKeys.Send("{F10}");
                            if (dgvPurchaseOrder.Columns[dgvPurchaseOrder.CurrentCell.ColumnIndex].Name == "dgvtxtProductName" || dgvPurchaseOrder.Columns[dgvPurchaseOrder.CurrentCell.ColumnIndex].Name == "dgvtxtProductCode")
                            {
                                frmProductCreation frmProductCreationObj = new frmProductCreation();
                                frmProductCreationObj.MdiParent = formMDI.MDIObj;
                                frmProductCreationObj.CallFromPurchaseOrder(this);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("PO62:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// Calls frmProductCreation form
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void productCreationToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         frmProductCreation frm = new frmProductCreation();
         frmProductCreation open = Application.OpenForms["frmProductCreation"] as frmProductCreation;
         if (open == null)
         {
             frm.MdiParent = this;
             frm.Show();
         }
         else
         {
             open.Activate();
             if (open.WindowState == FormWindowState.Minimized)
             {
                 open.WindowState = FormWindowState.Normal;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("MDI 90 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// Function for Return from productCreationPopup
 /// </summary>
 /// <param name="decProductId"></param>
 public void ReturnFromProductCreation(decimal decProductId)
 {
     frmProductCreation productcreation = new frmProductCreation();
     ProductInfo infoProduct = new ProductInfo();
     ProductSP spProduct = new ProductSP();
     try
     {
         int inI = dgvPurchaseReturn.CurrentRow.Index;
         this.Enabled = true;
         base.Show();
         if (decProductId != 0)
         {
             infoProduct = spProduct.ProductView(decProductId);
             strProductCode = infoProduct.ProductCode;
             productDetailsFillFromProductCreation(productcreation, decProductId, inI);
         }
         dgvPurchaseReturn.Focus();
     }
     catch (Exception ex)
     {
         MessageBox.Show("PR:25" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        /// <summary>
        /// Calls the corresponding voucher on click in Quick Launch menu
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn1_Click(object sender, EventArgs e)
        {
            this.SendToBack();
            Form frmObj = null;
            Form open = null;
            SettingsBll BllSettings = new SettingsBll();
            try
            {
                string str = ((Button)sender).Text;
                btnFocus.Focus();
                switch (str)
                {
                    case "Contra Voucher":
                        formMDI.MDIObj.ContraVoucherClick();
                        break;
                    case "Payment Voucher":
                        formMDI.MDIObj.PaymentVoucherClick();
                        break;
                    case "Receipt Voucher":
                        formMDI.MDIObj.ReceiptVoucherClick();
                        break;
                    case "Journal Voucher":
                        formMDI.MDIObj.JournalVoucherClick();
                        break;
                    case "Sales Invoice":
                        formMDI.MDIObj.SalesInvoiceClick();
                        break;
                    case "Purchase Invoice":
                        formMDI.MDIObj.PurchaseInvoiceClick();
                        break;
                    case "POS":
                        formMDI.MDIObj.POSClick();
                        break;
                    case "PDC Payable":
                        formMDI.MDIObj.PDCPayableClick();
                        break;
                    case "PDC Receivable":
                        formMDI.MDIObj.PDCReceivableClick();
                        break;
                    case "PDC Clearance":
                        formMDI.MDIObj.PDCClearenceClick();
                        break;
                    case "Bank Reconciliation":
                        frmObj = new frmBankReconciliation();
                        open = Application.OpenForms["frmBankReconciliation"] as frmBankReconciliation;
                        break;
                    case "Purchase Order":
                        formMDI.MDIObj.PurchaseOrderClick();
                        break;
                    case "Material Reciept":
                        formMDI.MDIObj.MaterialReceiptClick();
                        break;
                    case "Rejection Out":
                        formMDI.MDIObj.RejectionOutClick();
                        break;
                    case "Purchase Return":
                        formMDI.MDIObj.PurchaseReturnClick();
                        break;
                    case "Sales Quotation":
                        formMDI.MDIObj.SalesQuotationClick();
                        break;
                    case "Sales Order":
                        formMDI.MDIObj.SalesOrderClick();
                        break;
                    case "Delivery Note":
                        formMDI.MDIObj.DeliveryNoteClick();
                        break;
                    case "Rejection In":
                        formMDI.MDIObj.RejectionInClick();
                        break;
                    case "Sales Return":
                        formMDI.MDIObj.SalesReturnClick();
                        break;
                    case "Physical Stock":
                        formMDI.MDIObj.PhysicalStockClick();
                        break;
                    case "Service Voucher":
                        formMDI.MDIObj.ServiceVoucherClick();
                        break;
                    case "Credit Note":
                        formMDI.MDIObj.CreditNoteClick();
                        break;
                    case "Debit Note":
                        formMDI.MDIObj.DebitNoteClick();
                        break;
                    case "Stock Journal":
                        //frmObj = new frmStockJournal();
                        //open = Application.OpenForms["frmStockJournal"] as frmStockJournal;
                        formMDI.MDIObj.StockJournalClick();
                        break;
                    case "Bill Allocation":
                        frmObj = new frmBillallocation();
                        open = Application.OpenForms["frmBillallocation"] as frmBillallocation;
                        break;
                    case "Account Group":
                        frmObj = new frmAccountGroup();
                        open = Application.OpenForms["frmAccountGroup"] as frmAccountGroup;
                        break;
                    case "Account Ledger":
                        frmObj = new frmAccountLedger();
                        open = Application.OpenForms["frmAccountLedger"] as frmAccountLedger;
                        break;
                    case "Multiple Account Ledgers":
                        frmObj = new frmmultipleAccountLedger();
                        open = Application.OpenForms["frmmultipleAccountLedger"] as frmmultipleAccountLedger;
                        break;
                    case "Product Group":
                        frmObj = new frmProductGroup();
                        open = Application.OpenForms["frmProductGroup"] as frmProductGroup;
                        break;
                    case "Product Creation":
                        frmObj = new frmProductCreation();
                        open = Application.OpenForms["frmProductCreation"] as frmProductCreation;
                        break;
                    case "Multiple Product Creation":
                        frmObj = new frmMultipleProductCreation();
                        open = Application.OpenForms["frmMultipleProductCreation"] as frmMultipleProductCreation;
                        break;
                    case "Batch":
                        if (BllSettings.SettingsStatusCheck("AllowBatch") == "Yes")
                        {
                            frmObj = new frmBatch();
                            open = Application.OpenForms["frmBatch"] as frmBatch;
                        }
                        break;
                    case "Brand":
                        frmObj = new frmBrand();
                        open = Application.OpenForms["frmBrand"] as frmBrand;
                        break;
                    case "Model Number":
                        if (BllSettings.SettingsStatusCheck("AllowModelNo") == "Yes")
                        {
                            frmObj = new frmModalNo();
                            open = Application.OpenForms["frmModalNo"] as frmModalNo;
                        }
                        break;
                    case "Size":
                        if (BllSettings.SettingsStatusCheck("AllowSize") == "Yes")
                        {
                            frmObj = new frmSize();
                            open = Application.OpenForms["frmSize"] as frmSize;
                        }
                        break;
                    case "Unit":
                        frmObj = new frmUnit();
                        open = Application.OpenForms["frmUnit"] as frmUnit;
                        break;
                    case "Godown":
                        if (BllSettings.SettingsStatusCheck("AllowGodown") == "Yes")
                        {
                            frmObj = new frmGodown();
                            open = Application.OpenForms["frmGodown"] as frmGodown;
                        }
                        break;
                    case "Rack":
                        if (BllSettings.SettingsStatusCheck("AllowRack") == "Yes")
                        {
                            frmObj = new frmRack();
                            open = Application.OpenForms["frmRack"] as frmRack;
                        }
                        break;
                    case "Pricing Level":
                        frmObj = new frmPricingLevel();
                        open = Application.OpenForms["frmPricingLevel"] as frmPricingLevel;
                        break;
                    case "Price List":
                        frmObj = new frmPriceList();
                        open = Application.OpenForms["frmPriceList"] as frmPriceList;
                        break;
                    case "Standard Rate":
                        frmObj = new frmStandardRate();
                        open = Application.OpenForms["frmStandardRate"] as frmStandardRate;
                        break;
                    case "Tax":
                        if (BllSettings.SettingsStatusCheck("Tax") == "Yes")
                        {
                            frmObj = new frmTax();
                            open = Application.OpenForms["frmTax"] as frmTax;
                        }
                        break;
                    case "Currency":
                        if (BllSettings.SettingsStatusCheck("MultiCurrency") == "Yes")
                        {
                            frmObj = new frmCurrency();
                            open = Application.OpenForms["frmCurrency"] as frmCurrency;
                        }
                        break;
                    case "Exchange Rate":
                        frmObj = new frmExchangeRate();
                        open = Application.OpenForms["frmExchangeRate"] as frmExchangeRate;
                        break;
                    case "Service Category":
                        frmObj = new frmServiceCategory();
                        open = Application.OpenForms["frmServiceCategory"] as frmServiceCategory;
                        break;
                    case "Services":
                        frmObj = new frmServices();
                        open = Application.OpenForms["frmServices"] as frmServices;
                        break;
                    case "Voucher Type":
                        frmObj = new frmVoucherType();
                        open = Application.OpenForms["frmVoucherType"] as frmVoucherType;
                        break;
                    case "Area":
                        frmObj = new frmArea();
                        open = Application.OpenForms["frmArea"] as frmArea;
                        break;
                    case "Route":
                        frmObj = new frmRoute();
                        open = Application.OpenForms["frmRoute"] as frmRoute;
                        break;
                    case "Counter":
                        frmObj = new frmCounter();
                        open = Application.OpenForms["frmCounter"] as frmCounter;
                        break;
                    case "Product Register":
                        frmObj = new frmProductRegister();
                        open = Application.OpenForms["frmProductRegister"] as frmProductRegister;
                        break;
                    case "Salesman":
                        frmObj = new frmSalesman();
                        open = Application.OpenForms["frmSalesman"] as frmSalesman;
                        break;
                    case "Contra Register":
                        frmObj = new frmContraRegister();
                        open = Application.OpenForms["frmContraRegister"] as frmContraRegister;
                        break;
                    case "Payment Register":
                        frmObj = new frmPaymentRegister();
                        open = Application.OpenForms["frmPaymentRegister"] as frmPaymentRegister;
                        break;
                    case "Receipt Register":
                        frmObj = new frmReceiptRegister();
                        open = Application.OpenForms["frmReceiptRegister"] as frmReceiptRegister;
                        break;
                    case "Journal Register":
                        frmObj = new frmJournalRegister();
                        open = Application.OpenForms["frmJournalRegister"] as frmJournalRegister;
                        break;
                    case "PDC Payable Register":
                        frmObj = new frmPDCPayableRegister();
                        open = Application.OpenForms["frmPDCPayableRegister"] as frmPDCPayableRegister;
                        break;
                    case "PDC Receivable Register":
                        frmObj = new frmPDCReceivableRegister();
                        open = Application.OpenForms["frmPDCReceivableRegister"] as frmPDCReceivableRegister;
                        break;
                    case "PDC Clearance Register":
                        frmObj = new frmPdcClearanceRegister();
                        open = Application.OpenForms["frmPdcClearanceRegister"] as frmPdcClearanceRegister;
                        break;
                    case "Purchase Order Register":
                        frmObj = new frmPurchaseOrderRegister();
                        open = Application.OpenForms["frmPurchaseOrderRegister"] as frmPurchaseOrderRegister;
                        break;
                    case "Material Receipt Register":
                        frmObj = new frmMaterialReceiptRegister();
                        open = Application.OpenForms["frmMaterialReceiptRegister"] as frmMaterialReceiptRegister;
                        break;
                    case "Rejection Out Register":
                        frmObj = new frmRejectionOutRegister();
                        open = Application.OpenForms["frmRejectionOutRegister"] as frmRejectionOutRegister;
                        break;
                    case "Purchase Invoice Register":
                        frmObj = new frmPurchaseInvoiceRegister();
                        open = Application.OpenForms["frmPurchaseInvoiceRegister"] as frmPurchaseInvoiceRegister;
                        break;
                    case "Purchase Return Register":
                        frmObj = new frmPurchaseReturnRegister();
                        open = Application.OpenForms["frmPurchaseReturnRegister"] as frmPurchaseReturnRegister;
                        break;
                    case "Sales Quotation Register":
                        frmObj = new frmSalesQuotationRegister();
                        open = Application.OpenForms["frmSalesQuotationRegister"] as frmSalesQuotationRegister;
                        break;
                    case "Sales Order Register":
                        frmObj = new frmSalesOrderRegister();
                        open = Application.OpenForms["frmSalesOrderRegister"] as frmSalesOrderRegister;
                        break;
                    case "Delivery Note Register":
                        frmObj = new frmDeliveryNoteRegister();
                        open = Application.OpenForms["frmDeliveryNoteRegister"] as frmDeliveryNoteRegister;
                        break;
                    case "Rejection In Register":
                        frmObj = new frmRejectionInRegister();
                        open = Application.OpenForms["frmRejectionInRegister"] as frmRejectionInRegister;
                        break;
                    case "Sales Invoice Register":
                        frmObj = new frmSalesInvoiceRegister();
                        open = Application.OpenForms["frmSalesInvoiceRegister"] as frmSalesInvoiceRegister;
                        break;
                    case "Sales Return Register":
                        frmObj = new frmSalesReturnRegister();
                        open = Application.OpenForms["frmSalesReturnRegister"] as frmSalesReturnRegister;
                        break;
                    case "Physical Stock Register":
                        frmObj = new frmPhysicalStockRegister();
                        open = Application.OpenForms["frmPhysicalStockRegister"] as frmPhysicalStockRegister;
                        break;
                    case "Service Voucher Register":
                        frmObj = new frmServiceVoucherRegister();
                        open = Application.OpenForms["frmServiceVoucherRegister"] as frmServiceVoucherRegister;
                        break;
                    case "Credit Note Register":
                        frmObj = new frmCreditNoteRegister();
                        open = Application.OpenForms["frmCreditNoteRegister"] as frmCreditNoteRegister;
                        break;
                    case "Debit Note Register":
                        frmObj = new frmDebitNoteRegister();
                        open = Application.OpenForms["frmDebitNoteRegister"] as frmDebitNoteRegister;
                        break;
                    case "Stock Journal Register":
                        frmObj = new frmStockJournalRegister();
                        open = Application.OpenForms["frmStockJournalRegister"] as frmStockJournalRegister;
                        break;
                    case "Designation":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmDesignation();
                            open = Application.OpenForms["frmDesignation"] as frmDesignation;
                        }
                        break;
                    case "Pay Head":
                        {
                            frmObj = new frmPayHead();
                            open = Application.OpenForms["frmPayHead"] as frmPayHead;
                        }
                        break;
                    case "Salary Package Creation":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmSalaryPackageCreation();
                            open = Application.OpenForms["frmSalaryPackageCreation"] as frmSalaryPackageCreation;
                        }
                        break;
                    case "Salary Package Register":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmSalaryPackageRegister();
                            open = Application.OpenForms["frmSalaryPackageRegister"] as frmSalaryPackageRegister;
                        }
                        break;
                    case "Employee Creation":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmEmployeeCreation();
                            open = Application.OpenForms["frmEmployeeCreation"] as frmEmployeeCreation;
                        }
                        break;
                    case "Employee Register":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmEmployeeRegister();
                            open = Application.OpenForms["frmEmployeeRegister"] as frmEmployeeRegister;
                        }
                        break;
                    case "Holiday Settings":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmHolydaySettings();
                            open = Application.OpenForms["frmHolydaySettings"] as frmHolydaySettings;
                        }
                        break;
                    case "Monthly Salary Settings":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmMonthlySalarySettings();
                            open = Application.OpenForms["frmMonthlySalarySettings"] as frmMonthlySalarySettings;
                        }
                        break;
                    case "Attendance":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmAttendance();
                            open = Application.OpenForms["frmAttendance"] as frmAttendance;
                        }
                        break;
                    case "Advance Payment":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmAdvancePayment();
                            open = Application.OpenForms["frmAdvancePayment"] as frmAdvancePayment;
                        }
                        break;
                    case "Advance Register":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmAdvanceRegister();
                            open = Application.OpenForms["frmAdvanceRegister"] as frmAdvanceRegister;
                        }
                        break;
                    case "Bonus Deduction":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmBonusDeduction();
                            open = Application.OpenForms["frmBonusDeduction"] as frmBonusDeduction;
                        }
                        break;
                    case "Bonus Deduction Register":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmBonusDeductionRegister();
                            open = Application.OpenForms["frmBonusDeductionRegister"] as frmBonusDeductionRegister;
                        }
                        break;
                    case "Monthly Salary Voucher":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmMonthlySalaryVoucher();
                            open = Application.OpenForms["frmMonthlySalaryVoucher"] as frmMonthlySalaryVoucher;
                        }
                        break;
                    case "Monthly Salary Register":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmMonthlySalaryRegister();
                            open = Application.OpenForms["frmMonthlySalaryRegister"] as frmMonthlySalaryRegister;
                        }
                        break;
                    case "Daily Salary Voucher":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmDailySalaryVoucher();
                            open = Application.OpenForms["frmDailySalaryVoucher"] as frmDailySalaryVoucher;
                        }
                        break;
                    case "Daily Salary Register":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmDailySalaryRegister();
                            open = Application.OpenForms["frmDailySalaryRegister"] as frmDailySalaryRegister;
                        }
                        break;
                    case "Pay Slip":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmPaySlip();
                            open = Application.OpenForms["frmPaySlip"] as frmPaySlip;
                        }
                        break;
                    case "Budget":
                        if (BllSettings.SettingsStatusCheck("Budget") == "Yes")
                        {
                            frmObj = new frmBudget();
                            open = Application.OpenForms["frmBudget"] as frmBudget;
                        }
                        break;
                    case "Budget Variance":
                        if (BllSettings.SettingsStatusCheck("Budget") == "Yes")
                        {
                            frmObj = new frmBudgetVariance();
                            open = Application.OpenForms["frmBudgetVariance"] as frmBudgetVariance;
                        }
                        break;
                    case "Change Current Date":
                        frmObj = new frmChangeCurrentDate();
                        open = Application.OpenForms["frmChangeCurrentDate"] as frmChangeCurrentDate;
                        break;
                    case "Settings":
                        frmObj = new frmSettings();
                        open = Application.OpenForms["frmSettings"] as frmSettings;
                        break;
                    case "Role":
                        frmObj = new frmRole();
                        open = Application.OpenForms["frmRole"] as frmRole;
                        break;
                    case "Role Privilege Settings":
                        frmObj = new frmRolePrivilegeSettings();
                        open = Application.OpenForms["frmRolePrivilegeSettings"] as frmRolePrivilegeSettings;
                        break;
                    case "User Creation":
                        frmObj = new frmUserCreation();
                        open = Application.OpenForms["frmUserCreation"] as frmUserCreation;
                        break;
                    case "Change Password":
                        frmObj = new frmChangePassword();
                        open = Application.OpenForms["frmChangePassword"] as frmChangePassword;
                        break;
                    case "New Financial Year":
                        frmObj = new frmNewFinancialYear();
                        open = Application.OpenForms["frmNewFinancialYear"] as frmNewFinancialYear;
                        break;
                    case "Change Financial Year":
                        frmObj = new frmChangeFinancialYear();
                        open = Application.OpenForms["frmChangeFinancialYear"] as frmChangeFinancialYear;
                        break;
                    case "Barcode Settings":
                        frmObj = new frmBarcodeSettings();
                        open = Application.OpenForms["frmBarcodeSettings"] as frmBarcodeSettings;
                        break;
                    case "Barcode Printing":
                        frmObj = new frmBarcodePrinting();
                        open = Application.OpenForms["frmBarcodePrinting"] as frmBarcodePrinting;
                        break;
                    case "Suffix Prefix Settings":
                        frmObj = new frmSuffixPrefixSettings();
                        open = Application.OpenForms["frmSuffixPrefixSettings"] as frmSuffixPrefixSettings;
                        break;
                    case "Change Product Tax":
                        frmObj = new frmChangeProductTax();
                        open = Application.OpenForms["frmChangeProductTax"] as frmChangeProductTax;
                        break;
                    case "Product Search":
                        frmObj = new frmProductSearch();
                        open = Application.OpenForms["frmProductSearch"] as frmProductSearch;
                        break;
                    case "Voucher Search":
                        frmObj = new frmVoucherSearch();
                        open = Application.OpenForms["frmVoucherSearch"] as frmVoucherSearch;
                        break;
                    case "Voucher Wise Product Search":
                        frmObj = new frmVoucherWiseProductSearch();
                        open = Application.OpenForms["frmVoucherWiseProductSearch"] as frmVoucherWiseProductSearch;
                        break;
                    case "Personal Reminder":
                        frmObj = new frmPersonalReminder();
                        open = Application.OpenForms["frmPersonalReminder"] as frmPersonalReminder;
                        break;
                    case "Overdue Purchase Order":
                        frmObj = new frmOverduePurchaseOrder();
                        open = Application.OpenForms["frmOverduePurchaseOrder"] as frmOverduePurchaseOrder;
                        break;
                    case "Overdue Sales Order":
                        frmObj = new frmOverdueSalesOrder();
                        open = Application.OpenForms["frmOverdueSalesOrder"] as frmOverdueSalesOrder;
                        break;
                    case "Short Expiry":
                        frmObj = new frmShortExpiry();
                        open = Application.OpenForms["frmShortExpiry"] as frmShortExpiry;
                        break;
                    case "Stock":
                        frmObj = new frmStock();
                        open = Application.OpenForms["frmStock"] as frmStock;
                        break;
                    case "Trial Balance":
                        frmObj = new frmTrialBalance();
                        open = Application.OpenForms["frmTrialBalance"] as frmTrialBalance;
                        break;
                    case "Balance Sheet":
                        frmObj = new frmBalanceSheet();
                        open = Application.OpenForms["frmBalanceSheet"] as frmBalanceSheet;
                        break;
                    case "Profit and Loss":
                        frmObj = new frmProfitAndLoss();
                        open = Application.OpenForms["frmProfitAndLoss"] as frmProfitAndLoss;
                        break;
                    case "Cash Flow":
                        frmObj = new frmCashFlow();
                        open = Application.OpenForms["frmCashFlow"] as frmCashFlow;
                        break;
                    case "Fund Flow":
                        frmObj = new frmFundFlow();
                        open = Application.OpenForms["frmFundFlow"] as frmFundFlow;
                        break;
                    case "Chart of Account":
                        frmObj = new frmChartOfAccount();
                        open = Application.OpenForms["frmChartOfAccount"] as frmChartOfAccount;
                        break;
                    case "Contra Report":
                        frmObj = new frmContraReport();
                        open = Application.OpenForms["frmContraReport"] as frmContraReport;
                        break;
                    case "Payment Report":
                        frmObj = new frmPaymentReport();
                        open = Application.OpenForms["frmPaymentReport"] as frmPaymentReport;
                        break;
                    case "Receipt Report":
                        frmObj = new frmReceiptReport();
                        open = Application.OpenForms["frmReceiptReport"] as frmReceiptReport;
                        break;
                    case "Journal Report":
                        frmObj = new frmJournalReport();
                        open = Application.OpenForms["frmJournalReport"] as frmJournalReport;
                        break;
                    case "PDC Payable Report":
                        frmObj = new frmPDCPayableReport();
                        open = Application.OpenForms["frmPDCPayableReport"] as frmPDCPayableReport;
                        break;
                    case "PDC Receivable Report":
                        frmObj = new frmPDCRecievableReport();
                        open = Application.OpenForms["frmPDCRecievableReport"] as frmPDCRecievableReport;
                        break;
                    case "PDC Clearance Report":
                        frmObj = new frmPDCClearanceReport();
                        open = Application.OpenForms["frmPDCClearanceReport"] as frmPDCClearanceReport;
                        break;
                    case "Purchase Order Report":
                        frmObj = new frmPurchaseOrderReport();
                        open = Application.OpenForms["frmPurchaseOrderReport"] as frmPurchaseOrderReport;
                        break;
                    case "Material Receipt Report":
                        frmObj = new frmMaterialReceiptReport();
                        open = Application.OpenForms["frmMaterialReceiptReport"] as frmMaterialReceiptReport;
                        break;
                    case "Rejection Out Report":
                        frmObj = new frmRejectionOutReport();
                        open = Application.OpenForms["frmRejectionOutReport"] as frmRejectionOutReport;
                        break;
                    case "Purchase Invoice Report":
                        frmObj = new frmPurchaseReport();
                        open = Application.OpenForms["frmPurchaseReport"] as frmPurchaseReport;
                        break;
                    case "Purchase Return Report":
                        frmObj = new frmPurchaseReturnReport();
                        open = Application.OpenForms["frmPurchaseReturnReport"] as frmPurchaseReturnReport;
                        break;
                    case "Sales Quotation Report":
                        frmObj = new frmSalesQuotationReport();
                        open = Application.OpenForms["frmSalesQuotationReport"] as frmSalesQuotationReport;
                        break;
                    case "Sales Order Report":
                        frmObj = new frmSalesOrderReport();
                        open = Application.OpenForms["frmSalesOrderReport"] as frmSalesOrderReport;
                        break;
                    case "Delivery Note Report":
                        frmObj = new frmDeliveryNoteReport();
                        open = Application.OpenForms["frmDeliveryNoteReport"] as frmDeliveryNoteReport;
                        break;
                    case "Rejection In Report":
                        frmObj = new frmRejectionInReport();
                        open = Application.OpenForms["frmRejectionInReport"] as frmRejectionInReport;
                        break;
                    case "Sales Invoice Report":
                        frmObj = new frmSalesReport();
                        open = Application.OpenForms["frmSalesReport"] as frmSalesReport;
                        break;
                    case "Sales Return Report":
                        frmObj = new frmSalesReturnReport();
                        open = Application.OpenForms["frmSalesReturnReport"] as frmSalesReturnReport;
                        break;
                    case "Physical Stock Report":
                        frmObj = new frmPhysicalStockReport();
                        open = Application.OpenForms["frmPhysicalStockReport"] as frmPhysicalStockReport;
                        break;
                    case "Service Report":
                        frmObj = new frmServiceReport();
                        open = Application.OpenForms["frmServiceReport"] as frmServiceReport;
                        break;
                    case "Credit Note Report":
                        frmObj = new frmCreditNoteReport();
                        open = Application.OpenForms["frmCreditNoteReport"] as frmCreditNoteReport;
                        break;
                    case "Debit Note Report":
                        frmObj = new frmDebitNoteReport();
                        open = Application.OpenForms["frmDebitNoteReport"] as frmDebitNoteReport;
                        break;
                    case "Stock Journal Report":
                        frmObj = new frmStockJournelReport();
                        open = Application.OpenForms["frmStockJournelReport"] as frmStockJournelReport;
                        break;
                    case "Employee Report":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmEmployeeReport();
                            open = Application.OpenForms["frmEmployeeReport"] as frmEmployeeReport;
                        }
                        break;
                    case "Daily Attendance Report":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmDailyAttendanceReport();
                            open = Application.OpenForms["frmDailyAttendanceReport"] as frmDailyAttendanceReport;
                        }
                        break;
                    case "Monthly Attendance Report":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmMonthlyAttendanceReport();
                            open = Application.OpenForms["frmMonthlyAttendanceReport"] as frmMonthlyAttendanceReport;
                        }
                        break;
                    case "Daily Salary Report":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmDailySalaryReport();
                            open = Application.OpenForms["frmDailySalaryReport"] as frmDailySalaryReport;
                        }
                        break;
                    case "Monthly Salary Report":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmMonthlySalaryReport();
                            open = Application.OpenForms["frmMonthlySalaryReport"] as frmMonthlySalaryReport;
                        }
                        break;
                    case "Payhead Report":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmPayHeadReport();
                            open = Application.OpenForms["frmPayHeadReport"] as frmPayHeadReport;
                        }
                        break;
                    case "Salary Package Report":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmSalaryPackageReport();
                            open = Application.OpenForms["frmSalaryPackageReport"] as frmSalaryPackageReport;
                        }
                        break;
                    case "Advance Payment Report":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmAdvancePaymentReport();
                            open = Application.OpenForms["frmAdvancePaymentReport"] as frmAdvancePaymentReport;
                        }
                        break;
                    case "Bonus Deduction Report":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmBonusDeductionReport();
                            open = Application.OpenForms["frmBonusDeductionReport"] as frmBonusDeductionReport;
                        }
                        break;
                    case "Employee Address Book Report":
                        if (BllSettings.SettingsStatusCheck("Payroll") == "Yes")
                        {
                            frmObj = new frmEmployeeAddressBook();
                            open = Application.OpenForms["frmEmployeeAddressBook"] as frmEmployeeAddressBook;
                        }
                        break;
                    case "Day Book":
                        frmObj = new frmDayBook();
                        open = Application.OpenForms["frmDayBook"] as frmDayBook;
                        break;
                    case "Cash/Bank Book":
                        frmObj = new frmCashBankBookReport();
                        open = Application.OpenForms["frmCashBankBookReport"] as frmCashBankBookReport;
                        break;
                    case "Account Groupwise Report":
                        frmObj = new frmAccountGroupwiseReport();
                        open = Application.OpenForms["frmAccountGroupwiseReport"] as frmAccountGroupwiseReport;
                        break;
                    case "Account Ledger Report":
                        frmObj = new frmAccountLedgerReport();
                        open = Application.OpenForms["frmAccountLedgerReport"] as frmAccountLedgerReport;
                        break;
                    case "Outstanding Report":
                        frmObj = new frmOutstandingReport();
                        open = Application.OpenForms["frmOutstandingReport"] as frmOutstandingReport;
                        break;
                    case "Ageing Report":
                        frmObj = new frmAgeingReport();
                        open = Application.OpenForms["frmAgeingReport"] as frmAgeingReport;
                        break;
                    case "Party's Address Book":
                        frmObj = new frmPartyAddressBook();
                        open = Application.OpenForms["frmPartyAddressBook"] as frmPartyAddressBook;
                        break;
                    case "Stock Report":
                        frmObj = new frmStockReport();
                        open = Application.OpenForms["frmStockReport"] as frmStockReport;
                        break;
                    case "Short Expiry Report":
                        frmObj = new frmShortExpiryReport();
                        open = Application.OpenForms["frmShortExpiryReport"] as frmShortExpiryReport;
                        break;
                    case "Product Statistics":
                        frmObj = new frmProductStatistics();
                        open = Application.OpenForms["frmProductStatistics"] as frmProductStatistics;
                        break;
                    case "Price List Report":
                        frmObj = new frmPriceListReport();
                        open = Application.OpenForms["frmPriceListReport"] as frmPriceListReport;
                        break;
                    case "Tax Report":
                        frmObj = new frmTaxReport();
                        open = Application.OpenForms["frmTaxReport"] as frmTaxReport;
                        break;
                    case "VAT Report":
                        frmObj = new frmVatReturnReport();
                        open = Application.OpenForms["frmVatReturnReport"] as frmVatReturnReport;
                        break;
                    case "Cheque Report":
                        frmObj = new frmChequeReport();
                        open = Application.OpenForms["frmChequeReport"] as frmChequeReport;
                        break;
                    case "Free Sale Report":
                        frmObj = new frmFreeSaleReport();
                        open = Application.OpenForms["frmFreeSaleReport"] as frmFreeSaleReport;
                        break;
                    case "Product Vs Batch Report":
                        frmObj = new frmProductVsBatchReport();
                        open = Application.OpenForms["frmProductVsBatchReport"] as frmProductVsBatchReport;
                        break;

                    case "Customer":
                        frmObj = new frmCustomer();
                        open = Application.OpenForms["frmCustomer"] as frmCustomer;
                        break;

                    case "Supplier":
                        frmObj = new frmSupplier();
                        open = Application.OpenForms["frmSupplier"] as frmSupplier;
                        break;
                }
                if (frmObj != null)
                {
                    if (open == null)
                    {
                        frmObj.MdiParent = formMDI.MDIObj;
                        frmObj.Show();
                    }
                    else
                    {
                        open.Activate();
                        if (open.WindowState == FormWindowState.Minimized)
                        {
                            open.WindowState = FormWindowState.Normal;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("QL:4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        /// <summary>
        ///  Function to fill the product details in dataGridView from productCreationPopup
        /// </summary>
        /// <param name="productcreation"></param>
        /// <param name="decproductId"></param>
        /// <param name="decCurrentRowIndex"></param>
        public void productDetailsFillFromProductCreation(frmProductCreation productcreation, decimal decproductId, decimal decCurrentRowIndex)
        {
            try
            {
                decimal decCurrentConversionRate = 0;
                DataTable dtbl = new DataTable();
                UnitConvertionBll bllUnitConvertion = new UnitConvertionBll();
                BatchBll BllBatch = new BatchBll();
                ProductInfo infoProductFill = new ProductInfo();
                ProductCreationBll BllProductCreation = new ProductCreationBll();
                ProductInfo infoProduct = new ProductInfo();
                int inI = dgvProduct.CurrentRow.Index;
                if (inI == dgvProduct.Rows.Count - 1)
                {
                    dgvProduct.Rows.Add();
                }
                  if (decproductId != 0)
                    {
                        infoProduct = BllProductCreation.ProductView(decproductId);
                        SerialNo();
                        dgvProduct.Rows[inI].Cells["dgvtxtproductCode"].Value = infoProduct.ProductCode;
                        dgvProduct.Rows[inI].Cells["productId"].Value = decproductId.ToString();
                        dgvProduct.Rows[inI].Cells["dgvtxtProductName"].Value = infoProduct.ProductName;
                        dgvProduct.Rows[inI].Cells["dgvcmbGodown"].Value = infoProduct.GodownId;
                        dgvProduct.Rows[inI].Cells["dgvCmbRack"].Value = infoProduct.RackId;
                        UnitComboFill(decproductId, inI, dgvProduct.Rows[inI].Cells["dgvcmbUnit"].ColumnIndex);
                        dgvProduct.Rows[inI].Cells["dgvcmbUnit"].Value = infoProduct.UnitId;

                        List<DataTable> list = new  List<DataTable>();
                        list = bllUnitConvertion.UnitConversionIdAndConRateViewallByProductId(dgvProduct.Rows[inI].Cells["productId"].Value.ToString());
                        //UnitComboFill(infoProduct.ProductId, dgvProduct.CurrentRow.Index, dgvProduct.CurrentRow.Cells["dgvcmbUnit"].ColumnIndex);
                        //dgvProduct.Rows[inI].Cells["dgvcmbUnit"].Value = infoProduct.UnitId;
                        dgvProduct.Rows[inI].Cells["dgvtxtRate"].Value = Math.Round(infoProduct.PurchaseRate, PublicVariables._inNoOfDecimalPlaces);
                        dgvProduct.Rows[inI].Cells["dgvtxtUnitConversionId"].Value = Convert.ToDecimal(new UnitConvertionBll().UnitconversionIdViewByUnitIdAndProductId(infoProduct.UnitId, infoProduct.ProductId));
                        dgvProduct.CurrentRow.Cells["dgvtxtConversionRate"].Value = bllUnitConvertion.UnitConversionRateByUnitConversionId(Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvtxtUnitConversionId"].Value.ToString()));
                        BatchComboFill(decproductId, inI, dgvProduct.Rows[inI].Cells["dgvcmbBatch"].ColumnIndex);
                        dgvProduct.Rows[inI].Cells["dgvcmbBatch"].Value = BllBatch.BatchIdViewByProductId(decproductId);
                        RackComboFill(infoProduct.GodownId, inI, dgvProduct.Rows[inI].Cells["dgvCmbRack"].ColumnIndex);
                        dgvProduct.Rows[inI].Cells["dgvtxtBarcode"].Value = BllBatch.ProductBatchBarcodeViewByBatchId(Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvcmbBatch"].Value.ToString()));
                        list = bllUnitConvertion.DGVUnitConvertionRateByUnitId(infoProduct.UnitId, infoProduct.ProductName);
                        dgvProduct.Rows[inI].Cells["dgvtxtConversionRate"].Value = dtbl.Rows[0]["conversionRate"].ToString();
                        decCurrentConversionRate = Convert.ToDecimal(dgvProduct.CurrentRow.Cells["dgvtxtConversionRate"].Value.ToString());

                        NewAmountCalculation("dgvtxtQty", inI);
                        CalculateTotalAmount();
                    }

            }
            catch (Exception ex)
            {
                MessageBox.Show("MR6:new" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 10
0
 /// <summary>
 /// Function to fill the product details in dataGridView from productCreationPopup
 /// </summary>
 /// <param name="productcreation"></param>
 /// <param name="decproductId"></param>
 /// <param name="decCurrentRowIndex"></param>
 public void productDetailsFillFromProductCreation(frmProductCreation productcreation, decimal decproductId, decimal decCurrentRowIndex)
 {
     try
     {
         decimal decCurrentConversionRate = 0;
         DataTable dtbl = new DataTable();
         UnitConvertionSP SPUnitConversion = new UnitConvertionSP();
         BatchSP spBatch = new BatchSP();
         ProductInfo infoProductFill = new ProductInfo();
         ProductSP spproduct = new ProductSP();
         ProductInfo infoProduct = new ProductInfo();
         int inI = dgvPurchaseReturn.CurrentRow.Index;
         if (inI == dgvPurchaseReturn.Rows.Count - 1)
         {
             dgvPurchaseReturn.Rows.Add();
         }
         if (decproductId != 0)
         {
             infoProduct = spproduct.ProductView(decproductId);
             SerialNo();
             dgvPurchaseReturn.Rows[inI].Cells["dgvtxtproductCode"].Value = infoProduct.ProductCode;
             dgvPurchaseReturn.Rows[inI].Cells["dgvtxtproductId"].Value = decproductId.ToString();
             dgvPurchaseReturn.Rows[inI].Cells["dgvtxtproductName"].Value = infoProduct.ProductName;
             dgvPurchaseReturn.Rows[inI].Cells["dgvcmbGodown"].Value = infoProduct.GodownId;
             dgvPurchaseReturn.Rows[inI].Cells["dgvcmbRack"].Value = infoProduct.RackId;
             UnitComboFill(infoProduct.ProductId, dgvPurchaseReturn.CurrentRow.Index, dgvPurchaseReturn.CurrentRow.Cells["dgvcmbUnit"].ColumnIndex);
             dgvPurchaseReturn.Rows[inI].Cells["dgvcmbUnit"].Value = infoProduct.UnitId;
             dgvPurchaseReturn.Rows[inI].Cells["dgvtxtrate"].Value = Math.Round(infoProduct.PurchaseRate, PublicVariables._inNoOfDecimalPlaces);
             dgvPurchaseReturn.Rows[inI].Cells["dgvtxtUnitConversionId"].Value = Convert.ToDecimal(new UnitConvertionSP().UnitconversionIdViewByUnitIdAndProductId(infoProduct.UnitId, infoProduct.ProductId));
             dgvPurchaseReturn.CurrentRow.Cells["dgvtxtConversionRate"].Value = SPUnitConversion.UnitConversionRateByUnitConversionId(Convert.ToDecimal(dgvPurchaseReturn.Rows[inI].Cells["dgvtxtUnitConversionId"].Value.ToString()));
             BatchComboFill(decproductId, inI, dgvPurchaseReturn.Rows[inI].Cells["dgvcmbBatch"].ColumnIndex);
             dgvPurchaseReturn.Rows[inI].Cells["dgvcmbBatch"].Value = spBatch.BatchIdViewByProductId(decproductId);
             RackComboFill(infoProduct.GodownId, inI, dgvPurchaseReturn.Rows[inI].Cells["dgvcmbRack"].ColumnIndex);
             dgvPurchaseReturn.Rows[inI].Cells["dgvtxtqty"].Value = "0";
             dgvPurchaseReturn.Rows[inI].Cells["dgvtxtbarcode"].Value = spBatch.ProductBatchBarcodeViewByBatchId(Convert.ToDecimal(dgvPurchaseReturn.Rows[inI].Cells["dgvcmbBatch"].Value.ToString()));
             dtbl = SPUnitConversion.DGVUnitConvertionRateByUnitId(infoProduct.UnitId, infoProduct.ProductName);
             dgvPurchaseReturn.Rows[inI].Cells["dgvtxtConversionRate"].Value = dtbl.Rows[0]["conversionRate"].ToString();
             decCurrentConversionRate = Convert.ToDecimal(dgvPurchaseReturn.CurrentRow.Cells["dgvtxtConversionRate"].Value.ToString());
             AmountCalculation("dgvtxtqty", inI);
             dgvPurchaseReturn.Rows[inI].Cells["dgvtxtqty"].Selected = true;
             dgvPurchaseReturn.Rows[inI + 1].Selected = false;
         }
         dgvPurchaseReturn.Rows[inI].HeaderCell.Value = "X";
         dgvPurchaseReturn.Rows[inI].HeaderCell.Style.ForeColor = Color.Red;
     }
     catch (Exception ex)
     {
         MessageBox.Show("PR:24" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 11
0
        /// <summary>
        /// On ViewDetails button click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnViewDetails_Click(object sender, EventArgs e)
        {
            try
            {
                if (dgvProductRegister.SelectedRows.Count > 0)
                {
                    frmProductCreation objfrmProductCreation;
                    decimal decRegister=Convert.ToDecimal(dgvProductRegister.CurrentRow.Cells["dgvtxtproductId"].Value.ToString());

                    objfrmProductCreation = Application.OpenForms["frmProductCreation"] as frmProductCreation;
                    if (objfrmProductCreation == null)
                    {
                        objfrmProductCreation = new frmProductCreation();
                        objfrmProductCreation.MdiParent = formMDI.MDIObj;
                        objfrmProductCreation.CallFromProductRegister(decRegister, this);
                    }
                    else
                    {
                        objfrmProductCreation.CallFromProductRegister(decRegister, this);
                    }
                    inCurrenRowIndex = dgvProductRegister.CurrentRow.Index;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("PR14:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 /// <summary>
 /// Function to do when calling from productcreation form
 /// </summary>
 /// <param name="frmProduct"></param>
 /// <param name="strProductName"></param>
 /// <param name="decUnitId"></param>
 /// <param name="strUnit"></param>
 /// <param name="dtblUnitConvertion"></param>
 public void CallFromProdutCreationAgain(frmProductCreation frmProduct, string strProductName, decimal decUnitId, string strUnit, DataTable dtblUnitConvertion)
 {
     try
     {
         decUnitIdExcludeToFillCombo = decUnitId;
         UnitComboFill(decUnitId);
         frmProductCreationObj = frmProduct;
         txtProductName.Text = strProductName;
         strUnitName = strUnit;
         base.Show();
         for (int inI = 0; inI < dtblUnitConvertion.Rows.Count; inI++)
         {
             if (dtblUnitConvertion.Rows[inI]["dgvtxtUnitId"].ToString() != "1")
             {
                 dgvMultipleUnit.Rows.Add();
                 string strQuantity = Convert.ToString(dtblUnitConvertion.Rows[inI]["quantities"]);
                 string[] srtarQuantity = strQuantity.Split('-');
                 string strQuantityOne = srtarQuantity[0];
                 string strQuantityTwo = srtarQuantity[1];
                 dgvMultipleUnit.Rows[inI].Cells["dgvtxtqtymultipleunit"].Value = strQuantityOne;
                 dgvMultipleUnit.Rows[inI].Cells["dgvtxtqty"].Value = strQuantityTwo;
                 dgvMultipleUnit.Rows[inI].Cells["dgvcmbmultipleunit"].Value = dtblUnitConvertion.Rows[inI]["dgvtxtUnitId"];
                 dgvMultipleUnit.Rows[inI].Cells["dgvtxtunit"].Value = strUnit.ToString();
                 dgvMultipleUnit.Rows[inI].Cells["dgvtxtunitname"].Value = dtblUnitConvertion.Rows[inI]["unitName"];
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PMU:6" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 13
0
 /// <summary>
 /// Function to call this form from frmProductCreation to view details and for updation 
 /// </summary>
 /// <param name="frmProduct"></param>
 /// <param name="strProductName"></param>
 /// <param name="decProductId"></param>
 public void CallFromProdutCreation(frmProductCreation frmProduct, string strProductName, decimal decProductId)
 {
     try
     {
         decProductIdForEdit = decProductId;
         isCallFromProductCreation = true;
         frmProductCreationObj = frmProduct;
         txtProduct.Text = strProductName;
         base.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show("PB:17" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 14
0
        /// <summary>
        /// Function to load the form while calling from the frmProductCreation to add the rack
        /// </summary>
        /// <param name="frmProduct"></param>
        /// <param name="decGowdownId"></param>
        public void CallFromProdutCreationForRackCreation(frmProductCreation frmProduct, decimal decGowdownId)
        {
            try
            {
                this.frmProductCreationObj = frmProduct;

                base.Show();
                groupBox2.Enabled = false;
                cmbGodown.SelectedValue = decGowdownId;
                cmbGodown.Enabled = false;

            }
            catch (Exception ex)
            {
                MessageBox.Show("R:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 15
0
 /// <summary>
 /// Form keydown for Quick access
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmSalesOrder_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Escape)
         {
             if (PublicVariables.isMessageClose)
             {
                 Messages.CloseMessage(this);
             }
             else
             {
                 this.Close();
             }
         }
         //.........................................CTRL+S............................//
         if (e.KeyCode == Keys.S && Control.ModifierKeys == Keys.Control)//save or edit 
         {
             cmbCashOrParty.Focus();
             if (cmbCashOrParty.Focused)
             {
                 cmbCashOrParty.DropDownStyle = ComboBoxStyle.DropDown;
             }
             else
             {
                 cmbCashOrParty.DropDownStyle = ComboBoxStyle.DropDownList;
             }
             btnSave_Click(sender, e);
         }
         //.........................................CTRL+D............................//
         if (e.KeyCode == Keys.D && Control.ModifierKeys == Keys.Control)//Delete 
         {
             if (btnDelete.Enabled)
             {
                 if (cmbCashOrParty.Focused)
                 {
                     cmbCashOrParty.DropDownStyle = ComboBoxStyle.DropDown;
                 }
                 else
                 {
                     cmbCashOrParty.DropDownStyle = ComboBoxStyle.DropDownList;
                 }
                 btnDelete_Click(sender, e);
             }
         }
         if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) //Product Creation
         {
             if (dgvSalesOrder.CurrentCell != null)
             {
                 if (dgvSalesOrder.CurrentCell == dgvSalesOrder.CurrentRow.Cells["dgvtxtProductName"] || dgvSalesOrder.CurrentCell == dgvSalesOrder.CurrentRow.Cells["dgvtxtProductCode"])
                 {
                     SendKeys.Send("{F10}");
                     if (dgvSalesOrder.Columns[dgvSalesOrder.CurrentCell.ColumnIndex].Name == "dgvtxtProductName" || dgvSalesOrder.Columns[dgvSalesOrder.CurrentCell.ColumnIndex].Name == "dgvtxtProductCode")
                     {
                         frmProductCreation frmProductCreationObj = new frmProductCreation();
                         frmProductCreationObj.MdiParent = formMDI.MDIObj;
                         frmProductCreationObj.CallFromSalesOrder(this);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SO86:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 16
0
 /// <summary>
 /// Call from frmProduct For Updation
 /// </summary>
 /// <param name="frmProduct"></param>
 /// <param name="strProductName"></param>
 /// <param name="ProductId"></param>
 /// <param name="dtblBom"></param>
 public void CallFromProdutCreationForUpadte(frmProductCreation frmProduct, string strProductName, decimal ProductId, DataTable dtblBom)
 {
     try
     {
         decProductIdForEdit = ProductId;
         isCallFromProductCreation = true;
         base.Show();
         frmProductCreationObj = frmProduct;
         txtProduct.Text = strProductName;
         txtProduct.Text = strProductName;
         btnSave.Text = "Update";
         btnDelete.Enabled = true;
         GridFillForUpdate(dtblBom);
     }
     catch (Exception ex)
     {
         MessageBox.Show("PB:9" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 17
0
        /// <summary>
        /// Function to fill product Details while return from Product creation when creating new Product 
        /// </summary>
        /// <param name="decProductId"></param>
        public void ReturnFromProductCreation(decimal decProductId)
        {
            frmProductCreation productcreation = new frmProductCreation();
            ProductInfo infoProduct = new ProductInfo();
            ProductSP spProduct = new ProductSP();
            try
            {
                int inI = dgvSalesReturn.CurrentRow.Index;
                this.Enabled = true;

                if (decProductId != 0)
                {

                    infoProduct = spProduct.ProductView(decProductId);
                    strProductCode = infoProduct.ProductCode;
                    ProductDetailsFill(strProductCode, inI, "dgvTextProductCode");
                }
                dgvSalesReturn.Focus();

            }
            catch (Exception ex)
            {
                MessageBox.Show("SR8:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 18
0
 /// <summary>
 /// Form key down For quick access
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmSalesInvoice_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Escape)
         {
             btnClose_Click(sender, e);
         }
         if (e.KeyCode == Keys.S && Control.ModifierKeys == Keys.Control)
         {
             btnSave_Click(sender, e);
         }
         if (e.KeyCode == Keys.D && Control.ModifierKeys == Keys.Control)
         {
             if (btnDelete.Enabled)
             {
                 btnDelete_Click(sender, e);
             }
         }
         if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt)
         {
             if (dgvSalesInvoice.CurrentCell != null)
             {
                 if (dgvSalesInvoice.CurrentCell == dgvSalesInvoice.CurrentRow.Cells["dgvtxtSalesInvoiceProductName"] || dgvSalesInvoice.CurrentCell == dgvSalesInvoice.CurrentRow.Cells["dgvtxtSalesInvoiceProductCode"])
                 {
                     SendKeys.Send("{F10}");
                     if (dgvSalesInvoice.Columns[dgvSalesInvoice.CurrentCell.ColumnIndex].Name == "dgvtxtSalesInvoiceProductName" || dgvSalesInvoice.Columns[dgvSalesInvoice.CurrentCell.ColumnIndex].Name == "dgvtxtSalesInvoiceProductCode")
                     {
                         frmProductCreation frmProductCreationObj = new frmProductCreation();
                         frmProductCreationObj.MdiParent = formMDI.MDIObj;
                         frmProductCreationObj.CallFromDSalesInvoice(this);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SI: 132" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// For Enter Key Navigation
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvProduct_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         int indgvProductRowCount = dgvProduct.Rows.Count;
         if (e.KeyCode == Keys.Enter)
         {
             if (dgvProduct.CurrentCell == dgvProduct.Rows[indgvProductRowCount - 1].Cells["dgvtxtAmount"])
             {
                 txtTraspotationCompany.Focus();
                 txtTraspotationCompany.SelectionStart = 0;
                 dgvProduct.ClearSelection();
             }
         }
         if (e.KeyCode == Keys.Back)
         {
             if (dgvProduct.CurrentCell == dgvProduct.Rows[0].Cells["Col"])
             {
                 if (cmbSalesMan.Enabled)
                 {
                     cmbSalesMan.Focus();
                 }
                 else if (cmbCurrency.Enabled)
                 {
                     cmbCurrency.Focus();
                 }
             }
         }
         if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt)
         {
             if (dgvProduct.CurrentCell != null)
             {
                 if (dgvProduct.CurrentCell == dgvProduct.CurrentRow.Cells["dgvtxtProductName"] || dgvProduct.CurrentCell == dgvProduct.CurrentRow.Cells["dgvtxtProductCode"])
                 {
                     SendKeys.Send("{F10}");
                     if (dgvProduct.Columns[dgvProduct.CurrentCell.ColumnIndex].Name == "dgvtxtProductName" || dgvProduct.Columns[dgvProduct.CurrentCell.ColumnIndex].Name == "dgvtxtProductCode")
                     {
                         frmProductCreation frmProductCreationObj = new frmProductCreation();
                         frmProductCreationObj.MdiParent = formMDI.MDIObj;
                         frmProductCreationObj.CallFromDeliveryNote(this);
                     }
                 }
             }
         }
         if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Product Search Pop Up
         {
             if (dgvProduct.Columns[dgvProduct.CurrentCell.ColumnIndex].Name == "dgvtxtProductName" || dgvProduct.Columns[dgvProduct.CurrentCell.ColumnIndex].Name == "dgvtxtProductCode")
             {
                 frmProductSearchPopup frmProductSearchPopupObj = new frmProductSearchPopup();
                 frmProductSearchPopupObj.MdiParent = formMDI.MDIObj;
                 if (dgvProduct.CurrentRow.Cells["dgvtxtProductCode"].Value != null || dgvProduct.CurrentRow.Cells["dgvtxtProductName"].Value != null)
                 {
                     frmProductSearchPopupObj.CallFromDeliveryNote(this, dgvProduct.CurrentRow.Index, dgvProduct.CurrentRow.Cells["dgvtxtProductCode"].Value.ToString());
                 }
                 else
                 {
                     frmProductSearchPopupObj.CallFromDeliveryNote(this, dgvProduct.CurrentRow.Index, string.Empty);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("DN:90" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 20
0
        /// <summary>
        /// Function to load this form when calling from frmProductCreation to add new productgroup
        /// </summary>
        /// <param name="frmProduct"></param>
        public void CallFromProdutCreation(frmProductCreation frmProduct)
        {
            try
            {
                this.frmProductCreationObj = frmProduct;
                groupBox2.Enabled = false;
                base.Show();


            }
            catch (Exception ex)
            {
                MessageBox.Show("PG12:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 /// <summary>
 /// Call from productcreation 
 /// </summary>
 /// <param name="frmProduct"></param>
 /// <param name="strProductName"></param>
 /// <param name="ProductId"></param>
 /// <param name="dtblMulUnit"></param>
 /// <param name="strUnit"></param>
 /// <param name="decUnitIdForCombo"></param>
 public void CallFromProdutCreationForUpadte(frmProductCreation frmProduct, string strProductName, decimal ProductId, DataTable dtblMulUnit, string strUnit, decimal decUnitIdForCombo)
 {
     try
     {
         base.Show();
         decUnitIdExcludeToFillCombo = decUnitIdForCombo;
         frmProductCreationObj = frmProduct;
         txtProductName.Text = strProductName;
         decProductIdForEdit = ProductId;
         strUnitNameForUpdate = strUnit;
         btnSave.Text = "Update";
         btnDelete.Enabled = true;
         isCheckVariable = true;
         GridFillForUpdate(dtblMulUnit);
         UnitComboFill(decUnitIdForCombo);
     }
     catch (Exception ex)
     {
         MessageBox.Show("PMU:7" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 22
0
        /// <summary>
        /// On doubleclicking the grid, it dispalys productcreation form and fill the correspnding product details to edit or delete
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvProductRegister_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
             try
            {
                if (e.RowIndex != -1 && e.ColumnIndex > -1)
                {
                if (dgvProductRegister.CurrentRow != null)
                {
                    if (dgvProductRegister.Rows.Count > 0 )
                    {
                        if (dgvProductRegister.CurrentRow.Cells["dgvtxtproductId"].Value != null)
                        {
                            if (dgvProductRegister.CurrentRow.Cells["dgvtxtproductId"].Value.ToString() != "")
                            {
                                frmProductCreation objfrmProductCreation;
                                decimal decRegister = Convert.ToDecimal(dgvProductRegister.Rows[e.RowIndex].Cells["dgvtxtproductId"].Value);

                                
                                    if (dgvProductRegister.CurrentRow.Index == e.RowIndex)
                                   {
                                        objfrmProductCreation = Application.OpenForms["frmProductCreation"] as frmProductCreation;
                                        if (objfrmProductCreation == null)
                                        {
                                            objfrmProductCreation = new frmProductCreation();
                                            objfrmProductCreation.MdiParent = formMDI.MDIObj;
                                            objfrmProductCreation.CallFromProductRegister(decRegister, this);
                                            GridFill();
                                        }
                                        else
                                        {
                                            objfrmProductCreation.CallFromProductRegister(decRegister, this);
                                        }
                                        if (dgvProductRegister.CurrentRow != null)
                                        {
                                            inCurrenRowIndex = dgvProductRegister.CurrentRow.Index;
                                       }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("PR13:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 /// <summary>
 ///  For Enter key and Backspace navigation
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvPhysicalStock_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Enter)
         {
             if (dgvPhysicalStock.CurrentCell == dgvPhysicalStock.Rows[dgvPhysicalStock.Rows.Count - 1].Cells["dgvtxtAmount"])
             {
                 txtNarration.Focus();
                 txtNarration.SelectionStart = 0;
                 txtNarration.SelectionLength = 0;
                 dgvPhysicalStock.ClearSelection();
             }
         }
         if (e.KeyCode == Keys.Back)
         {
             if (dgvPhysicalStock.CurrentCell == dgvPhysicalStock.Rows[0].Cells["dgvtxtSlNo"])
             {
                 txtDate.Focus();
                 txtDate.SelectionStart = 0;
                 txtDate.SelectionLength = 0;
                 dgvPhysicalStock.ClearSelection();
             }
         }
         if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control)
         {
             if (dgvPhysicalStock.Columns[dgvPhysicalStock.CurrentCell.ColumnIndex].Name == "dgvtxtProductName" || dgvPhysicalStock.Columns[dgvPhysicalStock.CurrentCell.ColumnIndex].Name == "dgvtxtProductCode")
             {
                 frmProductSearchPopup frmProductSearchPopupObj = new frmProductSearchPopup();
                 frmProductSearchPopupObj.MdiParent = formMDI.MDIObj;
                 if (dgvPhysicalStock.CurrentRow.Cells["dgvtxtProductCode"].Value != null || dgvPhysicalStock.CurrentRow.Cells["dgvtxtProductName"].Value != null)
                 {
                     frmProductSearchPopupObj.CallFromPhysicalStock(this, dgvPhysicalStock.CurrentRow.Index, dgvPhysicalStock.CurrentRow.Cells["dgvSitxtProductCode"].Value.ToString());
                 }
                 else
                 {
                     frmProductSearchPopupObj.CallFromPhysicalStock(this, dgvPhysicalStock.CurrentRow.Index, string.Empty);
                 }
             }
         }
         if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt)
         {
             if (dgvPhysicalStock.CurrentCell != null)
             {
                 if (dgvPhysicalStock.CurrentCell == dgvPhysicalStock.CurrentRow.Cells["dgvtxtProductName"] || dgvPhysicalStock.CurrentCell == dgvPhysicalStock.CurrentRow.Cells["dgvtxtProductCode"])
                 {
                     SendKeys.Send("{F10}");
                     if (dgvPhysicalStock.Columns[dgvPhysicalStock.CurrentCell.ColumnIndex].Name == "dgvtxtProductName" || dgvPhysicalStock.Columns[dgvPhysicalStock.CurrentCell.ColumnIndex].Name == "dgvtxtProductCode")
                     {
                         frmProductCreation frmProductCreationObj = new frmProductCreation();
                         frmProductCreationObj.MdiParent = formMDI.MDIObj;
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PS:54" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 24
0
        /// <summary>
        /// Esc for escape
        /// ctrl+s for save
        /// ctrl+d for delete
        /// /// alt+c for product creation
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmStockJournal_KeyDown(object sender, KeyEventArgs e)
        {

            try
            {
                if (e.KeyCode == Keys.Escape)
                {
                    btnClose_Click(sender, e);
                }
                if (e.KeyCode == Keys.S && Control.ModifierKeys == Keys.Control) //Save
                {
                    btnSave.Focus();
                    btnSave_Click(sender, e);
                }
                if (e.KeyCode == Keys.D && Control.ModifierKeys == Keys.Control) //Delete
                {
                    if (btnDelete.Enabled)
                    {
                        btnDelete_Click(sender, e);
                    }
                }
                if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt)     //Product Creation
                {
                    if (IsdgvConsuption)
                    {
                        if (dgvConsumption.CurrentCell != null)
                        {
                            if (dgvConsumption.CurrentCell == dgvConsumption.CurrentRow.Cells["dgvtxtConsumptionProductName"] || dgvConsumption.CurrentCell == dgvConsumption.CurrentRow.Cells["dgvtxtConsumptionProductCode"])
                            {

                                SendKeys.Send("{F10}");
                                if (dgvConsumption.Columns[dgvConsumption.CurrentCell.ColumnIndex].Name == "dgvtxtConsumptionProductName" || dgvConsumption.Columns[dgvConsumption.CurrentCell.ColumnIndex].Name == "dgvtxtConsumptionProductCode")
                                {
                                    frmProductCreation frmProductCreationObj = new frmProductCreation();
                                    frmProductCreationObj.MdiParent = formMDI.MDIObj;
                                    frmProductCreationObj.CallFromStockJournal(this);

                                }
                            }
                        }
                    }
                    else
                    {

                        if (dgvProduction.CurrentCell != null)
                        {
                            if (dgvProduction.CurrentCell == dgvProduction.CurrentRow.Cells["dgvtxtProductionProductName"] || dgvProduction.CurrentCell == dgvProduction.CurrentRow.Cells["dgvtxtProductionProductCode"])
                            {

                                SendKeys.Send("{F10}");
                                if (dgvProduction.Columns[dgvProduction.CurrentCell.ColumnIndex].Name == "dgvtxtProductionProductName" || dgvProduction.Columns[dgvProduction.CurrentCell.ColumnIndex].Name == "dgvtxtProductionProductCode")
                                {
                                    frmProductCreation frmProductCreationObj = new frmProductCreation();
                                    frmProductCreationObj.MdiParent = formMDI.MDIObj;
                                    frmProductCreationObj.CallFromStockJournal(this);

                                }
                            }
                        }
                    }

                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("SJ:79" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

        }
Exemplo n.º 25
0
 /// <summary>
 /// For enter key and backspace navigation
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void cmbItem_KeyDown(object sender, KeyEventArgs e)
 {
     string strProductName;
     try
     {
         SettingsBll BllSettings = new SettingsBll();
         if (e.KeyCode == Keys.Enter)
         {
             if (BllSettings.SettingsStatusCheck("AllowGodown") == "Yes")
             {
                 cmbGodown.Focus();
                 cmbGodown.SelectionStart = 0;
             }
             else if (BllSettings.SettingsStatusCheck("AllowBatch") == "Yes")
             {
                 cmbBatch.Focus();
             }
             else
             {
                 txtQuantity.Focus();
                 txtQuantity.Select();
             }
         }
         else if (e.KeyCode == Keys.Back)
         {
             if (txtProductCode.Visible)
             {
                 if (txtProductCode.Text.Trim() != string.Empty || txtProductCode.SelectionLength == 0)
                 {
                     txtProductCode.SelectionStart = 0;
                     txtProductCode.Focus();
                 }
             }
             else
             {
                 txtBarcode.Focus();
                 txtBarcode.Select();
             }
         }
         else if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up
         {
             if (cmbItem.Focused)
             {
                 cmbItem.DropDownStyle = ComboBoxStyle.DropDown;
             }
             else
             {
                 cmbItem.DropDownStyle = ComboBoxStyle.DropDownList;
             }
             if (cmbItem.SelectedIndex != -1)
             {
                 frmProductSearchPopup frmProductSearchPopupObj = new frmProductSearchPopup();
                 frmProductSearchPopupObj.MdiParent = formMDI.MDIObj;
                 frmProductSearchPopupObj.CallFromPOS(this, cmbItem.SelectedIndex, txtProductCode.Text);
             }
             else
             {
                 frmProductSearchPopup frmProductSearchPopupObj = new frmProductSearchPopup();
                 frmProductSearchPopupObj.MdiParent = formMDI.MDIObj;
                 frmProductSearchPopupObj.CallFromPOS(this, cmbItem.SelectedIndex, string.Empty);
             }
         }
         else if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) //Creation
         {
             frmProductCreation frmProductCreationObj = new frmProductCreation();
             bool isFromItemCombo = true;
             if (CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmProductCreation", "Save"))
             {
                 if (cmbItem.SelectedValue != null)
                 {
                     strProductName = cmbItem.SelectedValue.ToString();
                 }
                 else
                 {
                     strProductName = string.Empty;
                 }
                 frmProductCreationObj.MdiParent = formMDI.MDIObj;
                 frmProductCreationObj.CallFromPOSForProductCreation(this, isFromItemCombo);
             }
             else
             {
                 MessageBox.Show("You don’t have privilege", "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("POS: 116" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 26
0
 /// <summary>
 /// For shortcut keys
 /// Esc for close
 /// Ctrl+s for save
 /// Ctrl+D for delete
 /// Alt+c for productcreation
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmPurchaseReturn_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Escape)
         {
             if (PublicVariables.isMessageClose)
             {
                 Messages.CloseMessage(this);
             }
             else
             {
                 btnClose_Click(sender, e);
             }
         }
         else if (e.KeyCode == Keys.S && Control.ModifierKeys == Keys.Control)
         {
             cmbCashOrParty.DropDownStyle = (cmbCashOrParty.Focused) ? ComboBoxStyle.DropDown : ComboBoxStyle.DropDownList;
             btnSave.Focus();
             btnSave_Click(sender, e);
         }
         else if (e.KeyCode == Keys.D && Control.ModifierKeys == Keys.Control)
         {
             if (btnDelete.Enabled)
             {
                 btnDelete_Click(sender, e);
             }
         }
         else if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt)
         {
             if (dgvPurchaseReturn.CurrentCell != null)
             {
                 if (dgvPurchaseReturn.CurrentCell == dgvPurchaseReturn.CurrentRow.Cells["dgvtxtproductName"] || dgvPurchaseReturn.CurrentCell == dgvPurchaseReturn.CurrentRow.Cells["dgvtxtproductCode"])
                 {
                     if (cmbInvoiceNo.Visible == false)
                     {
                         SendKeys.Send("{F10}");
                         frmProductCreation frmProductCreationObj = new frmProductCreation();
                         frmProductCreationObj.MdiParent = formMDI.MDIObj;
                         frmProductCreationObj.CallFromPurcahseReturn(this);
                     }
                 }
             }
         }
         else if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control)
         {
             if (dgvPurchaseReturn.CurrentCell != null)
             {
                 if (dgvPurchaseReturn.Columns[dgvPurchaseReturn.CurrentCell.ColumnIndex].Name == "dgvtxtproductName" || dgvPurchaseReturn.Columns[dgvPurchaseReturn.CurrentCell.ColumnIndex].Name == "dgvtxtproductCode")
                 {
                     if (cmbInvoiceNo.Visible == false)
                     {
                         SendKeys.Send("{F10}");
                         frmProductSearchPopup frmProductSearchPopupObj = new frmProductSearchPopup();
                         frmProductSearchPopupObj.MdiParent = formMDI.MDIObj;
                         if (dgvPurchaseReturn.CurrentRow.Cells["dgvtxtproductName"].Value != null || dgvPurchaseReturn.CurrentRow.Cells["dgvtxtproductCode"].Value != null)
                         {
                             frmProductSearchPopupObj.CallFromPurchaseReturn(this, dgvPurchaseReturn.CurrentRow.Index, dgvPurchaseReturn.CurrentRow.Cells["dgvtxtproductCode"].Value.ToString());
                         }
                         else
                         {
                             frmProductSearchPopupObj.CallFromPurchaseReturn(this, dgvPurchaseReturn.CurrentRow.Index, string.Empty);
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PR:102" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 27
0
 /// <summary>
 /// Enterkey and backspace navigation of dgvProductDetails
 /// ctrl+f for productsearch popup
 /// alt+c for productcreation
 /// Esc for form close
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvProductDetails_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         int inRowCount = dgvProductDetails.Rows.Count;
         if (e.KeyCode == Keys.Enter)
         {
             if (dgvProductDetails.CurrentCell == dgvProductDetails.Rows[inRowCount - 1].Cells["dgvtxtAmount"])
             {
                 dgvAdditionalCost.Focus();
                 dgvProductDetails.ClearSelection();
             }
         }
         if (e.KeyCode == Keys.Back)
         {
             if (dgvProductDetails.CurrentCell == dgvProductDetails.Rows[0].Cells["dgvtxtSlNo"])
             {
                 cmbCurrency.Focus();
                 dgvProductDetails.ClearSelection();
             }
         }
         if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Product Search Pop Up
         {
             if (dgvProductDetails.Columns[dgvProductDetails.CurrentCell.ColumnIndex].Name == "dgvtxtProductName" || dgvProductDetails.Columns[dgvProductDetails.CurrentCell.ColumnIndex].Name == "dgvtxtProductCode")
             {
                 frmProductSearchPopup frmProductSearchPopupObj = new frmProductSearchPopup();
                 frmProductSearchPopupObj.MdiParent = formMDI.MDIObj;
                 if (dgvProductDetails.CurrentRow.Cells["dgvtxtProductCode"].Value != null || dgvProductDetails.CurrentRow.Cells["dgvtxtProductName"].Value != null)
                 {
                     frmProductSearchPopupObj.CallFromPurchaseInvoice(this, dgvProductDetails.CurrentRow.Index, dgvProductDetails.CurrentRow.Cells["dgvtxtProductCode"].Value.ToString());
                 }
                 else
                 {
                     frmProductSearchPopupObj.CallFromPurchaseInvoice(this, dgvProductDetails.CurrentRow.Index, string.Empty);
                 }
             }
         }
         if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) //Product Creation
         {
             SendKeys.Send("{f10}");
             if (dgvProductDetails.Columns[dgvProductDetails.CurrentCell.ColumnIndex].Name == "dgvtxtProductName" || dgvProductDetails.Columns[dgvProductDetails.CurrentCell.ColumnIndex].Name == "dgvtxtProductCode")
             {
                 frmProductCreation frmProductCreationObj = new frmProductCreation();
                 frmProductCreationObj.MdiParent = formMDI.MDIObj;
                 frmProductCreationObj.CallFromPurchaseInvoice(this);
             }
         }
         if (e.KeyCode == Keys.Escape)
         {
             btnClose_Click(sender, e);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PI119:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }