本文整理汇总了C#中AceSoft.RetailPlus.Data.Products.UpdateProductReorderOverStockPerSupplier方法的典型用法代码示例。如果您正苦于以下问题:C# Products.UpdateProductReorderOverStockPerSupplier方法的具体用法?C# Products.UpdateProductReorderOverStockPerSupplier怎么用?C# Products.UpdateProductReorderOverStockPerSupplier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AceSoft.RetailPlus.Data.Products
的用法示例。
在下文中一共展示了Products.UpdateProductReorderOverStockPerSupplier方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateItemsForReorderByRID
public void GenerateItemsForReorderByRID(Int32 TerminalID, long POID, long RID, DateTime IDC_StartDate, DateTime IDC_EndDate)
{
try
{
GetConnection();
Terminal clsTerminal = new Terminal(base.Connection, base.Transaction);
TerminalDetails clsTerminalDetails = clsTerminal.Details(TerminalID);
PODetails clsPODetails = Details(POID);
Products clsProduct = new Products(base.Connection, base.Transaction);
// Aug 26, 2011 :Lemu
// Insert UpdateProductReorderOverStockPerSupplier to update the MinThreshold & MaxThreshold using RID before getting the for stocking
clsProduct.UpdateProductReorderOverStockPerSupplier(clsPODetails.SupplierID, RID, IDC_StartDate, IDC_EndDate);
// end
POItem clsPOItem = new POItem(base.Connection, base.Transaction);
ProductInventories clsProductInventories = new ProductInventories(base.Connection, base.Transaction);
System.Data.DataTable dt = clsProductInventories.ListAsDataTable(BranchID: Constants.BRANCH_ID_MAIN, SupplierID: clsPODetails.SupplierID, ForReorder: 1);
foreach (System.Data.DataRow dr in dt.Rows)
{
if (decimal.Round(Convert.ToDecimal(dr["RIDReorderQty"].ToString())) > 0)
{
POItemDetails clsDetails = new POItemDetails();
clsDetails.POID = POID;
clsDetails.ProductID = Convert.ToInt64(dr["ProductID"].ToString());
clsDetails.ProductCode = dr["ProductCode"].ToString();
clsDetails.BarCode = dr["BarCode"].ToString();
clsDetails.Description = dr["ProductDesc"].ToString();
clsDetails.ProductGroup = dr["ProductGroupCode"].ToString();
clsDetails.ProductSubGroup = dr["ProductSubGroupCode"].ToString();
clsDetails.ProductUnitID = Convert.ToInt32(dr["UnitID"]);
clsDetails.ProductUnitCode = dr["UnitName"].ToString();
clsDetails.RID = Convert.ToInt64(dr["RID"]);
clsDetails.Quantity = decimal.Round(Convert.ToDecimal(dr["RIDReorderQty"]));
clsDetails.UnitCost = Convert.ToDecimal(dr["PurchasePrice"]);
clsDetails.Discount = 0;
clsDetails.DiscountApplied = 0;
clsDetails.DiscountType = DiscountTypes.Percentage;
clsDetails.Remarks = "added using auto generation";
decimal amount = clsDetails.Quantity * clsDetails.UnitCost;
// Added Sep 27, 2010 4:20PM : for selling information
clsDetails.SellingPrice = decimal.Parse(dr["Price"].ToString());
clsDetails.SellingVAT = clsTerminalDetails.VAT;
clsDetails.SellingEVAT = clsTerminalDetails.EVAT;
clsDetails.SellingLocalTax = clsTerminalDetails.LocalTax;
clsDetails.OldSellingPrice = clsDetails.SellingPrice;
if (Convert.ToDecimal(dr["VAT"]) > 0)
{
clsDetails.VatableAmount = amount;
clsDetails.EVatableAmount = amount;
clsDetails.LocalTax = amount;
clsDetails.VatableAmount = (clsDetails.VatableAmount) / (1 + (clsTerminalDetails.VAT / 100));
clsDetails.EVatableAmount = (clsDetails.EVatableAmount) / (1 + (clsTerminalDetails.VAT / 100));
clsDetails.LocalTax = (clsDetails.LocalTax) / (1 + (clsTerminalDetails.LocalTax / 100));
clsDetails.IsVatable = true;
}
else
{
clsDetails.VAT = 0;
clsDetails.VatableAmount = 0;
clsDetails.EVAT = 0;
clsDetails.EVatableAmount = 0;
clsDetails.LocalTax = 0;
clsDetails.IsVatable = false;
}
clsDetails.Amount = amount;
clsDetails.VariationMatrixID = Convert.ToInt64(dr["MatrixID"]);
clsDetails.MatrixDescription = dr["MatrixDescription"].ToString();
clsPOItem.Insert(clsDetails);
}
}
}
catch (Exception ex)
{
throw base.ThrowException(ex);
}
}
示例2: SetDataSource
private void SetDataSource(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;
DateTime dteIDCStartDate = DateTime.Now.AddDays(-14);
DateTime dteIDCEndDate = DateTime.Now;
try { dteIDCStartDate = Convert.ToDateTime(txtStartTransactionDate.Text + " " + txtStartTime.Text);}catch{}
try { dteIDCEndDate = Convert.ToDateTime(txtEndTransactionDate.Text + " " + txtEndTime.Text);}catch{}
Products clsProduct = new Products();
if (cboSupplier.SelectedItem.Text == Constants.ALL)
{
if (cboSubGroup.SelectedItem.Text == Constants.ALL)
{ clsProduct.UpdateProductReorderOverStockPerSubGroup(long.Parse(cboSubGroup.SelectedItem.Value), dteIDCStartDate, dteIDCEndDate); }
else if (cboSubGroup.SelectedItem.Text == Constants.ALL)
{ clsProduct.UpdateProductReorderOverStockPerGroup(long.Parse(cboGroup.SelectedItem.Value), dteIDCStartDate, dteIDCEndDate); }
else
{ clsProduct.UpdateProductReorderOverStock(dteIDCStartDate, dteIDCEndDate); }
}
else
{
if (cboSubGroup.SelectedItem.Text == Constants.ALL)
{ clsProduct.UpdateProductReorderOverStockPerSupplierPerSubGroup(long.Parse(cboSupplier.SelectedValue), long.Parse(cboSubGroup.SelectedItem.Value), dteIDCStartDate, dteIDCEndDate); }
else if (cboSubGroup.SelectedItem.Text == Constants.ALL)
{ clsProduct.UpdateProductReorderOverStockPerSupplierPerGroup(long.Parse(cboSupplier.SelectedValue), long.Parse(cboGroup.SelectedItem.Value), dteIDCStartDate, dteIDCEndDate); }
else
{ clsProduct.UpdateProductReorderOverStockPerSupplier(long.Parse(cboSupplier.SelectedValue), dteIDCStartDate, dteIDCEndDate); }
}
clsProduct.CommitAndDispose();
clsProduct = new Products();
System.Data.DataTable dt = (clsProduct.SearchDataTable(ProductListFilterType.ShowActiveOnly, string.Empty, long.Parse(cboSupplier.SelectedValue),
long.Parse(cboGroup.SelectedItem.Value), string.Empty, long.Parse(cboSubGroup.SelectedItem.Value), string.Empty, 0, false, false, string.Empty, SortOption.Ascending));
clsProduct.CommitAndDispose();
foreach(System.Data.DataRow dr in dt.Rows)
{
DataRow drProducts = rptds.Products.NewRow();
foreach (DataColumn dc in rptds.Products.Columns)
drProducts[dc] = dr[dc.ColumnName];
rptds.Products.Rows.Add(drProducts);
}
//ProductVariationsMatrix clsMatrix = new ProductVariationsMatrix(clsProduct.Connection, clsProduct.Transaction);
//rptds.Tables.Add(clsMatrix.BaseListAsDataTable(0, "a.ProductID", SortOption.Ascending));
// ds.Tables.Add(clsMatrix.ForReorder("a.Quantity", SortOption.Ascending));
Report.SetDataSource(rptds);
SetParameters(Report);
}