本文整理汇总了C#中OpenMiracle.BLL.SettingsBll类的典型用法代码示例。如果您正苦于以下问题:C# SettingsBll类的具体用法?C# SettingsBll怎么用?C# SettingsBll使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SettingsBll类属于OpenMiracle.BLL命名空间,在下文中一共展示了SettingsBll类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AutomaticProductCode
/// <summary>
/// Function to check the status of AutomaticProductCode generation
/// </summary>
/// <returns></returns>
public bool AutomaticProductCode()
{
bool isAuto = false;
try
{
SettingsBll BllSettings = new SettingsBll();
isAuto = BllSettings.AutomaticProductCodeGeneration();
}
catch (Exception ex)
{
MessageBox.Show("MPC16:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
return isAuto;
}
示例2: AmountWords
/// <summary>
/// Function to return amount in words
/// </summary>
/// <param name="decAmount"></param>
/// <param name="decCurrId"></param>
/// <returns></returns>
public string AmountWords(decimal decAmount, decimal decCurrId)
{
string AountInWords = string.Empty; // To return the amount in words
CurrencyInfo currencyInfo = new CurrencyBll().CurrencyView(decCurrId);
decAmount = Math.Round(decAmount, currencyInfo.NoOfDecimalPlaces); //Rounding according to decimal places of currency
string strAmount = decAmount.ToString(); // Just keeping the whole amount as string for performing split operation on it
string strAmountinwordsOfIntiger = string.Empty; // To hold amount in words of intiger
string strAmountInWordsOfDecimal = string.Empty; // To hold amoutn in words of decimal part
string[] strPartsArray = strAmount.Split('.'); // Splitting with "." to get intiger part and decimal part seperately
string strDecimaPart = string.Empty; // To hold decimal part
if (strPartsArray.Length > 1)
if (strPartsArray[1] != null)
strDecimaPart = strPartsArray[1]; // Holding decimal portion if any
if (strPartsArray[0] != null)
strAmount = strPartsArray[0]; // Holding intiger part of amount
else
strAmount = string.Empty; ;
if (strAmount.Trim() != string.Empty && decimal.Parse(strAmount) != 0)
strAmountinwordsOfIntiger = NumberToText(long.Parse(strAmount));
if (strDecimaPart.Trim() != string.Empty && decimal.Parse(strDecimaPart) != 0)
strAmountInWordsOfDecimal = NumberToText(long.Parse(strDecimaPart));
SettingsBll BllSetting = new SettingsBll();
if (BllSetting.SettingsStatusCheck("ShowCurrencySymbol") != "Yes")
{
// Showing currency as suffix
if (strAmountinwordsOfIntiger != string.Empty)
AountInWords = strAmountinwordsOfIntiger + " " + currencyInfo.CurrencyName;
if (strAmountInWordsOfDecimal != string.Empty)
AountInWords = AountInWords + " and " + strAmountInWordsOfDecimal + " " + currencyInfo.SubunitName;
AountInWords = AountInWords + " only";
}
else
{
// Showing currency as prefix
if (strAmountinwordsOfIntiger != string.Empty)
AountInWords = currencyInfo.CurrencyName + " " + strAmountinwordsOfIntiger;
if (strAmountInWordsOfDecimal != string.Empty)
AountInWords = AountInWords + " and " + currencyInfo.SubunitName + " " + strAmountInWordsOfDecimal;
AountInWords = AountInWords + " only";
}
return AountInWords;
}
示例3: dtpVoucherDate_ValueChanged
/// <summary>
/// On value change of dtpVoucherDate
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void dtpVoucherDate_ValueChanged(object sender, EventArgs e)
{
try
{
SettingsBll BllSettings = new SettingsBll();
DateTime date = this.dtpVoucherDate.Value;
txtVoucherDate.Text = date.ToString("dd-MMM-yyyy");
txtVoucherDate.Focus();
CurrencyComboFill();
if (BllSettings.SettingsStatusCheck("MultiCurrency") == "Yes")
{
cmbCurrency.Enabled = true;
}
else
{
cmbCurrency.Enabled = false;
}
}
catch (Exception ex)
{
MessageBox.Show("SV 53 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
示例4: CurrencyComboFill
/// <summary>
/// CurrencyComboFill
/// </summary>
public void CurrencyComboFill()
{
bool IsTrue = false;
TransactionsGeneralFillBll TransactionGenerateFillObj = new TransactionsGeneralFillBll();
try
{
IsTrue = true;
List<DataTable> listObj = new List<DataTable>();
CurrencyBll BllCurrency = new CurrencyBll();
SettingsBll BllSettings = new SettingsBll();
listObj = TransactionGenerateFillObj.CurrencyComboByDate(dtpDate.Value);
cmbCurrency.DataSource = listObj[0];
cmbCurrency.DisplayMember = "currencyName";
cmbCurrency.ValueMember = "exchangeRateId";
cmbCurrency.SelectedValue = 1m;
if (BllSettings.SettingsStatusCheck("MultiCurrency") == "Yes")
{
cmbCurrency.Enabled = true;
}
else
{
cmbCurrency.Enabled = false;
}
IsTrue = false;
}
catch (Exception ex)
{
MessageBox.Show("DN32:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
示例5: frmDeliveryNote_Load
/// <summary>
/// When Form Loads
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void frmDeliveryNote_Load(object sender, EventArgs e)
{
try
{
Clear();
PrintCheck();
FillProducts(false, null);
SettingsBll BllSettings = new SettingsBll();
if (BllSettings.SettingsStatusCheck("ShowProductCode") == "Yes")
{
dgvProduct.Columns["dgvtxtProductCode"].Visible = true;
}
else
{
dgvProduct.Columns["dgvtxtProductCode"].Visible = false;
}
if (BllSettings.SettingsStatusCheck("barcode") == "Yes")
{
dgvProduct.Columns["dgvtxtBarcode"].Visible = true;
}
else
{
dgvProduct.Columns["dgvtxtBarcode"].Visible = false;
}
if (BllSettings.SettingsStatusCheck("ShowUnit") == "Yes")
{
dgvProduct.Columns["dgvcmbUnit"].Visible = true;
}
else
{
dgvProduct.Columns["dgvcmbUnit"].Visible = false;
}
if (BllSettings.SettingsStatusCheck("AllowGodown") == "Yes")
{
dgvProduct.Columns["dgvcmbGodown"].Visible = true;
dgvProduct.Columns["dgvcmbRack"].Visible = true;
}
else
{
dgvProduct.Columns["dgvcmbGodown"].Visible = false;
dgvProduct.Columns["dgvcmbRack"].Visible = false;
}
if (BllSettings.SettingsStatusCheck("AllowRack") == "Yes")
{
if (BllSettings.SettingsStatusCheck("AllowGodown") == "Yes")
dgvProduct.Columns["dgvcmbRack"].Visible = true;
else
dgvProduct.Columns["dgvcmbRack"].Visible = false;
}
else
{
dgvProduct.Columns["dgvcmbRack"].Visible = false;
}
if (BllSettings.SettingsStatusCheck("AllowBatch") == "Yes")
{
dgvProduct.Columns["dgvcmbBatch"].Visible = true;
}
else
{
dgvProduct.Columns["dgvcmbBatch"].Visible = false;
}
}
catch (Exception ex)
{
MessageBox.Show("DN51:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
示例6: SaveFunction
//.........这里部分代码省略.........
{
infoStockPosting.AgainstInvoiceNo = txtDeliveryNoteNo.Text;
}
else
{
infoStockPosting.AgainstInvoiceNo = string.Empty;
}
}
}
else
{
infoStockPosting.InvoiceNo = txtDeliveryNoteNo.Text;
infoStockPosting.VoucherNo = strVoucherNo;
infoStockPosting.VoucherTypeId = decDeliveryNoteVoucherTypeId;
infoStockPosting.AgainstVoucherTypeId = 0;
infoStockPosting.AgainstVoucherNo = "NA";
infoStockPosting.AgainstInvoiceNo = "NA";
}
infoStockPosting.ProductId = infoDeliveryNoteDetails.ProductId;
infoStockPosting.BatchId = infoDeliveryNoteDetails.BatchId;
infoStockPosting.UnitId = infoDeliveryNoteDetails.UnitId;
infoStockPosting.GodownId = infoDeliveryNoteDetails.GodownId;
infoStockPosting.RackId = infoDeliveryNoteDetails.RackId;
infoStockPosting.OutwardQty = infoDeliveryNoteDetails.Qty;
infoStockPosting.Rate = infoDeliveryNoteDetails.Rate;
infoStockPosting.FinancialYearId = PublicVariables._decCurrentFinancialYearId;
infoStockPosting.Extra1 = string.Empty;
infoStockPosting.Extra2 = string.Empty;
BllStockPosting.StockPostingAdd(infoStockPosting);
}
Messages.SavedMessage();
if (cbxPrint.Checked)
{
SettingsBll BllSettings = new SettingsBll();
if (BllSettings.SettingsStatusCheck("Printer") == "Dot Matrix")
{
PrintForDotMatrix(decDeliveryNoteMasterId);
}
else
{
Print(decDeliveryNoteMasterId);
}
}
}
if (btnSave.Text == "Update")
{
SettingsBll BllSettings = new SettingsBll();
infoDeliveryNoteMaster.DeliveryNoteMasterId = decDelivryNoteIdToEdit;
infoDeliveryNoteMaster.SuffixPrefixId = Convert.ToDecimal(decDeliveryNoteSuffixPrefixId);
infoDeliveryNoteMaster.VoucherNo = strVoucherNo;
infoDeliveryNoteMaster.UserId = PublicVariables._decCurrentUserId;//by default current userid used as current employeeid
infoDeliveryNoteMaster.PricinglevelId = Convert.ToDecimal(cmbPricingLevel.SelectedValue.ToString());
if (cmbSalesMan.SelectedIndex != -1)
{
infoDeliveryNoteMaster.EmployeeId = Convert.ToDecimal(cmbSalesMan.SelectedValue.ToString());
}
else
{
infoDeliveryNoteMaster.EmployeeId = 0;
}
infoDeliveryNoteMaster.FinancialYearId = PublicVariables._decCurrentFinancialYearId;
if (cmbOrderNo.SelectedValue != null)
{
if (cmbDeliveryMode.Text == "Against Order")
{
示例7: GridFill
/// <summary>
/// Function to fill Datagridview after calculation
/// </summary>
public void GridFill()
{
try
{
if (!isFormLoad)
{
string calculationMethod = string.Empty;
SettingsInfo InfoSettings = new SettingsInfo();
SettingsBll BllSettings = new SettingsBll();
//--------------- Selection Of Calculation Method According To Settings ------------------//
if (BllSettings.SettingsStatusCheck("StockValueCalculationMethod") == "FIFO")
{
calculationMethod = "FIFO";
}
else if (BllSettings.SettingsStatusCheck("StockValueCalculationMethod") == "Average Cost")
{
calculationMethod = "Average Cost";
}
else if (BllSettings.SettingsStatusCheck("StockValueCalculationMethod") == "High Cost")
{
calculationMethod = "High Cost";
}
else if (BllSettings.SettingsStatusCheck("StockValueCalculationMethod") == "Low Cost")
{
calculationMethod = "Low Cost";
}
else if (BllSettings.SettingsStatusCheck("StockValueCalculationMethod") == "Last Purchase Rate")
{
calculationMethod = "Last Purchase Rate";
}
FinancialStatementBll bllFinancialStatement = new FinancialStatementBll();
DataTable dtbl1 = new DataTable();
CurrencyInfo InfoCurrency = new CurrencyInfo();
CurrencyBll BllCurrency = new CurrencyBll();
int inDecimalPlaces = InfoCurrency.NoOfDecimalPlaces;
decimal dcClosingStock = bllFinancialStatement.StockValueGetOnDate(Convert.ToDateTime(txtTodate.Text), calculationMethod, false, false);
dcClosingStock = Math.Round(dcClosingStock, inDecimalPlaces);
//---------------------Opening Stock-----------------------
decimal dcOpeninggStock = bllFinancialStatement.StockValueGetOnDate(PublicVariables._dtFromDate, calculationMethod, true, true);
decimal dcProfit = 0;
DataSet dsetProfitAndLoss = new DataSet();
dsetProfitAndLoss = bllFinancialStatement.ProfitAndLossAnalysisUpToaDateForBalansheet(PublicVariables._dtFromDate, DateTime.Parse(txtTodate.Text));
DataTable dtblProfit = new DataTable();
dtblProfit = dsetProfitAndLoss.Tables[0];
for (int i = 0; i < dsetProfitAndLoss.Tables.Count; ++i)
{
dtbl1 = dsetProfitAndLoss.Tables[i];
decimal dcSum = 0;
if (i == 0 || (i % 2) == 0)
{
if (dtbl1.Rows.Count > 0)
{
dcSum = decimal.Parse(dtbl1.Compute("Sum(Debit)", string.Empty).ToString());
}
}
else
{
if (dtbl1.Rows.Count > 0)
{
dcSum = decimal.Parse(dtbl1.Compute("Sum(Credit)", string.Empty).ToString());
}
}
}
DateValidation objValidation = new DateValidation();
objValidation.DateValidationFunction(txtTodate);
if (txtTodate.Text == string.Empty)
txtTodate.Text = PublicVariables._dtToDate.ToString("dd-MMM-yyyy");
Font newFont = new Font(dgvTrailBalance.Font, FontStyle.Bold);
DataSet DsetTrailbalance = new DataSet();
DataTable dtbl = new DataTable();
decimal dcTotalCredit = 0;
decimal dcTotalDebit = 0;
DateValidation objvalidation = new DateValidation();
objvalidation.DateValidationFunction(txtFromDate);
if (txtFromDate.Text == string.Empty)
{
txtFromDate.Text = PublicVariables._dtFromDate.ToString("dd-MMM-yyyy");
}
objvalidation.DateValidationFunction(txtTodate);
if (txtTodate.Text == string.Empty)
{
txtTodate.Text = PublicVariables._dtToDate.ToString("dd-MMM-yyyy");
}
DataTable dtblTrail = new DataTable();
DataTable dtblTrail1 = new DataTable();
DataTable dtblProfitAndLossAcc = new DataTable();
DataTable dtblProfitAndLossAcc1 = new DataTable();
DataSet dsTrial = new DataSet();
Font newfont = new Font(dgvTrailBalance.Font, FontStyle.Bold);
dgvTrailBalance.Rows.Clear();
dsTrial = bllFinancialStatement.TrialBalance(DateTime.Parse(txtFromDate.Text), DateTime.Parse(txtTodate.Text), 0);
dtblTrail = dsTrial.Tables[0];
dtblProfitAndLossAcc = dsTrial.Tables[1];
if (dgvTrailBalance.RowCount > 0)
//.........这里部分代码省略.........
示例8: Clear
/// <summary>
/// These function is used to reset the form and clear its controlls
/// </summary>
public void Clear()
{
try
{
if (isAutomatic)
{
VoucherNumberGeneration();
txtContraVoucherDate.Focus();
}
else
{
txtVoucherNo.Text = string.Empty;
txtVoucherNo.ReadOnly = false;
}
BankOrCashComboFill(cmbBankAccount);
GridBankOrCashComboFill();
isEditMode = false;
dtpContraVoucherDate.MinDate = PublicVariables._dtFromDate;
dtpContraVoucherDate.MaxDate = PublicVariables._dtToDate;
CompanyInfo infoComapany = new CompanyInfo();
//CompanySP spCompany = new CompanySP();
CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
infoComapany = bllCompanyCreation.CompanyView(1);
DateTime dtVoucherDate = infoComapany.CurrentDate;
dtpContraVoucherDate.Value = dtVoucherDate;
txtContraVoucherDate.Text = dtVoucherDate.ToString("dd-MMM-yyyy");
dtpContraVoucherDate.Value = Convert.ToDateTime(txtContraVoucherDate.Text);
txtContraVoucherDate.Focus();
txtContraVoucherDate.SelectAll();
if (txtVoucherNo.ReadOnly)
{
txtContraVoucherDate.Focus();
}
else
{
txtVoucherNo.Focus();
}
cmbBankAccount.SelectedIndex = -1;
txtNarration.Text = string.Empty;
txtTotal.Text = string.Empty;
dgvContraVoucher.ClearSelection();
rbtnDeposit.Checked = true;
btnDelete.Enabled = false;
btnSave.Text = "Save";
dgvContraVoucher.Rows.Clear();
if (frmContraRegisterObj != null)
{
frmContraRegisterObj.Close();
}
if (frmContraReportObj != null)
{
frmContraReportObj.Close();
}
SettingsBll BllSettings = new SettingsBll();
if (BllSettings.SettingsStatusCheck("TickPrintAfterSave") == "Yes")
{
cbxPrintafterSave.Checked = true;
}
else
{
cbxPrintafterSave.Checked = false;
}
}
catch (Exception ex)
{
MessageBox.Show("CV:09" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
示例9: ClearFunctions
/// <summary>
/// Functions to clear the form controls based on the settings
/// </summary>
public void ClearFunctions()
{
try
{
CurrencyBll BllCurrency = new CurrencyBll();
SettingsBll BllSettings = new SettingsBll();
strCurrencySymbol = BllCurrency.CurrencyView(PublicVariables._decCurrencyId).CurrencySymbol;
if (BllSettings.SettingsStatusCheck("AllowGodown") == "Yes")
{
cmbGodown.Visible = true;
lblGodown.Visible = true;
}
else
{
cmbGodown.Visible = false;
lblGodown.Visible = false;
}
if (BllSettings.SettingsStatusCheck("AllowRack") == "Yes")
{
cmbRack.Visible = true;
lblRack.Visible = true;
}
else
{
cmbRack.Visible = false;
lblRack.Visible = false;
}
if (BllSettings.SettingsStatusCheck("AllowBatch") == "Yes")
{
cmbBatch.Visible = true;
lblBatch.Visible = true;
}
else
{
cmbBatch.Visible = false;
lblBatch.Visible = false;
}
if (BllSettings.SettingsStatusCheck("ShowProductCode") == "Yes")
{
lblProductcode.Visible = true;
txtProductCode.Visible = true;
dgvPointOfSales.Columns["dgvtxtProductCode"].Visible = true;
}
else
{
lblProductcode.Visible = false;
txtProductCode.Visible = false;
dgvPointOfSales.Columns["dgvtxtProductCode"].Visible = false;
}
if (BllSettings.SettingsStatusCheck("Barcode") == "Yes")
{
lblBarcode.Visible = true;
txtBarcode.Visible = true;
}
else
{
lblBarcode.Visible = false;
txtBarcode.Visible = false;
}
if (BllSettings.SettingsStatusCheck("ShowDiscountAmount") == "Yes")
{
txtDiscountAmount.Visible = true;
lblDiscountAmt.Visible = true;
dgvPointOfSales.Columns["dgvtxtDiscount"].Visible = true;
}
else
{
txtDiscountAmount.Visible = false;
lblDiscountAmt.Visible = false;
dgvPointOfSales.Columns["dgvtxtDiscount"].Visible = false;
}
if (BllSettings.SettingsStatusCheck("ShowDiscountPercentage") == "Yes")
{
txtDiscountPercentage.Visible = true;
lblDiscountPercentage.Visible = true;
}
else
{
txtDiscountPercentage.Visible = false;
lblDiscountPercentage.Visible = false;
}
if (BllSettings.SettingsStatusCheck("ShowUnit") == "Yes")
{
cmbUnit.Visible = true;
lblUnit.Visible = true;
dgvPointOfSales.Columns["dgvtxtUnit"].Visible = true;
}
else
{
cmbUnit.Visible = false;
lblUnit.Visible = false;
dgvPointOfSales.Columns["dgvtxtUnit"].Visible = false;
}
if (BllSettings.SettingsStatusCheck("Tax") == "Yes")
{
cmbTax.Visible = true;
lblTax.Visible = true;
//.........这里部分代码省略.........
示例10: Clear
/// <summary>
/// Clear function to reset the form
/// </summary>
public void Clear()
{
try
{
SettingsBll BllSettings = new SettingsBll();
cmbPricingLevel.SelectedIndex = 0;
cmbSalesAccount.SelectedIndex = 0;
cmbCashOrParty.SelectedIndex = 0;
cmbSalesMan.SelectedIndex = 0;
cmbCounter.SelectedIndex = 0;
txtBarcode.Clear();
txtProductCode.Clear();
cmbItem.SelectedIndex = -1;
txtQuantity.Text = "0";
txtRate.Text = "0";
txtDiscountAmount.Text = "0";
dgvPointOfSales.Rows.Clear();
txtNarration.Clear();
txtPaidAmount.Text = "0";
txtBalance.Text = "0";
txtTotalAmount.Text = "0";
txtBillDiscount.Text = "0";
txtGrandTotal.Text = "0";
lblTaxTotalAmount.Text = "00.00";
btnDelete.Enabled = false;
btnSave.Text = "Save";
btnClear.Text = "Clear";
if (!txtVoucherNo.ReadOnly)
{
txtVoucherNo.Clear();
txtVoucherNo.Focus();
}
else
{
if (BllSettings.SettingsStatusCheck("Barcode") == "Yes")
{
txtBarcode.Select();
}
else
{
txtProductCode.Select();
}
}
ClearGroupbox();
}
catch (Exception ex)
{
MessageBox.Show("POS : 03" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
示例11: txtQuantity_KeyDown
/// <summary>
/// For enter key and backspace navigation
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void txtQuantity_KeyDown(object sender, KeyEventArgs e)
{
string strtxt = txtQuantity.Text.Trim();
try
{
SettingsBll BllSettings = new SettingsBll();
if (e.KeyCode == Keys.Enter)
{
if (BllSettings.SettingsStatusCheck("ShowUnit") == "Yes")
{
cmbUnit.Focus();
}
else
{
txtRate.Focus();
txtRate.Select();
}
}
else if (e.KeyCode == Keys.Back)
{
if (txtQuantity.SelectionLength > 0)
{
txtQuantity.Text = strtxt.Trim();
txtQuantity.SelectionStart = 0;
txtQuantity.SelectionLength = 0;
if (BllSettings.SettingsStatusCheck("AllowBatch") == "Yes")
{
cmbBatch.Focus();
}
else if (BllSettings.SettingsStatusCheck("AllowGodown") == "Yes")
{
cmbRack.Focus();
}
else
{
cmbItem.Focus();
}
}
}
}
catch (Exception ex)
{
MessageBox.Show("POS: 101" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
示例12: cmbItem_KeyDown
/// <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);
}
}
示例13: cmbBatch_KeyDown
/// <summary>
/// For enter key and backspace navigation
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void cmbBatch_KeyDown(object sender, KeyEventArgs e)
{
try
{
SettingsBll BllSettings = new SettingsBll();
if (e.KeyCode == Keys.Enter)
{
txtQuantity.Focus();
}
else if (e.KeyCode == Keys.Back)
{
if (BllSettings.SettingsStatusCheck("AllowGodown") == "Yes")
{
cmbRack.Focus();
}
else
{
cmbItem.Focus();
cmbItem.Select();
}
}
}
catch (Exception ex)
{
MessageBox.Show("POS: 119" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
示例14: SaveFunction
//.........这里部分代码省略.........
else
{
InfoSalesMaster.SuffixPrefixId = 0;
InfoSalesMaster.VoucherNo = txtVoucherNo.Text;
}
InfoSalesMaster.ExtraDate = DateTime.Now;
InfoSalesMaster.Extra1 = string.Empty;
InfoSalesMaster.Extra2 = string.Empty;
decSalesMasterId = BllSalesInvoice.SalesMasterAdd(InfoSalesMaster);
int inRowCount = dgvPointOfSales.RowCount;
InfoSalesDetails.SalesMasterId = decSalesMasterId;
InfoSalesDetails.ExtraDate = DateTime.Now;
InfoSalesDetails.Extra1 = string.Empty;
InfoSalesDetails.Extra2 = string.Empty;
for (int inI = 0; inI < inRowCount; inI++)
{
if (dgvPointOfSales.Rows[inI].Cells["dgvtxtProductName"].Value != null && dgvPointOfSales.Rows[inI].Cells["dgvtxtProductName"].Value.ToString() != string.Empty)
{
if (dgvPointOfSales.Rows[inI].Cells["dgvtxtQuantity"].Value != null && dgvPointOfSales.Rows[inI].Cells["dgvtxtQuantity"].Value.ToString() != string.Empty)
{
InfoSalesDetails.SlNo = Convert.ToInt32(dgvPointOfSales.Rows[inI].Cells["dgvtxtSlNo"].Value.ToString());
InfoSalesDetails.ProductId = Convert.ToDecimal(dgvPointOfSales.Rows[inI].Cells["dgvtxtProductId"].Value.ToString());
InfoSalesDetails.Qty = Convert.ToDecimal(dgvPointOfSales.Rows[inI].Cells["dgvtxtQuantity"].Value.ToString());
InfoSalesDetails.Rate = Convert.ToDecimal(dgvPointOfSales.Rows[inI].Cells["dgvtxtRate"].Value.ToString());
InfoSalesDetails.UnitId = Convert.ToDecimal(dgvPointOfSales.Rows[inI].Cells["dgvtxtUnitId"].Value.ToString());
InfoSalesDetails.UnitConversionId = Convert.ToDecimal(dgvPointOfSales.Rows[inI].Cells["dgvtxtunitconversionId"].Value.ToString());
InfoSalesDetails.Discount = Convert.ToDecimal(dgvPointOfSales.Rows[inI].Cells["dgvtxtDiscount"].Value.ToString());
InfoSalesDetails.TaxId = Convert.ToDecimal(dgvPointOfSales.Rows[inI].Cells["dgvtxttaxid"].Value.ToString());
InfoSalesDetails.BatchId = Convert.ToDecimal(dgvPointOfSales.Rows[inI].Cells["dgvtxtBatchId"].Value.ToString());
InfoSalesDetails.GodownId = Convert.ToDecimal(dgvPointOfSales.Rows[inI].Cells["dgvtxtGodownId"].Value.ToString());
InfoSalesDetails.RackId = Convert.ToDecimal(dgvPointOfSales.Rows[inI].Cells["dgvtxtRackId"].Value.ToString());
InfoSalesDetails.TaxAmount = Convert.ToDecimal(dgvPointOfSales.Rows[inI].Cells["dgvtxtTaxAmount"].Value.ToString());
InfoSalesDetails.GrossAmount = Convert.ToDecimal(dgvPointOfSales.Rows[inI].Cells["dgvtxtGrossValue"].Value.ToString());
InfoSalesDetails.NetAmount = Convert.ToDecimal(dgvPointOfSales.Rows[inI].Cells["dgvtxtNetAmount"].Value.ToString());
InfoSalesDetails.Amount = Convert.ToDecimal(dgvPointOfSales.Rows[inI].Cells["dgvtxtTotalAmount"].Value.ToString());
BllSalesInvoice.SalesDetailsAdd(InfoSalesDetails);
infoStockPosting.Date = InfoSalesMaster.Date;
infoStockPosting.VoucherTypeId = DecPOSVoucherTypeId;
infoStockPosting.VoucherNo = strVoucherNo;
infoStockPosting.InvoiceNo = txtVoucherNo.Text.Trim();
infoStockPosting.AgainstVoucherTypeId = 0;
infoStockPosting.AgainstVoucherNo = "NA";
infoStockPosting.AgainstInvoiceNo = "NA";
infoStockPosting.ProductId = InfoSalesDetails.ProductId;
infoStockPosting.BatchId = InfoSalesDetails.BatchId;
infoStockPosting.UnitId = InfoSalesDetails.UnitId;
infoStockPosting.GodownId = InfoSalesDetails.GodownId;
infoStockPosting.RackId = InfoSalesDetails.RackId;
infoStockPosting.InwardQty = 0;
infoStockPosting.OutwardQty = InfoSalesDetails.Qty / bllUnitConversion.UnitConversionRateByUnitConversionId(InfoSalesDetails.UnitConversionId); ;
infoStockPosting.Rate = InfoSalesDetails.Rate;
infoStockPosting.FinancialYearId = InfoSalesMaster.FinancialYearId;
infoStockPosting.Extra1 = string.Empty;
infoStockPosting.Extra2 = string.Empty;
BllStockPosting.StockPostingAdd(infoStockPosting);
}
}
}
int inTaxRowCount = dgvPOSTax.RowCount;
InfoSalesBillTax.SalesMasterId = decSalesMasterId;
InfoSalesBillTax.ExtraDate = DateTime.Now;
InfoSalesBillTax.Extra1 = string.Empty;
InfoSalesBillTax.Extra2 = string.Empty;
for (int inI = 0; inI < inTaxRowCount; inI++)
{
if (dgvPOSTax.Rows[inI].Cells["dgvtxttax"].Value != null && dgvPOSTax.Rows[inI].Cells["dgvtxttax"].Value.ToString() != string.Empty)
{
if (dgvPOSTax.Rows[inI].Cells["dgvtxtTaxAmt"].Value != null && dgvPOSTax.Rows[inI].Cells["dgvtxtTaxAmt"].Value.ToString() != string.Empty)
{
InfoSalesBillTax.TaxId = Convert.ToInt32(dgvPOSTax.Rows[inI].Cells["dgvtxttax"].Value.ToString());
InfoSalesBillTax.TaxAmount = Convert.ToDecimal(dgvPOSTax.Rows[inI].Cells["dgvtxtTaxAmt"].Value.ToString());
BllSalesInvoice.SalesBillTaxAdd(InfoSalesBillTax);
}
}
}
ledgerPostingAdd();
if (BllSalesInvoice.SalesInvoiceInvoicePartyCheckEnableBillByBillOrNot(Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString())))
{
partyBalanceAdd();
}
Messages.SavedMessage();
if (cbxPrintAfterSave.Checked)
{
SettingsBll BllSettings = new SettingsBll();
if (BllSettings.SettingsStatusCheck("Printer") == "Dot Matrix")
{
PrintForDotMatrix(decSalesMasterId);
}
else
{
Print(decSalesMasterId);
}
}
ClearFunctions();
}
catch (Exception ex)
{
MessageBox.Show("POS:44" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
示例15: QuantityStatusCheck
/// <summary>
/// Function to Quantity Status Check
/// </summary>
public void QuantityStatusCheck()
{
try
{
decimal decProductId = 0;
decimal decBatchId = 0;
decimal decCalcQty = 0;
StockPostingBll BllStockPosting = new StockPostingBll();
SettingsBll BllSettings = new SettingsBll();
string strStatus = BllSettings.SettingsStatusCheck("NegativeStockStatus");
bool isNegativeLedger = false;
if (cmbItem.SelectedIndex != -1)
{
decProductId = Convert.ToDecimal(cmbItem.SelectedValue.ToString());
batchcombofill();
decBatchId = Convert.ToDecimal(cmbBatch.SelectedValue.ToString());
decimal decCurrentStock = BllStockPosting.StockCheckForProductSale(decProductId, decBatchId);
if (txtQuantity.Text != null || txtQuantity.Text != string.Empty)
{
decCalcQty = decCurrentStock - Convert.ToDecimal(txtQuantity.Text.Trim().ToString());
}
if (decCalcQty < 0)
{
isNegativeLedger = true;
}
}
if (isNegativeLedger)
{
if (strStatus == "Warn")
{
if (MessageBox.Show("Negative Stock balance exists,Do you want to Continue", "Open miracle", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
{
AddToGrid();
}
else
{
cmbItem.Focus();
}
}
else if (strStatus == "Block")
{
MessageBox.Show("Cannot continue ,due to negative stock balance", "Open miracle", MessageBoxButtons.OK, MessageBoxIcon.Stop);
cmbItem.Focus();
}
else
{
AddToGrid();
}
}
else
{
AddToGrid();
}
}
catch (Exception ex)
{
MessageBox.Show("POS :42 " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}