本文整理汇总了C#中AceSoft.RetailPlus.Data.Products.CommitAndDispose方法的典型用法代码示例。如果您正苦于以下问题:C# Products.CommitAndDispose方法的具体用法?C# Products.CommitAndDispose怎么用?C# Products.CommitAndDispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AceSoft.RetailPlus.Data.Products
的用法示例。
在下文中一共展示了Products.CommitAndDispose方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, System.EventArgs e)
{
const string defaultHeading = "Master Files";
string stHeading = defaultHeading;
const string defaultTitle = "Product Variation Combinations";
SiteTitle.Title = defaultTitle;
const SearchCategoryID defaultSearchIndex = SearchCategoryID.ProductVariationsMatrix;
SearchCategoryID SearchIndex = defaultSearchIndex;
HorizontalNavBar.PageNavigatorid = HorizontalNavID.MasterFiles;
if (Request.QueryString["task"]!=null)
{
Products clsProduct = new Products();
ProductDetails clsDetails = new ProductDetails();
long prodid = Convert.ToInt64(Common.Decrypt(Request.QueryString["prodid"].ToString(), Session.SessionID));
clsDetails = clsProduct.Details(prodid);
clsProduct.CommitAndDispose();
string productCode = " for : " + clsDetails.ProductCode;
string task = Common.Decrypt(Request.QueryString["task"].ToString(),Session.SessionID);
switch(task)
{
case "add":
stHeading = "Create New Product Variation Combination";
SearchIndex = SearchCategoryID.ProductVariationsMatrix;
ctrlInsert.Visible = true;
break;
case "edit":
stHeading = "Modify Product Variation Combination";
SearchIndex = SearchCategoryID.ProductVariationsMatrix;
ctrlUpdate.Visible = true;
break;
case "det":
stHeading = "Product Variation Details";
SearchIndex = SearchCategoryID.ProductVariationsMatrix;
ctrlDetails.Visible = true;
break;
case "list":
stHeading = "Product Variation Combinations List ";
SearchIndex = SearchCategoryID.ProductVariationsMatrix;
ctrlList.Visible = true;
break;
default:
break;
}
LargeHeading.Text = stHeading + productCode;
RightBodySectionSearch.SearchIDSelectedItem = SearchIndex;
}
}
示例2: SetDataSourceProducts
private void SetDataSourceProducts(ReportDocument Report)
{
ReportDataset rptds = new ReportDataset();
string ProductGroupName = string.Empty;
if (cboGroup.SelectedItem.Value != Constants.ZERO_STRING) ProductGroupName = cboGroup.SelectedItem.Text;
string SubGroupName = string.Empty;
if (cboSubGroup.SelectedItem.Value != Constants.ZERO_STRING) SubGroupName = cboSubGroup.SelectedItem.Text;
Products clsProduct = new Products();
System.Data.DataTable dtProductInventoryReport = clsProduct.InventoryReport(ProductGroupName, SubGroupName, txtProductCodeSearch.Text);
//ProductVariationsMatrix clsMatrix = new ProductVariationsMatrix(clsProduct.Connection, clsProduct.Transaction);
//System.Data.DataTable dtMatrixInventoryReport = clsMatrix.InventoryReport(ProductGroupName, SubGroupName, txtProductCodeSearch.Text);
clsProduct.CommitAndDispose();
foreach (System.Data.DataRow dr in dtProductInventoryReport.Rows)
{
DataRow drNew = rptds.Products.NewRow();
foreach (DataColumn dc in rptds.Products.Columns)
drNew[dc] = dr[dc.ColumnName];
rptds.Products.Rows.Add(drNew);
}
Report.SetDataSource(rptds);
}
示例3: cboProductCode_SelectedIndexChanged
protected void cboProductCode_SelectedIndexChanged(object sender, System.EventArgs e)
{
try
{
if (cboProductCode.SelectedItem.Value != Constants.ZERO_STRING)
{
Products clsProduct = new Products();
ProductDetails clsProductDetails = clsProduct.Details(long.Parse(cboProductCode.SelectedItem.Value));
clsProduct.CommitAndDispose();
txtRedeemRewardPoints.Text = clsProductDetails.RewardPoints.ToString("#,##0.#0");
txtNewRewardPoints.Text = Convert.ToInt32(Convert.ToDecimal(txtCurrentRewardPoints.Text) - Convert.ToDecimal(txtRedeemRewardPoints.Text)).ToString();
}
}
catch (Exception ex)
{
throw ex;
}
}
示例4: CopyPOSToActual
private bool CopyPOSToActual()
{
bool boRetValue = false;
Products clsProduct = new Products();
boRetValue = clsProduct.CopyPOSToActualByProductGroup(int.Parse(cboBranch.SelectedItem.Value), long.Parse(cboProductGroup.SelectedItem.Value));
clsProduct.CommitAndDispose();
boRetValue = true;
return boRetValue;
}
示例5: lstItem_ItemCommand
protected void lstItem_ItemCommand(object source, System.Web.UI.WebControls.DataListCommandEventArgs e)
{
HtmlInputCheckBox chkList = (HtmlInputCheckBox)e.Item.FindControl("chkList");
HtmlInputCheckBox chkMatrixID = (HtmlInputCheckBox)e.Item.FindControl("chkMatrixID");
string stParam = "?task=" + Common.Encrypt("list", Session.SessionID) +
"&prodid=" + Common.Encrypt(chkList.Value, Session.SessionID);
switch(e.CommandName)
{
case "imgProductTag":
{
ImageButton imgProductTag = (ImageButton)e.Item.FindControl("imgProductTag");
Products clsProduct = new Products();
if (imgProductTag.ToolTip == "Tag this product as INACTIVE.")
{
clsProduct.TagInactive(long.Parse(chkList.Value));
imgProductTag.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/prodtaginact.gif";
imgProductTag.ToolTip = "Tag this product as ACTIVE.";
}
else
{
clsProduct.TagActive(long.Parse(chkList.Value));
imgProductTag.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/prodtagact.gif";
imgProductTag.ToolTip = "Tag this product as INACTIVE.";
}
clsProduct.CommitAndDispose();
}
break;
case "imgSaveActualQuantity":
{
TextBox txtActualQuantity = (TextBox)e.Item.FindControl("txtActualQuantity");
try { decimal.Parse(txtActualQuantity.Text); }
catch
{
string stScript = "<Script>";
stScript += "window.alert('Please enter a VALID actual quantity.')";
stScript += "</Script>";
Response.Write(stScript);
break;
}
ProductInventories clsProductInventories = new ProductInventories();
clsProductInventories.UpdateActualQuantity(int.Parse(cboBranch.SelectedItem.Value), long.Parse(chkList.Value), long.Parse(chkMatrixID.Value), decimal.Parse(txtActualQuantity.Text));
clsProductInventories.CommitAndDispose();
}
break;
}
}
示例6: SaveRecord
private void SaveRecord()
{
DebitMemoItemDetails clsDetails = new DebitMemoItemDetails();
Products clsProducts = new Products();
ProductDetails clsProductDetails = clsProducts.Details1(Constants.BRANCH_ID_MAIN, Convert.ToInt64(cboProductCode.SelectedItem.Value));
Terminal clsTerminal = new Terminal(clsProducts.Connection, clsProducts.Transaction);
TerminalDetails clsTerminalDetails = clsTerminal.Details(Int32.Parse(Session["BranchID"].ToString()), Session["TerminalNo"].ToString());
clsProducts.CommitAndDispose();
clsDetails.DebitMemoID = Convert.ToInt64(lblDebitMemoID.Text);
clsDetails.ProductID = Convert.ToInt64(cboProductCode.SelectedItem.Value);
clsDetails.ProductCode = clsProductDetails.ProductCode;
clsDetails.BarCode = clsProductDetails.BarCode;
clsDetails.Description = clsProductDetails.ProductDesc;
clsDetails.ProductUnitID = Convert.ToInt32(cboProductUnit.SelectedItem.Value);
clsDetails.ProductUnitCode = cboProductUnit.SelectedItem.Text;
clsDetails.Quantity = Convert.ToDecimal(txtQuantity.Text);
clsDetails.PrevUnitCost = Convert.ToDecimal(txtPrevPrice.Text);
clsDetails.UnitCost = Convert.ToDecimal(txtPrice.Text);
clsDetails.Discount = getItemTotalDiscount();
clsDetails.DiscountApplied = Convert.ToDecimal(txtDiscount.Text);
if (clsDetails.DiscountApplied == 0)
{
if (chkInPercent.Checked == true)
clsDetails.DiscountType = DiscountTypes.Percentage;
else
clsDetails.DiscountType = DiscountTypes.FixedValue;
}
else
{
clsDetails.DiscountType = DiscountTypes.NotApplicable;
}
clsDetails.IsVatable = chkIsTaxable.Checked;
clsDetails.Amount = ComputeItemAmount();
if (clsDetails.IsVatable)
{
clsDetails.VatableAmount = clsDetails.Amount;
clsDetails.EVatableAmount = clsDetails.Amount;
clsDetails.LocalTax = clsDetails.Amount;
if (clsTerminalDetails.IsVATInclusive == false)
{
if (clsDetails.VatableAmount < clsDetails.Discount) clsDetails.VatableAmount = 0;
if (clsDetails.EVatableAmount < clsDetails.Discount) clsDetails.EVatableAmount = 0;
if (clsDetails.LocalTax < clsDetails.Discount) clsDetails.LocalTax = 0;
}
else
{
if (clsDetails.VatableAmount >= clsDetails.Discount) clsDetails.VatableAmount = (clsDetails.VatableAmount) / (1 + (clsTerminalDetails.VAT / 100)); else clsDetails.VatableAmount = 0;
if (clsDetails.EVatableAmount >= clsDetails.Discount) clsDetails.EVatableAmount = (clsDetails.EVatableAmount) / (1 + (clsTerminalDetails.VAT / 100)); else clsDetails.EVatableAmount = 0;
if (clsDetails.LocalTax >= clsDetails.Discount) clsDetails.LocalTax = (clsDetails.LocalTax) / (1 + (clsTerminalDetails.LocalTax / 100)); else clsDetails.LocalTax = 0;
}
clsDetails.VAT = clsDetails.VatableAmount * (clsTerminalDetails.VAT / 100);
clsDetails.EVAT = clsDetails.EVatableAmount * (clsTerminalDetails.EVAT / 100);
clsDetails.LocalTax = clsDetails.LocalTax * (clsTerminalDetails.LocalTax / 100);
}
else
{
clsDetails.VAT = 0;
clsDetails.VatableAmount = 0;
clsDetails.EVAT = 0;
clsDetails.EVatableAmount = 0;
clsDetails.LocalTax = 0;
}
clsDetails.isVATInclusive = clsTerminalDetails.IsVATInclusive;
clsDetails.VariationMatrixID = Convert.ToInt64(cboVariation.SelectedItem.Value);
if (clsDetails.VariationMatrixID != 0)
clsDetails.MatrixDescription = cboVariation.SelectedItem.Text;
clsDetails.ProductGroup = clsProductDetails.ProductGroupCode;
clsDetails.ProductSubGroup = clsProductDetails.ProductSubGroupCode;
clsDetails.Remarks = txtRemarks.Text;
DebitMemoItems clsDebitMemoItems = new DebitMemoItems();
if (lblDebitMemoItemID.Text != "0")
{
clsDetails.DebitMemoItemID = Convert.ToInt64(lblDebitMemoItemID.Text);
clsDebitMemoItems.Update(clsDetails);
}
else
clsDebitMemoItems.Insert(clsDetails);
DebitMemoDetails clsDebitMemoDetails = new DebitMemoDetails();
clsDebitMemoDetails.DebitMemoID = clsDetails.DebitMemoID;
clsDebitMemoDetails.DiscountApplied = Convert.ToDecimal(txtPODebitMemoDiscountApplied.Text);
clsDebitMemoDetails.DiscountType = (DiscountTypes)Enum.Parse(typeof(DiscountTypes), cboPODebitMemoDiscountType.SelectedItem.Value);
clsDebitMemoDetails.Discount2Applied = Convert.ToDecimal(txtPODebitMemoDiscount2Applied.Text);
clsDebitMemoDetails.Discount2Type = (DiscountTypes)Enum.Parse(typeof(DiscountTypes), cboPODebitMemoDiscount2Type.SelectedItem.Value);
clsDebitMemoDetails.Discount3Applied = Convert.ToDecimal(txtPODebitMemoDiscount3Applied.Text);
clsDebitMemoDetails.Discount3Type = (DiscountTypes)Enum.Parse(typeof(DiscountTypes), cboPODebitMemoDiscount3Type.SelectedItem.Value);
DebitMemos clsDebitMemos = new DebitMemos(clsDebitMemoItems.Connection, clsDebitMemoItems.Transaction);
clsDebitMemos.UpdateDiscount(clsDetails.DebitMemoID, clsDebitMemoDetails.DiscountApplied, clsDebitMemoDetails.DiscountType, clsDebitMemoDetails.Discount2Applied, clsDebitMemoDetails.Discount2Type, clsDebitMemoDetails.Discount3Applied, clsDebitMemoDetails.Discount3Type);
//.........这里部分代码省略.........
示例7: LoadOptions
private void LoadOptions()
{
lblMatrixID.Text = Common.Decrypt((string)Request.QueryString["matrixid"],Session.SessionID);
lblProductID.Text = Common.Decrypt((string)Request.QueryString["prodid"],Session.SessionID);
ProductUnitsMatrix clsUnit = new ProductUnitsMatrix();
cboUnit.DataTextField = "BottomUnitName";
cboUnit.DataValueField = "BottomUnitID";
cboUnit.DataSource = clsUnit.ListAsDataTable(Convert.ToInt64(lblProductID.Text)).DefaultView;
cboUnit.DataBind();
cboUnit.SelectedIndex = cboUnit.Items.Count - 1;
clsUnit.CommitAndDispose();
Products clsProduct = new Products();
ProductDetails clsDetails = clsProduct.Details(Convert.ToInt64(lblProductID.Text));
cboUnit.Items.Add(new ListItem(clsDetails.BaseUnitName, clsDetails.BaseUnitID.ToString()));
cboUnit.SelectedIndex = cboUnit.Items.IndexOf(cboUnit.Items.FindByValue(clsDetails.BaseUnitID.ToString()));
txtProductPrice.Text = clsDetails.Price.ToString("#,##0.#0");
txtPurchasePrice.Text = clsDetails.PurchasePrice.ToString("#,##0.#0");
txtVAT.Text = clsDetails.VAT.ToString("#,##0.#0");
txtEVAT.Text = clsDetails.EVAT.ToString("#,##0.#0");
txtLocalTax.Text = clsDetails.LocalTax.ToString("#,##0.#0");
clsProduct.CommitAndDispose();
}
示例8: LoadRecord
private void LoadRecord()
{
Int64 iID = Convert.ToInt64(Common.Decrypt(Request.QueryString["id"],Session.SessionID));
Products clsProduct = new Products();
ProductDetails clsDetails = clsProduct.Details(iID);
Contacts clsContact = new Contacts(clsProduct.Connection, clsProduct.Transaction);
ContactDetails clsContactDetails = clsContact.Details(clsDetails.SupplierID);
clsProduct.CommitAndDispose();
lblProductID.Text = clsDetails.ProductID.ToString();
lblQuantity.Text = clsDetails.Quantity.ToString("#,##0.#0");
lblUnitCode.Text = clsDetails.BaseUnitCode;
lblProductCode.Text = clsDetails.ProductCode;
lblBarcode.Text = clsDetails.BarCode;
lblProductDesc.Text = clsDetails.ProductDesc;
lblProductGroup.Text = clsDetails.ProductGroupCode + "/" + clsDetails.ProductGroupName;
lblProductSubGroup.Text = clsDetails.ProductSubGroupCode + "/" + clsDetails.ProductSubGroupName;
lblSupplierCode.Text = clsContactDetails.ContactCode.ToString();
string stParam = "?task=" + Common.Encrypt("details",Session.SessionID) + "&id=" + Common.Encrypt(clsDetails.SupplierID.ToString(),Session.SessionID);
lblSupplierCode.NavigateUrl = Constants.ROOT_DIRECTORY + "/MasterFiles/_Contact/Default.aspx" + stParam;
lblSupplierContact.Text = clsContactDetails.BusinessName;
lblSupplierTelephoneNo.Text = clsContactDetails.TelephoneNo;
cboChartOfAccountPurchase.SelectedIndex = cboChartOfAccountPurchase.Items.IndexOf(cboChartOfAccountPurchase.Items.FindByValue(clsDetails.ChartOfAccountIDPurchase.ToString()));
cboChartOfAccountSold.SelectedIndex = cboChartOfAccountSold.Items.IndexOf(cboChartOfAccountSold.Items.FindByValue(clsDetails.ChartOfAccountIDSold.ToString()));
cboChartOfAccountInventory.SelectedIndex = cboChartOfAccountInventory.Items.IndexOf(cboChartOfAccountInventory.Items.FindByValue(clsDetails.ChartOfAccountIDInventory.ToString()));
cboChartOfAccountIDTaxPurchase.SelectedIndex = cboChartOfAccountIDTaxPurchase.Items.IndexOf(cboChartOfAccountIDTaxPurchase.Items.FindByValue(clsDetails.ChartOfAccountIDTaxPurchase.ToString()));
cboChartOfAccountIDTaxSold.SelectedIndex = cboChartOfAccountIDTaxSold.Items.IndexOf(cboChartOfAccountIDTaxSold.Items.FindByValue(clsDetails.ChartOfAccountIDTaxSold.ToString()));
}
示例9: imgProductQuickAdd_Click
protected void imgProductQuickAdd_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
try
{
if (!string.IsNullOrEmpty(txtProductCode.Text))
{
ProductDetails clsDetails = new ProductDetails();
clsDetails.ProductCode = txtProductCode.Text;
clsDetails.BarCode = txtProductCode.Text;
clsDetails.ProductDesc = txtProductCode.Text;
clsDetails.ProductGroupID = ProductGroup.DEFAULT_GROUP_ID;
clsDetails.ProductSubGroupID = ProductSubGroup.DEFAULT_SUB_GROUP_ID;
clsDetails.BaseUnitID = Data.Unit.DEFAULT_UNIT_ID;
clsDetails.Price = 0;
clsDetails.PurchasePrice = 0;
clsDetails.IncludeInSubtotalDiscount = true;
clsDetails.VAT = Constants.DEFAULTS_VAT;
clsDetails.EVAT = 0;
clsDetails.LocalTax = 0;
clsDetails.Quantity = 0;
clsDetails.MinThreshold = 0;
clsDetails.MaxThreshold = 0;
clsDetails.SupplierID = Contacts.DEFAULT_SUPPLIER_ID;
clsDetails.IsItemSold = true;
clsDetails.WillPrintProductComposition = false;
Products clsProduct = new Products();
long id = clsProduct.Insert(clsDetails);
clsDetails.ProductID = id;
long lngUID = long.Parse(Session["UID"].ToString());
InvAdjustmentDetails clsInvAdjustmentDetails = new InvAdjustmentDetails();
clsInvAdjustmentDetails.UID = lngUID;
clsInvAdjustmentDetails.InvAdjustmentDate = DateTime.Now;
clsInvAdjustmentDetails.ProductID = id;
clsInvAdjustmentDetails.ProductCode = clsDetails.ProductCode;
clsInvAdjustmentDetails.Description = clsDetails.ProductDesc;
clsInvAdjustmentDetails.VariationMatrixID = 0;
clsInvAdjustmentDetails.MatrixDescription = null;
clsInvAdjustmentDetails.UnitID = clsDetails.BaseUnitID;
clsInvAdjustmentDetails.UnitCode = cboProductUnit.SelectedItem.Text;
clsInvAdjustmentDetails.QuantityBefore = 0;
clsInvAdjustmentDetails.QuantityNow = clsDetails.Quantity;
clsInvAdjustmentDetails.MinThresholdBefore = 0;
clsInvAdjustmentDetails.MinThresholdNow = clsDetails.MinThreshold;
clsInvAdjustmentDetails.MaxThresholdBefore = 0;
clsInvAdjustmentDetails.MaxThresholdNow = clsDetails.MaxThreshold;
clsInvAdjustmentDetails.Remarks = "newly added. beginning balance.";
InvAdjustment clsInvAdjustment = new InvAdjustment(clsProduct.Connection, clsProduct.Transaction);
clsInvAdjustment.Insert(clsInvAdjustmentDetails);
clsProduct.InheritSubGroupVariations(clsDetails.ProductSubGroupID, clsDetails.ProductID);
clsProduct.CommitAndDispose();
cmdProductCode_Click(null, null);
}
}
catch { }
}
示例10: LoadRecord
private void LoadRecord()
{
long ProductID = Int64.Parse(lblProductID.Text);
long MatrixID = Int64.Parse(lblMatrixID.Text);
Products clsProducts = new Products();
ProductDetails clsDetails = clsProducts.Details(ProductID: ProductID, MatrixID: MatrixID);
clsProducts.CommitAndDispose();
cboUnit.SelectedIndex = cboUnit.Items.IndexOf(cboUnit.Items.FindByValue(clsDetails.BaseUnitID.ToString()));
txtProductPrice.Text = clsDetails.Price.ToString("#,##0.#0");
txtPurchasePrice.Text = clsDetails.PurchasePrice.ToString("#,##0.#0");
chkIncludeInSubtotalDiscount.Checked = clsDetails.IncludeInSubtotalDiscount;
txtVAT.Text = clsDetails.VAT.ToString("#,##0.#0");
txtEVAT.Text = clsDetails.EVAT.ToString("#,##0.#0");
txtLocalTax.Text = clsDetails.LocalTax.ToString("#,##0.#0");
txtQuantity.Text = clsDetails.Quantity.ToString("#,##0.#0");
txtMinThreshold.Text = clsDetails.MinThreshold.ToString("#,##0.#0");
txtMaxThreshold.Text = clsDetails.MaxThreshold.ToString("#,##0.#0");
}
示例11: UpdateQuantityByRID
private void UpdateQuantityByRID()
{
long lngProductID = 0;
try {
lngProductID = long.Parse(cboProductCode.SelectedValue);
if (lngProductID != 0)
{
Products clsProduct = new Products();
txtQuantity.Text = clsProduct.getReorderQtyByRID(lngProductID, Convert.ToDateTime(txtIDCStartDate.Text + " 00:00:00"), Convert.ToDateTime(txtIDCEndDate.Text + " 23:59:59")).ToString("#,##0.##0");
clsProduct.CommitAndDispose();
ComputeItemAmount();
}
}
catch { }
}
示例12: SetParameters
private void SetParameters (ReportDocument Report)
{
ParameterFieldDefinition paramField;
ParameterValues currentValues;
ParameterDiscreteValue discreteParam;
paramField = Report.DataDefinition.ParameterFields["CompanyName"];
discreteParam = new ParameterDiscreteValue();
discreteParam.Value = CompanyDetails.CompanyName;
currentValues = new ParameterValues();
currentValues.Add(discreteParam);
paramField.ApplyCurrentValues(currentValues);
paramField = Report.DataDefinition.ParameterFields["PrintedBy"];
discreteParam = new ParameterDiscreteValue();
discreteParam.Value = Session["Name"].ToString();
currentValues = new ParameterValues();
currentValues.Add(discreteParam);
paramField.ApplyCurrentValues(currentValues);
DateTime StartTransactionDate = DateTime.MinValue;
try
{ StartTransactionDate = Convert.ToDateTime(txtStartDate.Text + " " + txtStartTime.Text); }
catch { }
paramField = Report.DataDefinition.ParameterFields["StartTransactionDate"];
discreteParam = new ParameterDiscreteValue();
discreteParam.Value = StartTransactionDate;
currentValues = new ParameterValues();
currentValues.Add(discreteParam);
paramField.ApplyCurrentValues(currentValues);
DateTime EndTransactionDate = DateTime.MinValue;
try
{ EndTransactionDate = Convert.ToDateTime(txtEndDate.Text + " " + txtEndTime.Text); }
catch { }
paramField = Report.DataDefinition.ParameterFields["EndTransactionDate"];
discreteParam = new ParameterDiscreteValue();
discreteParam.Value = EndTransactionDate;
currentValues = new ParameterValues();
currentValues.Add(discreteParam);
paramField.ApplyCurrentValues(currentValues);
switch (cboReportType.SelectedValue)
{
case ReportTypes.ProductHistoryMovement:
#region Product History Movement
Products clsProduct = new Products();
long lngMatrixID = Convert.ToInt64(cboVariation.SelectedItem.Value);
lngMatrixID = lngMatrixID == -1 ? 0 : lngMatrixID;
ProductDetails clsDetails = clsProduct.Details(Convert.ToInt64(cboProductCode.SelectedItem.Value), lngMatrixID, Constants.BRANCH_ID_MAIN);
clsProduct.CommitAndDispose();
paramField = Report.DataDefinition.ParameterFields["ProductCode"];
discreteParam = new ParameterDiscreteValue();
discreteParam.Value = clsDetails.ProductCode;
currentValues = new ParameterValues();
currentValues.Add(discreteParam);
paramField.ApplyCurrentValues(currentValues);
paramField = Report.DataDefinition.ParameterFields["Description"];
discreteParam = new ParameterDiscreteValue();
discreteParam.Value = clsDetails.ProductDesc;
currentValues = new ParameterValues();
currentValues.Add(discreteParam);
paramField.ApplyCurrentValues(currentValues);
paramField = Report.DataDefinition.ParameterFields["Quantity"];
discreteParam = new ParameterDiscreteValue();
discreteParam.Value = clsDetails.Quantity.ToString("#,###.#0");
currentValues = new ParameterValues();
currentValues.Add(discreteParam);
paramField.ApplyCurrentValues(currentValues);
paramField = Report.DataDefinition.ParameterFields["UnitCode"];
discreteParam = new ParameterDiscreteValue();
discreteParam.Value = clsDetails.BaseUnitCode;
currentValues = new ParameterValues();
currentValues.Add(discreteParam);
paramField.ApplyCurrentValues(currentValues);
paramField = Report.DataDefinition.ParameterFields["ConvertedQuantity"];
discreteParam = new ParameterDiscreteValue();
discreteParam.Value = clsDetails.ConvertedQuantity;
currentValues = new ParameterValues();
currentValues.Add(discreteParam);
paramField.ApplyCurrentValues(currentValues);
break;
#endregion
case ReportTypes.ProductHistoryMostSaleable:
case ReportTypes.ProductHistoryLeastSaleable:
paramField = Report.DataDefinition.ParameterFields["GroupItems"];
discreteParam = new ParameterDiscreteValue();
discreteParam.Value = chkGroupItems.Checked;
currentValues = new ParameterValues();
currentValues.Add(discreteParam);
paramField.ApplyCurrentValues(currentValues);
break;
case ReportTypes.ProductsInDemoReport:
break;
}
//.........这里部分代码省略.........
示例13: LoadItemData
private void LoadItemData()
{
try
{
string strSearchKey = Constants.MaskProductSearch + txtSearch.Text;
Products clsProduct = new Products();
// System.Data.DataTable dt = clsProduct.ListAsDataTable(mclsTerminalDetails.BranchID, clsSearchKeys: new ProductDetails(), mboShowInActiveProducts ? ProductListFilterType.ShowInactiveOnly : ProductListFilterType.ShowActiveOnly, Limit: 100,
System.Data.DataTable dt = clsProduct.ListAsDataTableFE(mclsTerminalDetails.BranchID, strSearchKey, mboShowInActiveProducts ? ProductListFilterType.ShowActiveAndInactive : ProductListFilterType.ShowActiveOnly, 100, mboShowItemMoreThanZeroQty);
clsProduct.CommitAndDispose();
this.dgStyle.MappingName = dt.TableName;
dgItems.DataSource = dt;
dgItems.Select(0);
dgItems.CurrentRowIndex=0;
ShowProductTotalQuantity();
}
catch (IndexOutOfRangeException) { lblProductCode.Visible = false; lblProductQuantity.Visible = false; }
catch (Exception ex)
{
MessageBox.Show(ex.Message,"RetailPlus",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
}
示例14: cboVariation_SelectedIndexChanged
protected void cboVariation_SelectedIndexChanged(object sender, System.EventArgs e)
{
long MatrixID = Convert.ToInt64(cboVariation.SelectedItem.Value);
if (MatrixID != 0)
{
long ProductID = Convert.ToInt64(cboProductCode.SelectedItem.Value);
Products clsProducts = new Products();
ProductDetails clsDetails = clsProducts.Details(ProductID: ProductID, MatrixID: MatrixID);
clsProducts.CommitAndDispose();
txtPrice.Text = clsDetails.WSPrice.ToString("####0.#0");
txtSellingPrice.Text = clsDetails.Price.ToString("#####0.#0");
decimal decMargin = clsDetails.Price - clsDetails.WSPrice;
try { decMargin = decMargin / clsDetails.WSPrice; }
catch { decMargin = 1; }
decMargin = decMargin * 100;
txtMargin.Text = decMargin.ToString("#,##0.##0");
txtVAT.Text = clsDetails.VAT.ToString("#,##0.#0");
txtEVAT.Text = clsDetails.EVAT.ToString("#,##0.#0");
txtLocalTax.Text = clsDetails.LocalTax.ToString("#,##0.#0");
if (clsDetails.VAT > 0)
chkIsTaxable.Checked = true;
else
chkIsTaxable.Checked = false;
ComputeItemAmount();
}
}
示例15: SaveRecord
private void SaveRecord()
{
SOItemDetails clsDetails = new SOItemDetails();
Products clsProducts = new Products();
ProductDetails clsProductDetails = clsProducts.Details1(Constants.BRANCH_ID_MAIN, Convert.ToInt64(cboProductCode.SelectedItem.Value));
Terminal clsTerminal = new Terminal(clsProducts.Connection, clsProducts.Transaction);
TerminalDetails clsTerminalDetails = clsTerminal.Details(Int32.Parse(Session["BranchID"].ToString()), Session["TerminalNo"].ToString());
clsProducts.CommitAndDispose();
clsDetails.SOID = Convert.ToInt64(lblSOID.Text);
clsDetails.ProductID = Convert.ToInt64(cboProductCode.SelectedItem.Value);
clsDetails.ProductCode = clsProductDetails.ProductCode;
clsDetails.BarCode = clsProductDetails.BarCode;
clsDetails.Description = clsProductDetails.ProductDesc;
clsDetails.ProductUnitID = Convert.ToInt32(cboProductUnit.SelectedItem.Value);
clsDetails.ProductUnitCode = cboProductUnit.SelectedItem.Text;
clsDetails.Quantity = Convert.ToDecimal(txtQuantity.Text);
clsDetails.UnitCost = Convert.ToDecimal(txtPrice.Text);
clsDetails.Discount = getItemTotalDiscount();
clsDetails.DiscountApplied = Convert.ToDecimal(txtDiscount.Text);
if (clsDetails.DiscountApplied == 0)
{
if (chkInPercent.Checked == true)
clsDetails.DiscountType = DiscountTypes.Percentage;
else
clsDetails.DiscountType = DiscountTypes.FixedValue;
}
else
{
clsDetails.DiscountType = DiscountTypes.NotApplicable;
}
clsDetails.IsVatable = chkIsTaxable.Checked;
clsDetails.Amount = ComputeItemAmount();
if (clsDetails.IsVatable)
{
clsDetails.VatableAmount = clsDetails.Amount;
clsDetails.EVatableAmount = clsDetails.Amount;
clsDetails.LocalTax = clsDetails.Amount;
if (clsTerminalDetails.IsVATInclusive == false)
{
if (clsDetails.VatableAmount < clsDetails.Discount) clsDetails.VatableAmount = 0;
if (clsDetails.EVatableAmount < clsDetails.Discount) clsDetails.EVatableAmount = 0;
if (clsDetails.LocalTax < clsDetails.Discount) clsDetails.LocalTax = 0;
}
else
{
if (clsDetails.VatableAmount >= clsDetails.Discount) clsDetails.VatableAmount = (clsDetails.VatableAmount) / (1 + (clsTerminalDetails.VAT / 100)); else clsDetails.VatableAmount = 0;
if (clsDetails.EVatableAmount >= clsDetails.Discount) clsDetails.EVatableAmount = (clsDetails.EVatableAmount) / (1 + (clsTerminalDetails.VAT / 100)); else clsDetails.EVatableAmount = 0;
if (clsDetails.LocalTax >= clsDetails.Discount) clsDetails.LocalTax = (clsDetails.LocalTax) / (1 + (clsTerminalDetails.LocalTax / 100)); else clsDetails.LocalTax = 0;
}
clsDetails.VAT = clsDetails.VatableAmount * (clsTerminalDetails.VAT / 100);
clsDetails.EVAT = clsDetails.EVatableAmount * (clsTerminalDetails.EVAT / 100);
clsDetails.LocalTax = clsDetails.LocalTax * (clsTerminalDetails.LocalTax / 100);
//if (!clsTerminalDetails.IsVATInclusive) clsDetails.Amount += (clsDetails.VAT + clsDetails.LocalTax);
//if (!clsTerminalDetails.EnableEVAT) clsDetails.Amount += clsDetails.EVAT;
}
else
{
clsDetails.VAT = 0;
clsDetails.VatableAmount = 0;
clsDetails.EVAT = 0;
clsDetails.EVatableAmount = 0;
clsDetails.LocalTax = 0;
}
clsDetails.isVATInclusive = clsTerminalDetails.IsVATInclusive;
clsDetails.VariationMatrixID = Convert.ToInt64(cboVariation.SelectedItem.Value);
if (clsDetails.VariationMatrixID != 0)
clsDetails.MatrixDescription = cboVariation.SelectedItem.Text;
clsDetails.ProductGroup = clsProductDetails.ProductGroupCode;
clsDetails.ProductSubGroup = clsProductDetails.ProductSubGroupCode;
clsDetails.Remarks = txtRemarks.Text;
// Added Jul 1, 2010 4:20PM : for suggested selling information
clsDetails.SellingPrice = decimal.Parse(txtSellingPrice.Text);
clsDetails.SellingVAT = decimal.Parse(txtVAT.Text);
clsDetails.SellingEVAT = decimal.Parse(txtEVAT.Text);
clsDetails.SellingLocalTax = decimal.Parse(txtLocalTax.Text);
SOItem clsSOItem = new SOItem();
if (lblSOItemID.Text != "0")
{
clsDetails.SOItemID = Convert.ToInt64(lblSOItemID.Text);
clsSOItem.Update(clsDetails);
}
else
clsSOItem.Insert(clsDetails);
SODetails clsSODetails = new SODetails();
clsSODetails.SOID = clsDetails.SOID;
clsSODetails.DiscountApplied = Convert.ToDecimal(txtSODiscountApplied.Text);
clsSODetails.DiscountType = (DiscountTypes)Enum.Parse(typeof(DiscountTypes), cboSODiscountType.SelectedItem.Value);
//.........这里部分代码省略.........