本文整理汇总了C#中AceSoft.RetailPlus.Data.Products.UpdateBarcode方法的典型用法代码示例。如果您正苦于以下问题:C# Products.UpdateBarcode方法的具体用法?C# Products.UpdateBarcode怎么用?C# Products.UpdateBarcode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AceSoft.RetailPlus.Data.Products
的用法示例。
在下文中一共展示了Products.UpdateBarcode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Upload1
private void Upload1()
{
//string fn = System.IO.Path.GetFileName(TextBox1.Text);
//string SaveLocation = "/RetailPlus/temp/uploaded_" + fn;
//System.IO.File.Copy(TextBox1.Text, SaveLocation);
//txtPath.PostedFile.SaveAs(SaveLocation);
XmlTextReader xmlReader = new XmlTextReader(TextBox1.Text);
xmlReader.WhitespaceHandling = WhitespaceHandling.None;
Branch clsBranch = new Branch();
BranchDetails clsBranchDetails = clsBranch.Details(Convert.ToInt16(cboBranchUpload.SelectedItem.Value.ToString()));
clsBranch.CommitAndDispose();
RemoteBranchInventory clsBranchInventory = new RemoteBranchInventory();
clsBranchInventory.GetConnectionToBranch(clsBranchDetails.DBIP);
Contacts clsBranchContact = new Contacts(clsBranchInventory.Connection, clsBranchInventory.Transaction);
ContactDetails clsBranchContactDetails;
ContactGroups clsBranchContactGroup = new ContactGroups(clsBranchInventory.Connection, clsBranchInventory.Transaction);
ContactGroupDetails clsContactGroupDetails;
Data.Unit clsBranchUnit = new Data.Unit(clsBranchInventory.Connection, clsBranchInventory.Transaction);
UnitDetails clsUnitDetails;
ProductGroup clsBranchProductGroup = new Data.ProductGroup(clsBranchInventory.Connection, clsBranchInventory.Transaction);
ProductGroupDetails clsBranchProductGroupDetails;
ProductSubGroup clsBranchProductSubGroup = new Data.ProductSubGroup(clsBranchInventory.Connection, clsBranchInventory.Transaction);
ProductSubGroupDetails clsBranchProductSubGroupDetails;
//Data.Variation clsBranchVariation = new Variation(clsBranchInventory.Connection, clsBranchInventory.Transaction);
Products clsBranchProduct = new Products(clsBranchInventory.Connection, clsBranchInventory.Transaction);
ProductDetails clsBranchProductDetails;
ProductVariations clsBranchProductVariation = new ProductVariations(clsBranchInventory.Connection, clsBranchInventory.Transaction);
ProductVariationDetails clsBranchProductVariationDetails;
long lngBranchProductID = 0; long lngProductCtr = 0; long lngProductInserted = 0;
while (xmlReader.Read())
{
switch (xmlReader.NodeType)
{
case XmlNodeType.Element:
if (xmlReader.Name == "Item")
{
lngProductCtr++;
clsBranchProductDetails = new ProductDetails();
clsBranchProductDetails.BarCode = xmlReader.GetAttribute("BarCode");
clsBranchProductDetails.ProductCode = xmlReader.GetAttribute("ProductCode");
lblError.Text += "Checking <b>" + clsBranchProductDetails.ProductCode + "</b> if exist... ";
//check product by barcode
clsBranchProductDetails.ProductID = clsBranchProduct.Details(Constants.BRANCH_ID_MAIN, clsBranchProductDetails.BarCode).ProductID;
lngBranchProductID = clsBranchProductDetails.ProductID;
if (clsBranchProductDetails.ProductID != 0)
{
lblError.Text += " [Y] barcode exist... next item...<br />";
break;
}
//check product by product code
clsBranchProductDetails.ProductID = clsBranchProduct.Details(Constants.BRANCH_ID_MAIN, clsBranchProductDetails.ProductCode).ProductID;
lngBranchProductID = clsBranchProductDetails.ProductID;
if (clsBranchProductDetails.ProductID != 0)
{
clsBranchProduct.UpdateBarcode(clsBranchProductDetails.ProductID, clsBranchProductDetails.BarCode);
lblError.Text += " [Y] barcode not exist, product code exist. barcode updated. next item...<br />";
break;
}
lblError.Text += " [N] inserting product... ";
clsBranchProductDetails.BarCode = xmlReader.GetAttribute("BarCode");
clsBranchProductDetails.ProductDesc = xmlReader.GetAttribute("ProductDesc");
clsBranchProductDetails.ProductGroupCode = xmlReader.GetAttribute("ProductGroupCode");
clsBranchProductDetails.ProductGroupName = xmlReader.GetAttribute("ProductGroupName");
clsBranchProductDetails.ProductSubGroupCode = xmlReader.GetAttribute("ProductSubGroupCode");
clsBranchProductDetails.ProductSubGroupName = xmlReader.GetAttribute("ProductSubGroupName");
clsBranchProductDetails.BaseUnitCode = xmlReader.GetAttribute("BaseUnitCode");
clsBranchProductDetails.BaseUnitName = xmlReader.GetAttribute("BaseUnitName");
clsBranchProductDetails.DateCreated = DateTime.Now;
clsBranchProductDetails.Price = Convert.ToDecimal(xmlReader.GetAttribute("Price"));
clsBranchProductDetails.PurchasePrice = Convert.ToDecimal(xmlReader.GetAttribute("PurchasePrice"));
clsBranchProductDetails.IncludeInSubtotalDiscount = Convert.ToBoolean(xmlReader.GetAttribute("IncludeInSubtotalDiscount"));
clsBranchProductDetails.VAT = Convert.ToDecimal(xmlReader.GetAttribute("VAT"));
clsBranchProductDetails.EVAT = Convert.ToDecimal(xmlReader.GetAttribute("EVAT"));
clsBranchProductDetails.LocalTax = Convert.ToDecimal(xmlReader.GetAttribute("LocalTax"));
clsBranchProductDetails.Quantity = 0;
clsBranchProductDetails.MinThreshold = Convert.ToDecimal(xmlReader.GetAttribute("MinThreshold"));
clsBranchProductDetails.MaxThreshold = Convert.ToDecimal(xmlReader.GetAttribute("MaxThreshold"));
clsBranchProductDetails.ChartOfAccountIDPurchase = int.Parse(xmlReader.GetAttribute("ChartOfAccountIDPurchase"));
clsBranchProductDetails.ChartOfAccountIDSold = int.Parse(xmlReader.GetAttribute("ChartOfAccountIDSold"));
clsBranchProductDetails.ChartOfAccountIDInventory = int.Parse(xmlReader.GetAttribute("ChartOfAccountIDInventory"));
clsBranchProductDetails.ChartOfAccountIDTaxPurchase = int.Parse(xmlReader.GetAttribute("ChartOfAccountIDTaxPurchase"));
clsBranchProductDetails.ChartOfAccountIDTaxSold = int.Parse(xmlReader.GetAttribute("ChartOfAccountIDTaxSold"));
//.........这里部分代码省略.........
示例2: Import
//.........这里部分代码省略.........
UnitID = clsProductDetails.BaseUnitID
};
clsProductGroupDetails.Price = clsProductDetails.Price;
clsProductGroupDetails.PurchasePrice = clsProductDetails.PurchasePrice;
clsProductGroupDetails.IncludeInSubtotalDiscount = clsProductDetails.IncludeInSubtotalDiscount;
clsProductGroupDetails.VAT = clsProductDetails.VAT;
clsProductGroupDetails.EVAT = clsProductDetails.EVAT;
clsProductGroupDetails.LocalTax = clsProductDetails.LocalTax;
clsProductDetails.ProductGroupID = clsProductGroup.Insert(clsProductGroupDetails);
}
clsProductDetails.ProductSubGroupID = clsProductSubGroup.Details(clsProductDetails.ProductSubGroupCode).ProductSubGroupID;
if (clsProductDetails.ProductSubGroupID == 0)
{
clsProductSubGroupDetails = new ProductSubGroupDetails();
clsProductSubGroupDetails.ProductGroupID = clsProductDetails.ProductGroupID;
clsProductSubGroupDetails.ProductSubGroupCode = clsProductDetails.ProductSubGroupCode;
clsProductSubGroupDetails.ProductSubGroupName = clsProductDetails.ProductSubGroupName;
clsProductSubGroupDetails.BaseUnitID = clsProductDetails.BaseUnitID;
clsProductSubGroupDetails.Price = clsProductDetails.Price;
clsProductSubGroupDetails.PurchasePrice = clsProductDetails.PurchasePrice;
clsProductSubGroupDetails.IncludeInSubtotalDiscount = clsProductDetails.IncludeInSubtotalDiscount;
clsProductSubGroupDetails.VAT = clsProductDetails.VAT;
clsProductSubGroupDetails.EVAT = clsProductDetails.EVAT;
clsProductSubGroupDetails.LocalTax = clsProductDetails.LocalTax;
clsProductDetails.ProductSubGroupID = clsProductSubGroup.Insert(clsProductSubGroupDetails);
}
clsTransferOutItemDetails.ProductID = clsProduct.Insert(clsProductDetails);
}
else
{
//product code already exist but not the same barcode
clsProduct.UpdateBarcode(clsTransferOutItemDetails.ProductID, clsTransferOutItemDetails.BarCode);
}
lngProductID = clsTransferOutItemDetails.ProductID;
}
clsTransferOutItem.Insert(clsTransferOutItemDetails);
clsTransferOutDetails = new TransferOutDetails();
clsTransferOutDetails.TransferOutID = clsTransferOutItemDetails.TransferOutID;
clsTransferOutDetails.DiscountApplied = Convert.ToDecimal(txtTransferOutDiscountApplied.Text);
clsTransferOutDetails.DiscountType = (DiscountTypes)Enum.Parse(typeof(DiscountTypes), cboTransferOutDiscountType.SelectedItem.Value);
clsTransferOutDetails.Discount2Applied = Convert.ToDecimal(txtTransferOutDiscount2Applied.Text);
clsTransferOutDetails.Discount2Type = (DiscountTypes)Enum.Parse(typeof(DiscountTypes), cboTransferOutDiscount2Type.SelectedItem.Value);
clsTransferOutDetails.Discount3Applied = Convert.ToDecimal(txtTransferOutDiscount2Applied.Text);
clsTransferOutDetails.Discount3Type = (DiscountTypes)Enum.Parse(typeof(DiscountTypes), cboTransferOutDiscount3Type.SelectedItem.Value);
clsTransferOut = new TransferOut(clsTransferOutItem.Connection, clsTransferOutItem.Transaction);
clsTransferOut.UpdateDiscount(clsTransferOutItemDetails.TransferOutID, clsTransferOutDetails.DiscountApplied, clsTransferOutDetails.DiscountType, clsTransferOutDetails.Discount2Applied, clsTransferOutDetails.Discount2Type, clsTransferOutDetails.Discount3Applied, clsTransferOutDetails.Discount3Type);
clsTransferOutDetails = clsTransferOut.Details(clsTransferOutItemDetails.TransferOutID);
UpdateFooter(clsTransferOutDetails);
lngProductCtr++;
}
else if (xmlReader.Name == "Variation")
{
if (lngProductID != 0)
{
clsProductVariationDetails = new ProductVariationDetails();
clsProductVariationDetails.VariationID = clsProductVariation.Details(lngProductID, xmlReader.GetAttribute("VariationCode")).VariationID;
示例3: SynchronizeFromBranch
private void SynchronizeFromBranch()
{
try
{
lblError.Text = string.Empty;
Branch clsBranch = new Branch();
BranchDetails clsBranchDetails = clsBranch.Details(Convert.ToInt16(cboSynchronizeFromBranch.SelectedItem.Value.ToString()));
clsBranch.CommitAndDispose();
if (IPAddress.IsOpen(clsBranchDetails.DBIP, int.Parse(clsBranchDetails.DBPort)) == false)
{
lblError.Text = "Sorry cannot connect to Branch '" + cboSynchronizeFromBranch.SelectedItem.Text + "'. Please check you connection to IP Address :" + clsBranchDetails.DBIP + ". <br /><br />";
lblError.Text += "HOW TO CHECK : <br /><br />";
lblError.Text += " 1. Open command prompt<br />";
lblError.Text += " 2. Type ping[space][IP Address]<br /><br />";
lblError.Text += "If the answer is 'Request timed out.' then contact system administrator.<br />";
lblError.Text += "Else if the answer is 'Reply...' Follow the next steps.<br /><br />";
lblError.Text += " 3. Type telnet[space][IP Address][sapce][IP Port]<br /><br />";
return;
}
Session.Timeout = 60 * 60 * 30;
Products clsProduct = new Products();
clsProduct.GetConnection();
ProductDetails clsProductDetails;
ContactGroups clsContactGroup = new ContactGroups(clsProduct.Connection, clsProduct.Transaction);
Contacts clsContact = new Contacts(clsProduct.Connection, clsProduct.Transaction);
Data.Unit clsUnit = new Data.Unit(clsProduct.Connection, clsProduct.Transaction);
Data.ProductGroup clsProductGroup = new Data.ProductGroup(clsProduct.Connection, clsProduct.Transaction);
Data.ProductSubGroup clsProductSubGroup = new Data.ProductSubGroup(clsProduct.Connection, clsProduct.Transaction);
Data.Variation clsVariation = new Variation(clsProduct.Connection, clsProduct.Transaction);
RemoteBranchInventory clsBranchInventory = new RemoteBranchInventory();
clsBranchInventory.GetConnectionToBranch(clsBranchDetails.DBIP, clsBranchDetails.DBPort);
Products clsBranchProduct = new Products(clsBranchInventory.Connection, clsBranchInventory.Transaction);
ProductDetails[] arrBranchProductDetails = clsBranchProduct.List();
ContactGroups clsBranchContactGroup = new ContactGroups(clsBranchInventory.Connection, clsBranchInventory.Transaction);
Contacts clsBranchContact = new Contacts(clsBranchInventory.Connection, clsBranchInventory.Transaction);
Data.Unit clsBranchUnit = new Data.Unit(clsBranchInventory.Connection, clsBranchInventory.Transaction);
Data.ProductGroup clsBranchProductGroup = new Data.ProductGroup(clsBranchInventory.Connection, clsBranchInventory.Transaction);
Data.ProductSubGroup clsBranchProductSubGroup = new Data.ProductSubGroup(clsBranchInventory.Connection, clsBranchInventory.Transaction);
Data.Variation clsBranchVariation = new Variation(clsBranchInventory.Connection, clsBranchInventory.Transaction);
foreach (ProductDetails clsBranchProductDetails in arrBranchProductDetails)
{
clsProductDetails = clsBranchProductDetails;
try
{
clsProductDetails.ProductID = clsProduct.Details(clsProductDetails.BarCode).ProductID;
if (clsProductDetails.ProductID != 0)
{
lblError.Text += clsProductDetails.BarCode + " already exist.<br /><br />";
clsProduct.UpdatePurchasing(clsProductDetails.ProductID, clsBranchProductDetails.MatrixID, clsProductDetails.SupplierID, clsProductDetails.BaseUnitID, clsProductDetails.PurchasePrice);
clsProduct.UpdateSellingPrice(clsProductDetails.ProductID, clsBranchProductDetails.MatrixID, clsProductDetails.SupplierID, clsProductDetails.BaseUnitID, clsProductDetails.Price, clsProductDetails.Price1, clsProductDetails.Price2, clsProductDetails.Price3, clsProductDetails.Price4, clsProductDetails.Price5);
}
else
{
clsProductDetails.ProductID = clsProduct.DetailsByCode(Constants.BRANCH_ID_MAIN, clsProductDetails.BarCode).ProductID;
if (clsProductDetails.ProductID != 0)
{
lblError.Text += clsProductDetails.ProductCode + " already exist.<br /><br />";
clsProduct.UpdateBarcode(clsProductDetails.ProductID, clsProductDetails.BarCode);
clsProduct.UpdatePurchasing(clsProductDetails.ProductID, clsBranchProductDetails.MatrixID, clsProductDetails.SupplierID, clsProductDetails.BaseUnitID, clsProductDetails.PurchasePrice);
clsProduct.UpdateSellingPrice(clsProductDetails.ProductID, clsBranchProductDetails.MatrixID, clsProductDetails.SupplierID, clsProductDetails.BaseUnitID, clsProductDetails.Price, clsProductDetails.Price1, clsProductDetails.Price2, clsProductDetails.Price3, clsProductDetails.Price4, clsProductDetails.Price5);
}
else
{
clsProductDetails.SupplierID = clsContact.Details(clsProductDetails.SupplierCode).ContactID;
if (clsProductDetails.SupplierID == 0)
{
ContactDetails clsBranchContactDetails = clsBranchContact.Details(clsProductDetails.SupplierCode);
if (clsContactGroup.Details(clsBranchContactDetails.ContactGroupID).ContactGroupID == 0)
{
ContactGroupDetails clsBranchContactGroupDetails = clsBranchContactGroup.Details(clsBranchContactDetails.ContactGroupID);
clsBranchContactDetails.ContactGroupID = clsContactGroup.Insert(clsBranchContactGroupDetails);
}
clsProductDetails.SupplierID = clsContact.Insert(clsBranchContactDetails);
}
clsProductDetails.BaseUnitID = clsUnit.Details(clsProductDetails.BaseUnitCode).UnitID;
if (clsProductDetails.BaseUnitID == 0)
{
UnitDetails clsBranchUnitDetails = clsBranchUnit.Details(clsBranchProductDetails.BaseUnitID);
clsProductDetails.BaseUnitID = clsUnit.Insert(clsBranchUnitDetails);
}
clsProductDetails.ProductGroupID = clsProductGroup.Details(clsProductDetails.ProductGroupCode).ProductGroupID;
if (clsProductDetails.ProductGroupID == 0)
{
ProductGroupDetails clsBranchProductGroupDetails = clsBranchProductGroup.Details(clsBranchProductDetails.ProductGroupID);
clsProductDetails.ProductGroupID = clsProductGroup.Insert(clsBranchProductGroupDetails);
}
clsProductDetails.ProductSubGroupID = clsProductSubGroup.Details(clsProductDetails.ProductSubGroupCode).ProductSubGroupID;
if (clsProductDetails.ProductSubGroupID == 0)
//.........这里部分代码省略.........