本文整理汇总了C#中Open_Miracle.SettingsSP.SettingsStatusCheck方法的典型用法代码示例。如果您正苦于以下问题:C# SettingsSP.SettingsStatusCheck方法的具体用法?C# SettingsSP.SettingsStatusCheck怎么用?C# SettingsSP.SettingsStatusCheck使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Open_Miracle.SettingsSP
的用法示例。
在下文中一共展示了SettingsSP.SettingsStatusCheck方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StockJournalPrinting
/// <summary>
/// Function to print StockJournal in curresponding Crystal report
/// </summary>
/// <param name="dsStockJournal"></param>
internal void StockJournalPrinting(DataSet dsStockJournal)
{
try
{
crptStockJournal crptStockJournalObj = new crptStockJournal();
foreach (DataTable dtbl in dsStockJournal.Tables)
{
if (dtbl.TableName == "Table")
{
crptStockJournalObj.Database.Tables["dtblCompany"].SetDataSource(dtbl);
}
else if (dtbl.TableName == "Table1")
{
crptStockJournalObj.Database.Tables["dtblStockJournalMaster"].SetDataSource(dtbl);
}
else if (dtbl.TableName == "Table2")
{
crptStockJournalObj.Database.Tables["dtblStockJournalDetailsConsumption"].SetDataSource(dtbl);
}
else if (dtbl.TableName == "Table3")
{
crptStockJournalObj.Database.Tables["dtblStockJournalDetailsProduction"].SetDataSource(dtbl);
}
}
this.crptViewer.ReportSource = crptStockJournalObj;
SettingsSP spSettings = new SettingsSP();
if (spSettings.SettingsStatusCheck("DirectPrint") == "No")
{
base.Show();
this.BringToFront();
}
else
{
crptStockJournalObj.PrintToPrinter(1, false, 0, 0);
}
}
catch (Exception)
{
throw;
}
}
示例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 CurrencySP().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));
SettingsSP spSettings = new SettingsSP();
if (spSettings.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: UnitComboFill
/// <summary>
/// Function to fill Unit combobox
/// </summary>
public void UnitComboFill()
{
try
{
dtbl = TransactionsGeneralFill.UnitViewAll(cmbUnit, false);
SettingsSP spSettings = new SettingsSP();
if (spSettings.SettingsStatusCheck("ShowUnit") == "Yes")
{
cmbUnit.Enabled = true;
}
else
{
cmbUnit.Enabled = false;
}
}
catch (Exception ex)
{
MessageBox.Show("MPC1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
示例4: CheckInvalidEntriesProduction
/// <summary>
/// Function to check invalid entries in production grid
/// </summary>
/// <param name="e"></param>
public void CheckInvalidEntriesProduction(DataGridViewCellEventArgs e)
{
try
{
SettingsSP spSettings = new SettingsSP();
if (dgvProduction.CurrentRow != null)
{
if (!isValueChanged)
{
if (dgvProduction.CurrentRow.Cells["dgvtxtProductionProductName"].Value == null || dgvProduction.CurrentRow.Cells["dgvtxtProductionProductName"].Value.ToString().Trim() == string.Empty)
{
isValueChanged = true;
dgvProduction.CurrentRow.HeaderCell.Value = "X";
dgvProduction.CurrentRow.HeaderCell.Style.ForeColor = Color.Red;
}
else if (dgvProduction.CurrentRow.Cells["dgvtxtProductionQty"].Value == null || dgvProduction.CurrentRow.Cells["dgvtxtProductionQty"].Value.ToString().Trim() == string.Empty || Convert.ToDecimal(dgvProduction.CurrentRow.Cells["dgvtxtProductionQty"].Value) == 0)
{
isValueChanged = true;
dgvProduction.CurrentRow.HeaderCell.Value = "X";
dgvProduction.CurrentRow.HeaderCell.Style.ForeColor = Color.Red;
}
else if (spSettings.SettingsStatusCheck("AllowZeroValueEntry") == "No" && Convert.ToDecimal(dgvProduction.CurrentRow.Cells["dgvtxtProductionRate"].Value) == 0)
{
dgvProduction.CurrentRow.HeaderCell.Value = "X";
dgvProduction.CurrentRow.HeaderCell.Style.ForeColor = Color.Red;
}
else
{
isValueChanged = true;
dgvProduction.CurrentRow.HeaderCell.Value = string.Empty;
}
}
isValueChanged = false;
}
}
catch (Exception ex)
{
MessageBox.Show("SJ:42" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
示例5: RemoveIncompleteRowsFromProductionGrid
/// <summary>
/// Function to remove incomplete rows from production grid
/// </summary>
/// <returns></returns>
public bool RemoveIncompleteRowsFromProductionGrid()
{
SettingsSP spSettings = new SettingsSP();
bool isOk = true;
try
{
string strMessage = "Rows";
int inC = 0, inForFirst = 0;
int inRowcount = dgvConsumption.RowCount;
int inLastRow = 1;
foreach (DataGridViewRow dgvrowCur in dgvProduction.Rows)
{
if (inLastRow < inRowcount)
{
if (dgvrowCur.HeaderCell.Value != null)
{
if (spSettings.SettingsStatusCheck("AllowZeroValueEntry") == "No" && Convert.ToDecimal(dgvrowCur.Cells["dgvtxtProductionAmount"].Value) == 0)
{
dgvProduction.CurrentRow.HeaderCell.Value = "X";
dgvProduction.CurrentRow.HeaderCell.Style.ForeColor = Color.Red;
}
if (dgvrowCur.HeaderCell.Value.ToString() == "X" || dgvrowCur.Cells["dgvtxtProductionProductName"].Value == null)
{
isOk = false;
if (inC == 0)
{
strMessage = strMessage + Convert.ToString(dgvrowCur.Index + 1);
inForFirst = dgvrowCur.Index;
inC++;
}
else
{
strMessage = strMessage + ", " + Convert.ToString(dgvrowCur.Index + 1);
}
}
}
}
inLastRow++;
}
inLastRow = 1;
if (!isOk)
{
strMessage = strMessage + " contains invalid entries. Do you want to continue?";
if (MessageBox.Show(strMessage, "OpenMiracle", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
{
isOk = true;
for (int inK = 0; inK < dgvProduction.Rows.Count; inK++)
{
if (dgvProduction.Rows[inK].HeaderCell.Value != null && dgvProduction.Rows[inK].HeaderCell.Value.ToString() == "X")
{
if (!dgvProduction.Rows[inK].IsNewRow)
{
dgvProduction.Rows.RemoveAt(inK);
inK--;
ProductionSerialNo();
}
}
}
}
else
{
dgvProduction.Focus();
}
}
}
catch (Exception ex)
{
MessageBox.Show("SJ:38" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
return isOk;
}
示例6: CalculationMethod
/// <summary>
/// Function to set the calculation method by checking the settings
/// </summary>
public void CalculationMethod()
{
try
{
SettingsInfo InfoSettings = new SettingsInfo();
SettingsSP SpSettings = new SettingsSP();
//--------------- Selection Of Calculation Method According To Settings ------------------//
if (SpSettings.SettingsStatusCheck("StockValueCalculationMethod") == "FIFO")
{
calculationMethod = "FIFO";
}
else if (SpSettings.SettingsStatusCheck("StockValueCalculationMethod") == "Average Cost")
{
calculationMethod = "Average Cost";
}
else if (SpSettings.SettingsStatusCheck("StockValueCalculationMethod") == "High Cost")
{
calculationMethod = "High Cost";
}
else if (SpSettings.SettingsStatusCheck("StockValueCalculationMethod") == "Low Cost")
{
calculationMethod = "Low Cost";
}
else if (SpSettings.SettingsStatusCheck("StockValueCalculationMethod") == "Last Purchase Rate")
{
calculationMethod = "Last Purchase Rate";
}
}
catch (Exception ex)
{
MessageBox.Show("AGR:6" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
示例7: dgvPaymentVoucher_CellValueChanged
/// <summary>
/// Gridview cell value changed , doing basic calculations and checking invalid entries
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void dgvPaymentVoucher_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
try
{
if (e.RowIndex != -1 && e.ColumnIndex != -1)
{
TotalAmount();
if (dgvPaymentVoucher.Rows[e.RowIndex].Cells["dgvcmbAccountLedger"].Value != null && dgvPaymentVoucher.Rows[e.RowIndex].Cells["dgvcmbAccountLedger"].Value.ToString() != string.Empty)
{
if (dgvPaymentVoucher.Rows[e.RowIndex].Cells["dgvcmbCurrency"].Value == null || dgvPaymentVoucher.Rows[e.RowIndex].Cells["dgvcmbCurrency"].Value.ToString() == string.Empty)
{
dgvPaymentVoucher.Rows[e.RowIndex].Cells["dgvcmbCurrency"].Value = Convert.ToDecimal(1);
}
}
AccountGroupSP spAccountGroup = new AccountGroupSP();
AccountLedgerSP SpAccountLedger = new AccountLedgerSP();
if (dgvPaymentVoucher.Rows[e.RowIndex].Cells["dgvcmbAccountLedger"].Value != null && dgvPaymentVoucher.Rows[e.RowIndex].Cells["dgvcmbAccountLedger"].Value.ToString().Trim() != string.Empty)
{
if (dgvPaymentVoucher.CurrentCell.ColumnIndex == dgvPaymentVoucher.CurrentRow.Cells["dgvcmbAccountLedger"].ColumnIndex)
{
/*************Remove partybalance while changing the ledger ************/
if (inUpdatingRowIndexForPartyRemove != -1)
{
int inTableRowCount = dtblPartyBalance.Rows.Count;
for (int inJ = 0; inJ < inTableRowCount; inJ++)
{
if (dtblPartyBalance.Rows.Count == inJ)
{
break;
}
if (Convert.ToDecimal(dtblPartyBalance.Rows[inJ]["ledgerId"].ToString()) == decUpdatingLedgerForPartyremove)
{
if (dtblPartyBalance.Rows[inJ]["PartyBalanceId"].ToString() != "0")
{
arrlstOfDeletedPartyBalanceRow.Add(dtblPartyBalance.Rows[inJ]["PartyBalanceId"]);
}
dtblPartyBalance.Rows.RemoveAt(inJ);
inJ--;
}
}
dgvPaymentVoucher.Rows[e.RowIndex].Cells["dgvtxtAmount"].Value = string.Empty;
decUpdatingLedgerForPartyremove = 0;
inUpdatingRowIndexForPartyRemove = -1;
}
/*************************************************************************/
decimal decLedgerId = Convert.ToDecimal(dgvPaymentVoucher.Rows[e.RowIndex].Cells["dgvcmbAccountLedger"].Value.ToString());
bool IsBankAccount = spAccountGroup.AccountGroupwithLedgerId(decLedgerId);
decimal decI = Convert.ToDecimal(SpAccountLedger.AccountGroupIdCheck(dgvPaymentVoucher.CurrentRow.Cells["dgvcmbAccountLedger"].FormattedValue.ToString()));
if (decI > 0)//to make amount and currency read only when party is choosen as ledger
{
dgvPaymentVoucher.CurrentRow.Cells["dgvtxtAmount"].ReadOnly = true;
dgvPaymentVoucher.CurrentRow.Cells["dgvtxtAmount"].Value = string.Empty;
dgvPaymentVoucher.Rows[e.RowIndex].Cells["dgvcmbCurrency"].Value = Convert.ToDecimal(1);
dgvPaymentVoucher.CurrentRow.Cells["dgvcmbCurrency"].ReadOnly = true;
}
else
{
dgvPaymentVoucher.CurrentRow.Cells["dgvtxtAmount"].ReadOnly = false;
SettingsSP spSettings = new SettingsSP();
if (spSettings.SettingsStatusCheck("MultiCurrency") == "Yes")
{
dgvcmbCurrency.ReadOnly = false;
}
else
{
dgvcmbCurrency.ReadOnly = true;
}
}
}
}
CheckColumnMissing();
DateValidation objVal = new DateValidation();
TextBox txtDate1 = new TextBox();
if (dgvPaymentVoucher.Rows[e.RowIndex].Cells["dgvtxtChequeDate"].Value != null)
{
txtDate1.Text = dgvPaymentVoucher.Rows[e.RowIndex].Cells["dgvtxtChequeDate"].Value.ToString();
bool isDate = objVal.DateValidationFunction(txtDate1);
if (isDate)
{
dgvPaymentVoucher.Rows[e.RowIndex].Cells["dgvtxtChequeDate"].Value = txtDate1.Text;
}
else
{
dgvPaymentVoucher.Rows[e.RowIndex].Cells["dgvtxtChequeDate"].Value = PublicVariables._dtCurrentDate.ToString("dd-MMM-yyyy");
}
}
}
}
catch (Exception ex)
//.........这里部分代码省略.........
示例8: dgvJournalVoucher_CellValueChanged
/// <summary>
/// On cellvalueChanged of dgvCreditNote
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void dgvJournalVoucher_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
try
{
if (e.RowIndex != -1 && e.ColumnIndex != -1)
{
DebitAndCreditTotal();
if (dgvJournalVoucher.Rows[e.RowIndex].Cells["dgvcmbAccountLedger"].Value != null && dgvJournalVoucher.Rows[e.RowIndex].Cells["dgvcmbAccountLedger"].Value.ToString() != string.Empty)
{
if (dgvJournalVoucher.Rows[e.RowIndex].Cells["dgvcmbCurrency"].Value == null || dgvJournalVoucher.Rows[e.RowIndex].Cells["dgvcmbCurrency"].Value.ToString() == string.Empty)
{
dgvJournalVoucher.Rows[e.RowIndex].Cells["dgvcmbCurrency"].Value = Convert.ToDecimal(1); //decExchangeRateId;
}
}
if (dgvJournalVoucher.Rows[e.RowIndex].Cells[e.ColumnIndex].OwningColumn.Name == "dgvcmbAccountLedger")
{
/*************Remove partybalance while changing the ledger ************/
if (inUpdatingRowIndexForPartyRemove != -1)
{
int inTableRowCount = dtblPartyBalance.Rows.Count;
for (int inJ = 0; inJ < inTableRowCount; inJ++)
{
if (dtblPartyBalance.Rows.Count == inJ)
{
break;
}
if (Convert.ToDecimal(dtblPartyBalance.Rows[inJ]["ledgerId"].ToString()) == decUpdatingLedgerForPartyremove)
{
if (dtblPartyBalance.Rows[inJ]["PartyBalanceId"].ToString() != "0")
{
arrlstOfDeletedPartyBalanceRow.Add(dtblPartyBalance.Rows[inJ]["PartyBalanceId"]);
}
dtblPartyBalance.Rows.RemoveAt(inJ);
inJ--;
}
}
dgvJournalVoucher.Rows[e.RowIndex].Cells["dgvtxtAmount"].Value = string.Empty;
//reset
decUpdatingLedgerForPartyremove = 0;
inUpdatingRowIndexForPartyRemove = -1;
}
/*************************************************************************/
//-----------To make amount readonly when party is selected as ledger------------------------------//
AccountLedgerSP spAccountLedger = new AccountLedgerSP();
if (spAccountLedger.AccountGroupIdCheck(dgvJournalVoucher.Rows[e.RowIndex].Cells["dgvcmbAccountLedger"].FormattedValue.ToString()))
{
dgvJournalVoucher.Rows[e.RowIndex].Cells["dgvtxtAmount"].Value = string.Empty;
dgvJournalVoucher.Rows[e.RowIndex].Cells["dgvtxtAmount"].ReadOnly = true;
}
else
{
dgvJournalVoucher.Rows[e.RowIndex].Cells["dgvtxtAmount"].Value = string.Empty;
dgvJournalVoucher.Rows[e.RowIndex].Cells["dgvtxtAmount"].ReadOnly = false;
SettingsSP spSettings = new SettingsSP();
if (spSettings.SettingsStatusCheck("MultiCurrency") == "Yes")
{
dgvcmbCurrency.ReadOnly = false;
}
else
{
dgvcmbCurrency.ReadOnly = true;
}
}
//========================================================================================//
}
if (dgvJournalVoucher.Rows[e.RowIndex].Cells[e.ColumnIndex].OwningColumn.Name == "dgvcmbDrOrCr")
{
/*************Remove partybalance while changing the Dr/Cr ************/
if (inUpdatingRowIndexForPartyRemove != -1)
{
int inTableRowCount = dtblPartyBalance.Rows.Count;
for (int inJ = 0; inJ < inTableRowCount; inJ++)
{
if (dtblPartyBalance.Rows.Count == inJ)
{
break;
}
if (Convert.ToDecimal(dtblPartyBalance.Rows[inJ]["ledgerId"].ToString()) == decUpdatingLedgerForPartyremove)
{
if (dtblPartyBalance.Rows[inJ]["PartyBalanceId"].ToString() != "0")
{
arrlstOfDeletedPartyBalanceRow.Add(dtblPartyBalance.Rows[inJ]["PartyBalanceId"]);
//.........这里部分代码省略.........
示例9: EditFunction
//.........这里部分代码省略.........
(0, "NA", InfoSalesMaster.VoucherNo, InfoSalesMaster.VoucherTypeId);
InfoSalesMaster.SalesMasterId = decSalesInvoiceIdToEdit;
InfoSalesMaster.AdditionalCost = Convert.ToDecimal(lblLedgerTotalAmount.Text);
InfoSalesMaster.BillDiscount = Convert.ToDecimal(txtBillDiscount.Text.Trim());
InfoSalesMaster.CreditPeriod = Convert.ToInt32(txtCreditPeriod.Text.Trim().ToString());
InfoSalesMaster.CustomerName = txtCustomer.Text.Trim();
InfoSalesMaster.Date = Convert.ToDateTime(txtDate.Text.ToString());
InfoSalesMaster.ExchangeRateId = Convert.ToDecimal(cmbCurrency.SelectedValue.ToString());
InfoSalesMaster.EmployeeId = Convert.ToDecimal(cmbSalesMan.SelectedValue.ToString());
InfoSalesMaster.FinancialYearId = PublicVariables._decCurrentFinancialYearId;
InfoSalesMaster.GrandTotal = Convert.ToDecimal(txtGrandTotal.Text.Trim());
InfoSalesMaster.InvoiceNo = txtInvoiceNo.Text.Trim();
InfoSalesMaster.LedgerId = Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString());
InfoSalesMaster.VoucherTypeId = DecSalesInvoiceVoucherTypeId;
InfoSalesMaster.VoucherNo = strVoucherNo;
if (isAutomatic)
{
InfoSalesMaster.SuffixPrefixId = decSalseInvoiceSuffixPrefixId;
}
else
{
InfoSalesMaster.SuffixPrefixId = 0;
}
if (cmbSalesMode.Text == "Against SalesOrder")
{
InfoSalesMaster.OrderMasterId = Convert.ToDecimal(cmbSalesModeOrderNo.SelectedValue.ToString());
}
else
{
InfoSalesMaster.OrderMasterId = 0;
}
if (cmbSalesMode.Text == "Against Delivery Note")
{
InfoSalesMaster.DeliveryNoteMasterId = Convert.ToDecimal(cmbSalesModeOrderNo.SelectedValue.ToString());
}
else
{
InfoSalesMaster.DeliveryNoteMasterId = 0;
}
if (cmbSalesMode.Text == "Against Quotation")
{
InfoSalesMaster.QuotationMasterId = Convert.ToDecimal(cmbSalesModeOrderNo.SelectedValue.ToString());
}
else
{
InfoSalesMaster.QuotationMasterId = 0;
}
InfoSalesMaster.Narration = txtNarration.Text.Trim();
InfoSalesMaster.PricinglevelId = Convert.ToDecimal(cmbPricingLevel.SelectedValue.ToString());
InfoSalesMaster.SalesAccount = Convert.ToDecimal(cmbSalesAccount.SelectedValue.ToString());
InfoSalesMaster.TotalAmount = Convert.ToDecimal(txtTotalAmount.Text.Trim());
if (dgvSalesInvoice.Columns["dgvcmbSalesInvoiceTaxName"].Visible)
{
InfoSalesMaster.TaxAmount = Convert.ToDecimal(lblTaxTotalAmount.Text.Trim());
}
else
{
InfoSalesMaster.TaxAmount = 0;
}
InfoSalesMaster.UserId = PublicVariables._decCurrentUserId;
InfoSalesMaster.LrNo = txtVehicleNo.Text;
InfoSalesMaster.TransportationCompany = txtTransportCompany.Text.Trim();
InfoSalesMaster.POS = false;
InfoSalesMaster.CounterId = 0;
InfoSalesMaster.ExtraDate = DateTime.Now;
InfoSalesMaster.Extra1 = string.Empty;
InfoSalesMaster.Extra2 = string.Empty;
spSalesMaster.SalesMasterEdit(InfoSalesMaster);
removeSalesInvoiceDetails();
SalesInvoiceDetailsEditFill();
if (cmbCashOrParty.Enabled)
{
LedgerPostingSP spLedgerPosting = new LedgerPostingSP();
spLedgerPosting.LedgerPostDelete(strVoucherNo, DecSalesInvoiceVoucherTypeId);
ledgerPostingAdd();
}
else
{
ledgerPostingEdit();
}
Messages.UpdatedMessage();
if (cbxPrintAfterSave.Checked)
{
SettingsSP spSettings = new SettingsSP();
if (spSettings.SettingsStatusCheck("Printer") == "Dot Matrix")
{
PrintForDotMatrix(decSalesInvoiceIdToEdit);
}
else
{
Print(decSalesInvoiceIdToEdit);
}
}
this.Close();
}
catch (Exception ex)
{
MessageBox.Show("SI: 78" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
示例10: SalesQuotationSettingsCheck
/// <summary>
/// Function to check the settings for grid
/// </summary>
public void SalesQuotationSettingsCheck()
{
try
{
ShowBarcode();
ShowProductCode();
SettingsSP spSettings = new SettingsSP();
if (spSettings.SettingsStatusCheck("MultiCurrency") == "Yes")
{
cmbCurrency.Enabled = true;
}
else
{
cmbCurrency.Enabled = false;
}
if (!ShowProductCode())
{
this.dgvProduct.Columns["dgvtxtProductCode"].Visible = false;
}
else
{
this.dgvProduct.Columns["dgvtxtProductCode"].Visible = true;
}
if (!ShowBarcode())
{
this.dgvProduct.Columns["dgvtxtBarcode"].Visible = false;
}
else
{
this.dgvProduct.Columns["dgvtxtBarcode"].Visible = true; ;
}
if (PrintAfetrSave())
{
cbxPrintAfterSave.Checked = true;
}
else
{
cbxPrintAfterSave.Checked = false;
}
if (spSettings.SettingsStatusCheck("AllowBatch") == "Yes")
{
this.dgvProduct.Columns["dgvcmbBatch"].Visible = true;
}
else
{
this.dgvProduct.Columns["dgvcmbBatch"].Visible = false;
}
if (spSettings.SettingsStatusCheck("ShowUnit") == "Yes")
{
this.dgvProduct.Columns["dgvcmbUnit"].Visible = true;
}
else
{
this.dgvProduct.Columns["dgvcmbUnit"].Visible = false;
}
}
catch (Exception ex)
{
MessageBox.Show("SQ:38" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
示例11: EditFunction
/// <summary>
/// Function to edit the SalesQuatation
/// </summary>
public void EditFunction()
{
SalesQuotationDetailsSP SpSalesQuotationDetails = new SalesQuotationDetailsSP();
SalesQuotationMasterInfo infoSalesQuotationMaster = new SalesQuotationMasterInfo();
SalesQuotationMasterSP SpSalesQuotationMaster = new SalesQuotationMasterSP();
SettingsSP spSettings = new SettingsSP();
try
{
for (int inI = 0; inI < dgvProduct.Rows.Count - 1; inI++)
{
if (Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvtxtquotationDetailsId"].Value) != 0)
{
isEditDetails = Convert.ToString(SpSalesQuotationDetails.SalesQuotationRefererenceCheckForEditDetails(Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvtxtquotationDetailsId"].Value)));
}
}
isEditMaster = Convert.ToString(SpSalesQuotationMaster.SalesQuotationRefererenceCheckForEditMaster(decSalesquotationMasterId));
if (isEditMaster == "False" && isEditDetails == "False")
{
infoSalesQuotationMaster.QuotationMasterId = decSalesquotationMasterId;
infoSalesQuotationMaster.Date = Convert.ToDateTime(txtSalesQuotationDate.Text);
infoSalesQuotationMaster.LedgerId = Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString());
infoSalesQuotationMaster.SuffixPrefixId = Convert.ToDecimal(decSalesQuotationPreffixSuffixId);
infoSalesQuotationMaster.VoucherNo = strVoucherNo;
infoSalesQuotationMaster.VoucherTypeId = decSalesQuotationVoucherId;
infoSalesQuotationMaster.InvoiceNo = txtQuotationNo.Text;
infoSalesQuotationMaster.userId = PublicVariables._decCurrentUserId;//by default current userid used as current user id
infoSalesQuotationMaster.EmployeeId = Convert.ToDecimal(cmbSalesman.SelectedValue.ToString());
infoSalesQuotationMaster.FinancialYearId = PublicVariables._decCurrentFinancialYearId;
infoSalesQuotationMaster.Narration = txtNarration.Text.Trim();
infoSalesQuotationMaster.TotalAmount = Convert.ToDecimal(txtTotal.Text);
infoSalesQuotationMaster.PricinglevelId = Convert.ToDecimal(cmbPricinglevel.SelectedValue.ToString());
infoSalesQuotationMaster.ExchangeRateId = Convert.ToDecimal(cmbCurrency.SelectedValue.ToString());
if (cbxApproved.Checked)
{
infoSalesQuotationMaster.Approved = true;
}
else
{
infoSalesQuotationMaster.Approved = false;
}
infoSalesQuotationMaster.Extra1 = string.Empty;
infoSalesQuotationMaster.Extra2 = string.Empty;
SpSalesQuotationMaster.SalesQuotationMasterEdit(infoSalesQuotationMaster);
RemoveSalesQuotationDetails();
NewRowAddedToSalesQuotationDetails();
SalesQuotationDetailsEditFill();
Messages.UpdatedMessage();
if (frmSalesQuotationRegisterObj != null)
{
if (cbxPrintAfterSave.Checked)
{
if (spSettings.SettingsStatusCheck("Printer") == "Dot Matrix")
{
PrintForDotMatrix(decSalesquotationMasterId);
}
else
{
Print(decSalesquotationMasterId);
}
}
this.Close();
frmSalesQuotationRegisterObj.GridFill();
}
if (frmSalesQuotationReportObj != null)
{
if (cbxPrintAfterSave.Checked)
{
if (spSettings.SettingsStatusCheck("Printer") == "Dot Matrix")
{
PrintForDotMatrix(decSalesquotationMasterId);
}
else
{
Print(decSalesquotationMasterId);
}
}
this.Close();
frmSalesQuotationReportObj.GridFill();
}
if (frmDayBookObj != null)
{
if (cbxPrintAfterSave.Checked)
{
if (spSettings.SettingsStatusCheck("Printer") == "Dot Matrix")
{
PrintForDotMatrix(decSalesquotationMasterId);
}
else
{
Print(decSalesquotationMasterId);
}
}
this.Close();
}
if (objfrmVoucherSearch != null)
{
if (cbxPrintAfterSave.Checked)
//.........这里部分代码省略.........
示例12: SaveFunction
/// <summary>
/// Function to save the sales quatation
/// </summary>
public void SaveFunction()
{
SalesQuotationDetailsSP SpSalesQuotationDetails = new SalesQuotationDetailsSP();
SalesQuotationMasterSP SpSalesQuotationMaster = new SalesQuotationMasterSP();
SalesQuotationMasterInfo infoSalesQuotationMaster = new SalesQuotationMasterInfo();
SalesQuotationDetailsInfo infoSalesQuotationDetails = new SalesQuotationDetailsInfo();
SettingsSP spSettings = new SettingsSP();
ProductSP spProduct = new ProductSP();
ProductInfo infoproduct = new ProductInfo();
try
{
infoSalesQuotationMaster.Date = Convert.ToDateTime(txtSalesQuotationDate.Text);
infoSalesQuotationMaster.PricinglevelId = Convert.ToDecimal(cmbPricinglevel.SelectedValue.ToString());
infoSalesQuotationMaster.LedgerId = Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString());
infoSalesQuotationMaster.EmployeeId = Convert.ToDecimal(cmbSalesman.SelectedValue.ToString());
if (isAutomatic)
{
infoSalesQuotationMaster.SuffixPrefixId = decSalesQuotationPreffixSuffixId;
infoSalesQuotationMaster.VoucherNo = strSalesQuotationNo;
}
else
{
infoSalesQuotationMaster.SuffixPrefixId = 0;
infoSalesQuotationMaster.VoucherNo = SpSalesQuotationMaster.VoucherNoMax(decsalesQuotationTypeId);
}
infoSalesQuotationMaster.VoucherTypeId = decsalesQuotationTypeId;
infoSalesQuotationMaster.InvoiceNo = txtQuotationNo.Text;
infoSalesQuotationMaster.EmployeeId = Convert.ToDecimal(cmbSalesman.SelectedValue.ToString());
infoSalesQuotationMaster.FinancialYearId = PublicVariables._decCurrentFinancialYearId;
infoSalesQuotationMaster.userId = PublicVariables._decCurrentUserId;
infoSalesQuotationMaster.TotalAmount = Convert.ToDecimal(txtTotal.Text);
infoSalesQuotationMaster.Narration = txtNarration.Text.Trim();
infoSalesQuotationMaster.ExchangeRateId = Convert.ToDecimal(cmbCurrency.SelectedValue.ToString());
infoSalesQuotationMaster.Extra1 = string.Empty;
infoSalesQuotationMaster.Extra2 = string.Empty;
if (cbxApproved.Checked)
{
infoSalesQuotationMaster.Approved = true;
}
else
{
infoSalesQuotationMaster.Approved = false;
}
decSalesQuotationmasterIdentity = Convert.ToDecimal(SpSalesQuotationMaster.SalesQuotationMasterAdd(infoSalesQuotationMaster));
int inRowcount = dgvProduct.Rows.Count;
for (int inI = 0; inI < inRowcount - 1; inI++)
{
infoSalesQuotationDetails.QuotationMasterId = decSalesQuotationmasterIdentity;
if (dgvProduct.Rows[inI].Cells["dgvtxtProductCode"].Value != null && dgvProduct.Rows[inI].Cells["dgvtxtProductCode"].Value.ToString() != string.Empty)
{
infoproduct = spProduct.ProductViewByCode(dgvProduct.Rows[inI].Cells["dgvtxtProductCode"].Value.ToString());
infoSalesQuotationDetails.ProductId = infoproduct.ProductId;
}
if (dgvProduct.Rows[inI].Cells["dgvtxtQty"].Value != null && dgvProduct.Rows[inI].Cells["dgvtxtQty"].Value.ToString() != string.Empty)
{
infoSalesQuotationDetails.Qty = Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvtxtQty"].Value.ToString());
}
if (dgvProduct.Rows[inI].Cells["dgvcmbUnit"].Value != null && dgvProduct.Rows[inI].Cells["dgvcmbUnit"].Value.ToString() != string.Empty)
{
infoSalesQuotationDetails.UnitId = Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvcmbUnit"].Value.ToString());
decimal unitConversion = SpSalesQuotationDetails.UnitconversionIdViewByUnitIdAndProductId(infoSalesQuotationDetails.UnitId, infoSalesQuotationDetails.ProductId);
infoSalesQuotationDetails.UnitConversionId = unitConversion;
}
if (dgvProduct.Rows[inI].Cells["dgvcmbBatch"].Value != null && dgvProduct.Rows[inI].Cells["dgvcmbBatch"].Value.ToString() != string.Empty)
{
infoSalesQuotationDetails.BatchId = Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvcmbBatch"].Value);
}
else
{
infoSalesQuotationDetails.BatchId = 0;
}
infoSalesQuotationDetails.Rate = Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvtxtRate"].Value.ToString());
infoSalesQuotationDetails.Amount = Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvtxtAmount"].Value.ToString());
infoSalesQuotationDetails.Slno = Convert.ToInt32(dgvProduct.Rows[inI].Cells["dgvtxtSlNo"].Value.ToString());
infoSalesQuotationDetails.Extra1 = string.Empty;
infoSalesQuotationDetails.Extra2 = string.Empty;
SpSalesQuotationDetails.SalesQuotationDetailsAdd(infoSalesQuotationDetails);
}
Messages.SavedMessage();
if (cbxPrintAfterSave.Checked)
{
if (dgvProduct.Rows.Count > 0)
{
if (spSettings.SettingsStatusCheck("Printer") == "Dot Matrix")
{
PrintForDotMatrix(decSalesQuotationmasterIdentity);
}
else
{
Print(decSalesQuotationmasterIdentity);
}
}
else
{
Messages.InformationMessage("No data found");
}
}
//.........这里部分代码省略.........
示例13: PurchaseReturnSettingsCheck
/// <summary>
/// Function for Settings Status Check
/// </summary>
public void PurchaseReturnSettingsCheck()
{
SettingsSP spSettings = new SettingsSP();
try
{
dgvPurchaseReturn.Columns["dgvcmbGodown"].Visible = (spSettings.SettingsStatusCheck("AllowGodown") == "Yes") ? true : false;
dgvPurchaseReturn.Columns["dgvCmbRack"].Visible = (spSettings.SettingsStatusCheck("AllowRack") == "Yes") ? true : false;
dgvPurchaseReturn.Columns["dgvcmbBatch"].Visible = (spSettings.SettingsStatusCheck("AllowBatch") == "Yes") ? true : false;
dgvPurchaseReturn.Columns["dgvtxtBarcode"].Visible = (spSettings.SettingsStatusCheck("Barcode") == "Yes") ? true : false;
dgvPurchaseReturn.Columns["dgvcmbUnit"].Visible = (spSettings.SettingsStatusCheck("ShowUnit") == "Yes") ? true : false;
dgvPurchaseReturn.Columns["dgvtxtproductCode"].Visible = (spSettings.SettingsStatusCheck("ShowProductCode") == "Yes") ? true : false;
dgvPurchaseReturn.Columns["dgvtxtdiscount"].Visible = (spSettings.SettingsStatusCheck("ShowDiscountAmount") == "Yes") ? true : false;
dgvPurchaseReturn.Columns["dgvtxtrate"].Visible = (spSettings.SettingsStatusCheck("ShowPurchaseRate") == "Yes") ? true : false;
cbxPrintAfterSave.Checked = (spSettings.SettingsStatusCheck("TickPrintAfterSave") == "Yes") ? true : false;
if (spSettings.SettingsStatusCheck("Tax") == "Yes")
{
dgvcmbTax.Visible = true;
dgvPurchaseReturnTax.Visible = true;
lblTotalTaxAmount.Visible = true;
lblTaxAmount.Visible = true;
lblTotalTaxAmount.Visible = true;
dgvtxttaxAmount.Visible = true;
}
else
{
dgvcmbTax.Visible = false;
dgvPurchaseReturnTax.Visible = false;
lblTaxAmount.Visible = false;
lblTaxAmount.Visible = false;
lblTotalTaxAmount.Visible = false;
dgvtxttaxAmount.Visible = false;
}
}
catch (Exception ex)
{
MessageBox.Show("PR:16 " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
示例14: SaveOrEdit
//.........这里部分代码省略.........
{
infoPartyBalance.Date = infoPurchaseReturnMaster.Date;
infoPartyBalance.LedgerId = infoPurchaseReturnMaster.LedgerId;
if (decAgainstVoucherTypeId != 0)
{
infoPartyBalance.VoucherTypeId = infoPurchaseMaster.VoucherTypeId;
infoPartyBalance.VoucherNo = infoPurchaseMaster.VoucherNo;
infoPartyBalance.InvoiceNo = infoPurchaseMaster.InvoiceNo;
infoPartyBalance.AgainstVoucherTypeId = infoPurchaseReturnMaster.VoucherTypeId;
infoPartyBalance.AgainstVoucherNo = infoPurchaseReturnMaster.VoucherNo;
infoPartyBalance.AgainstInvoiceNo = infoPurchaseReturnMaster.InvoiceNo;
infoPartyBalance.ReferenceType = "Against";
}
else
{
infoPartyBalance.VoucherTypeId = infoPurchaseReturnMaster.VoucherTypeId;
infoPartyBalance.VoucherNo = infoPurchaseReturnMaster.VoucherNo;
infoPartyBalance.InvoiceNo = infoPurchaseReturnMaster.InvoiceNo;
infoPartyBalance.AgainstVoucherTypeId = 0;
infoPartyBalance.AgainstVoucherNo = "NA";
infoPartyBalance.AgainstInvoiceNo = "NA";
infoPartyBalance.ReferenceType ="New";
}
infoPartyBalance.Debit = infoPurchaseReturnMaster.TotalAmount;
infoPartyBalance.Credit = 0;
infoPartyBalance.CreditPeriod = 0;
infoPartyBalance.ExchangeRateId = infoPurchaseReturnMaster.ExchangeRateId;
infoPartyBalance.FinancialYearId = PublicVariables._decCurrentFinancialYearId;
infoPartyBalance.Extra1 = string.Empty;
infoPartyBalance.Extra2 = string.Empty;
spPartyBalance.PartyBalanceAdd(infoPartyBalance);
}
foreach (DataGridViewRow item in dgvPurchaseReturnTax.Rows)
{
if (item.Cells["dgvtxtTaxId"].Value != null)
{
infoPurchaseReturnBillTax.PurchaseReturnMasterId = (btnSave.Text == "Save") ? decPurchaseReturnMasterIds : decPurchaseReturnMasterIds;
infoPurchaseReturnBillTax.TaxId = Convert.ToDecimal(item.Cells["dgvtxtTaxId"].Value.ToString());
infoPurchaseReturnBillTax.TaxAmount = (item.Cells["dgvtxtAmounts"].Value == null) ? 0 : Convert.ToDecimal(item.Cells["dgvtxtAmounts"].Value.ToString());
infoPurchaseReturnBillTax.Extra1 = string.Empty;
infoPurchaseReturnBillTax.Extra2 = string.Empty;
spPurchaseReturnBillTax.PurchaseReturnBilltaxAdd(infoPurchaseReturnBillTax);
}
}
if (btnSave.Text == "Save")
{
Messages.SavedMessage();
if (cbxPrintAfterSave.Checked)
{
if (spSettings.SettingsStatusCheck("Printer") == "Dot Matrix")
{
PrintForDotMatrix(decPurchaseReturnMasterIds);
}
else
{
Print(decPurchaseReturnMasterIds);
}
}
Clear();
}
else
{
decDiscount = Convert.ToDecimal(txtBillDiscount.Text);
Messages.UpdatedMessage();
if (cbxPrintAfterSave.Checked)
{
if (spSettings.SettingsStatusCheck("Printer") == "Dot Matrix")
{
PrintForDotMatrix(decPurchaseReturnMasterId);
}
else
{
Print(decPurchaseReturnMasterId);
}
}
if (frmPurchaseReturnRegisterObj != null)
{
frmPurchaseReturnRegisterObj.GridFill();
frmPurchaseReturnRegisterObj.Enabled = true;
}
if (ObjPurchaseReturnReport != null)
{
ObjPurchaseReturnReport.PurchaseReturnReportGridFill();
ObjPurchaseReturnReport.Enabled = true;
}
if (frmLedgerDetailsObj != null)
{
frmLedgerDetailsObj.LedgerDetailsView();
frmLedgerDetailsObj.Enabled = true;
}
this.Close();
}
}
catch (Exception ex)
{
MessageBox.Show("PR:49" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
示例15: SaveOrEditCheck
/// <summary>
/// Function to check Negative Stock at the time of saving and updating
/// </summary>
public bool SaveOrEditCheck()
{
bool isOk = false;
try
{
decimal decProductId = 0;
decimal decBatchId = 0;
decimal decCalcQty = 0;
StockPostingSP spStockPosting = new StockPostingSP();
SettingsSP spSettings = new SettingsSP();
string strStatus = spSettings.SettingsStatusCheck("NegativeStockStatus");
bool isNegativeLedger = false;
DataTable dtblPurchaseMasterViewById = new DataTable();
PurchaseReturnMasterSP SPPurchaseReturnMaster = new PurchaseReturnMasterSP();
dgvPurchaseReturn.ClearSelection();
int inRow = dgvPurchaseReturn.RowCount;
if (txtReturnNo.Text.Trim() == string.Empty)
{
Messages.InformationMessage("Enter Return number");
txtReturnNo.Focus();
}
else if (SPPurchaseReturnMaster.PurchaseReturnNumberCheckExistence(txtReturnNo.Text.Trim(), decPurchaseReturnVoucherTypeId) == true && btnSave.Text == "Save")
{
Messages.InformationMessage("Return number already exist");
txtReturnNo.Focus();
}
else if ((btnSave.Text == "Update") && (txtReturnNo.Text != strReturnNo) && (SPPurchaseReturnMaster.PurchaseReturnNumberCheckExistence(txtReturnNo.Text.Trim(), decPurchaseReturnVoucherTypeId) == true))
{
Messages.InformationMessage("Return number already exist");
txtReturnNo.Focus();
}
else if (txtDate.Text.Trim() == string.Empty)
{
Messages.InformationMessage("Select a date in between financial year");
txtDate.Focus();
}
else if (cmbInvoiceNo.Visible == true && cmbInvoiceNo.SelectedValue == null)
{
Messages.InformationMessage("Select a invoice no");
cmbInvoiceNo.Focus();
}
else
{
if (RemoveIncompleteRowsFromGrid())
{
int inRowCount = dgvPurchaseReturn.RowCount;
if (inRowCount > 1)
{
for (int i = 0; i < inRowCount - 1; i++)
{
if (dgvPurchaseReturn.Rows[i].Cells["dgvtxtproductId"].Value != null && dgvPurchaseReturn.Rows[i].Cells["dgvtxtproductId"].Value.ToString() != string.Empty)
{
decProductId = Convert.ToDecimal(dgvPurchaseReturn.Rows[i].Cells["dgvtxtproductId"].Value.ToString());
if (dgvPurchaseReturn.Rows[i].Cells["dgvcmbBatch"].Value != null && dgvPurchaseReturn.Rows[i].Cells["dgvcmbBatch"].Value.ToString() != string.Empty)
{
decBatchId = Convert.ToDecimal(dgvPurchaseReturn.Rows[i].Cells["dgvcmbBatch"].Value.ToString());
}
decimal decCurrentStock = spStockPosting.StockCheckForProductSale(decProductId, decBatchId);
if (dgvPurchaseReturn.Rows[i].Cells["dgvtxtqty"].Value != null && dgvPurchaseReturn.Rows[i].Cells["dgvtxtqty"].Value.ToString() != string.Empty)
{
decCalcQty = decCurrentStock - Convert.ToDecimal(dgvPurchaseReturn.Rows[i].Cells["dgvtxtqty"].Value.ToString());
}
if (decCalcQty < 0)
{
isNegativeLedger = true;
break;
}
}
}
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)
{
isOk = true;
}
}
else if (strStatus == "Block")
{
MessageBox.Show("Cannot continue ,due to negative stock balance", "Open miracle", MessageBoxButtons.OK, MessageBoxIcon.Stop);
isOk = false;
}
else
{
isOk = true;
}
}
else
{
isOk = true;
}
}
else
{
isOk = false;
}
//.........这里部分代码省略.........