activity inventory占中是什么意思思

当前位置: &
& 查看源码
inventoryupdateactivity.cs
inventoryupdateactivity.cs:源码内容
//--------------------------------------------------------------------------------
//&This&file&is&part&of&the&downloadable&code&for&the&Apress&book:
//&Pro&WF:&Windows&Workflow&in&.NET&3.5
//&Copyright&(c)&Bruce&Bukovics.&&All&rights&reserved.
//&This&code&is&provided&as&is&without&warranty&of&any&kind,&either&expressed
//&or&implied,&including&but&not&limited&to&fitness&for&any&particular&purpose.&
//&You&may&use&the&code&for&any&commercial&or&noncommercial&purpose,&and&combine&
//&it&with&your&own&code,&but&cannot&reproduce&it&in&whole&or&in&part&for&
//&publication&purposes&without&prior&approval.&
//--------------------------------------------------------------------------------
using&System.D
using&System.Data.SqlC
using&System.C&&//needs&assembly&reference
using&ponentM
using&ponentM
namespace&SharedWorkflows
&&&&public&partial&class&InventoryUpdateActivity&:&Activity
&&&&&&&&///&&summary&
&&&&&&&&///&ItemId&Dependency&Property
&&&&&&&&///&&/summary&
&&&&&&&&public&static&DependencyProperty&ItemIdProperty
&&&&&&&&&&&&=&ponentModel.DependencyProperty.Register(
&&&&&&&&&&&&&&&&&ItemId&,&typeof(Int32),&typeof(InventoryUpdateActivity));
&&&&&&&&[Description(&Identifies&the&item&to&update&)]
&&&&&&&&[Category(&ProWorkflow&)]
&&&&&&&&[Browsable(true)]
&&&&&&&&[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
&&&&&&&&public&Int32&ItemId
&&&&&&&&&&&&get
&&&&&&&&&&&&{
&&&&&&&&&&&&&&&&return&((Int32)(base.GetValue(
&&&&&&&&&&&&&&&&&&&&InventoryUpdateActivity.ItemIdProperty)));
&&&&&&&&&&&&}
&&&&&&&&&&&&set
&&&&&&&&&&&&{
&&&&&&&&&&&&&&&&base.SetValue(InventoryUpdateActivity.ItemIdProperty,&value);
&&&&&&&&&&&&}
&&&&&&&&///&&summary&
&&&&&&&&///&Quantity&Dependency&Property
&&&&&&&&///&&/summary&
&&&&&&&&public&static&DependencyProperty&QuantityProperty
&&&&&&&&&&&&=&ponentModel.DependencyProperty.Register(
&&&&&&&&&&&&&&&&&Quantity&,&typeof(Int32),&typeof(InventoryUpdateActivity));
&&&&&&&&[Description(&The&quantity&of&the&item&to&remove&from&inventory&)]
&&&&&&&&[Category(&ProWorkflow&)]
&&&&&&&&[Browsable(true)]
&&&&&&&&[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
&&&&&&&&public&Int32&Quantity
&&&&&&&&&&&&get
&&&&&&&&&&&&{
&&&&&&&&&&&&&&&&return&((Int32)(base.GetValue(
&&&&&&&&&&&&&&&&&&&&InventoryUpdateActivity.QuantityProperty)));
&&&&&&&&&&&&}
&&&&&&&&&&&&set
&&&&&&&&&&&&{
&&&&&&&&&&&&&&&&base.SetValue(InventoryUpdateActivity.QuantityProperty,&value);
&&&&&&&&&&&&}
&&&&&&&&///&&summary&
&&&&&&&&///&IsReduction&Dependency&Property
&&&&&&&&///&&/summary&
&&&&&&&&public&static&DependencyProperty&IsReductionProperty
&&&&&&&&&&&&=&ponentModel.DependencyProperty.Register(
&&&&&&&&&&&&&&&&&IsReduction&,&typeof(Boolean),&typeof(InventoryUpdateActivity));
&&&&&&&&[Description(&True&to&reduce&inventory,&false&to&increase&it&)]
&&&&&&&&[Category(&ProWorkflow&)]
&&&&&&&&[Browsable(true)]
&&&&&&&&[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
&&&&&&&&public&Boolean&IsReduction
&&&&&&&&&&&&get
&&&&&&&&&&&&{
&&&&&&&&&&&&&&&&return&((Boolean)(base.GetValue(
&&&&&&&&&&&&&&&&&&&&InventoryUpdateActivity.IsReductionProperty)));
&&&&&&&&&&&&}
&&&&&&&&&&&&set
&&&&&&&&&&&&{
&&&&&&&&&&&&&&&&base.SetValue(InventoryUpdateActivity.IsReductionProperty,&value);
&&&&&&&&&&&&}
&&&&&&&&public&InventoryUpdateActivity()
&&&&&&&&&&&&InitializeComponent();
&&&&&&&&///&&summary&
&&&&&&&&///&Control&updates&to&inventory
&&&&&&&&///&&/summary&
&&&&&&&&///&&param&name=&executionContext&&&/param&
&&&&&&&&///&&returns&&/returns&
&&&&&&&&protected&override&ActivityExecutionStatus&Execute(
&&&&&&&&&&&&ActivityExecutionContext&executionContext)
&&&&&&&&&&&&using&(SqlConnection&connection&=&new&SqlConnection(
&&&&&&&&&&&&&&&&ConfigurationManager.ConnectionStrings
&&&&&&&&&&&&&&&&&&&&[&ProWorkflow&].ConnectionString))
&&&&&&&&&&&&{
&&&&&&&&&&&&&&&&connection.Open();
&&&&&&&&&&&&&&&&if&(IsReduction)
&&&&&&&&&&&&&&&&{
&&&&&&&&&&&&&&&&&&&&//make&sure&we&have&sufficient&inventory
&&&&&&&&&&&&&&&&&&&&Int32&qtyOnHand&=&GetCurrentInventory(connection,&ItemId);
&&&&&&&&&&&&&&&&&&&&if&(qtyOnHand&&&Quantity)
&&&&&&&&&&&&&&&&&&&&{
&&&&&&&&&&&&&&&&&&&&&&&&throw&new&ArgumentException(
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&Insufficient&inventory&for&item&);
&&&&&&&&&&&&&&&&&&&&}
&&&&&&&&&&&&&&&&}
&&&&&&&&&&&&&&&&//update&the&inventory
&&&&&&&&&&&&&&&&UpdateInventory(connection,&ItemId,&Quantity,&IsReduction);
&&&&&&&&&&&&&&&&connection.Close();
&&&&&&&&&&&&}
&&&&&&&&&&&&return&base.Execute(executionContext);
&&&&&&&&///&&summary&
&&&&&&&&///&Retrieve&the&current&inventory&for&an&item
&&&&&&&&///&&/summary&
&&&&&&&&///&&param&name=&connection&&&/param&
&&&&&&&&///&&param&name=&itemId&&&/param&
&&&&&&&&///&&returns&&/returns&
&&&&&&&&private&Int32&GetCurrentInventory(
&&&&&&&&&&&&SqlConnection&connection,&Int32&itemId)
&&&&&&&&&&&&Int32&inventory&=&0;
&&&&&&&&&&&&String&sql&=
&&&&&&&&&&&&&&&&@&SELECT&qtyOnHand&FROM&itemInventory&WHERE&itemId&=&@ItemId&;
&&&&&&&&&&&&//setup&Sql&command&object
&&&&&&&&&&&&SqlCommand&command&=&new&SqlCommand(sql);
&&&&&&&&&&&&//setup&parameters
&&&&&&&&&&&&SqlParameter&p&=&new&SqlParameter(&@ItemId&,&itemId);
&&&&&&&&&&&&command.Parameters.Add(p);
&&&&&&&&&&&&command.Connection&=&
&&&&&&&&&&&&Object&result&=&command.ExecuteScalar();
&&&&&&&&&&&&if&(result&!=&null)
&&&&&&&&&&&&{
&&&&&&&&&&&&&&&&inventory&=&(Int32)
&&&&&&&&&&&&}
&&&&&&&&&&&&return&
&&&&&&&&///&&summary&
&&&&&&&&///&Update&the&inventory
&&&&&&&&///&&/summary&
&&&&&&&&///&&param&name=&connection&&&/param&
&&&&&&&&///&&param&name=&itemId&&&/param&
&&&&&&&&///&&param&name=&quantity&&&/param&
&&&&&&&&///&&param&name=&isReduction&&&/param&
&&&&&&&&private&void&UpdateInventory(SqlConnection&connection,
&&&&&&&&&&&&Int32&itemId,&Int32&quantity,&Boolean&isReduction)
&&&&&&&&&&&&String&
&&&&&&&&&&&&if&(IsReduction)
&&&&&&&&&&&&{
&&&&&&&&&&&&&&&&sql&=
&&&&&&&&&&&&&&&&@&UPDATE&itemInventory&
&&&&&&&&&&&&&&&&&&SET&qtyOnHand&=&qtyOnHand&-&@Quantity
&&&&&&&&&&&&&&&&&&WHERE&itemId&=&@ItemId&;
&&&&&&&&&&&&&&&&Console.WriteLine(
&&&&&&&&&&&&&&&&&&&&&InventoryUpdateActivity:&Reducing&inventory&);
&&&&&&&&&&&&}
&&&&&&&&&&&&else
&&&&&&&&&&&&{
&&&&&&&&&&&&&&&&sql&=
&&&&&&&&&&&&&&&&@&UPDATE&itemInventory&
&&&&&&&&&&&&&&&&&&SET&qtyOnHand&=&qtyOnHand&+&@Quantity
&&&&&&&&&&&&&&&&&&WHERE&itemId&=&@ItemId&;
&&&&&&&&&&&&&&&&Console.WriteLine(
&&&&&&&&&&&&&&&&&&&&&InventoryUpdateActivity:&Compensating&inventory&);
&&&&&&&&&&&&}
&&&&&&&&&&&&//setup&Sql&command&object
&&&&&&&&&&&&SqlCommand&command&=&new&SqlCommand(sql);
&&&&&&&&&&&&//setup&parameters
&&&&&&&&&&&&SqlParameter&p&=&new&SqlParameter(&@ItemId&,&itemId);
&&&&&&&&&&&&command.Parameters.Add(p);
&&&&&&&&&&&&p&=&new&SqlParameter(&@Quantity&,&quantity);
&&&&&&&&&&&&command.Parameters.Add(p);
&&&&&&&&&&&&command.Connection&=&
&&&&&&&&&&&&command.ExecuteNonQuery();
友情链接:
CopyRight & 2008- All Rights reserved. 苏ICP备
号 京公网安备:95Get started in 15 seconds!
First Name
Email Address
Create Account or use Facebook
Works on any computer (Mac or PC) and Mobile Devices.
Online Inventory Management in the Cloud!
Now managing over 8 billion dollars worth of inventory in over 100 countries worldwide.*
Online Inventory Management Software in the Cloud!
Now managing over 8 billion dollars worth of inventory in over 100 countries worldwide.*
An easier way for managing your business. SalesBinder is an all-in-one online inventory management system that also organizes your customers, sales leads, purchase orders, estimates and invoices.
Manage your inventory and check supply levels in real-time. Receive low inventory notifications and generate Purchase Orders to replenish your stock.
Have multiple warehouses, offices, or retail stores? No problem. Easily track where all your inventory is by organizing everything into locations and zones.
Organize your inventory items by using custom attributes such as size, color, and location. View how many you have globally or at each location.
With a built-in CRM you can keep track of all your customer accounts with ease. Add multiple contacts, private notes, and review their purchase history.
Create beautiful, professional invoices & estimates in just a few seconds and then instantly email them as PDF's directly to your customers or prospects.
With integrated Purchase Orders, you can easily replenish your inventory levels by ordering more stock and even track when those new items will arrive.
Generate extremely detailed financial reports for both your inventory and services. Filter your reports by date-range and category to see what's making you the most money.
SalesBinder tracks all important changes to your data using Activity Feeds so you're always in the loop. See who's done what and when it happened.
Custom user permissions allows you to toggle what each of your team members can see and do. Hide things, make things read-only, or hide everyone else's stuff.
Latest News & Updates
Social Updates
Oct 31st @ 10:17pm
Our SalesBinder iPhone App has been updated and is now available in the AppStore. #HappyHalloween!
Oct 21st @ 5:00pm
New Feature: Assign users as Account Managers. Filter customer list by account manager & optionally limit access to only view own accounts.
Oct 10th @ 6:25pm
If you haven't read about our latest @SalesBinder updates yet, it's because we back-dated the article. Here ya go!
Network Status:
100% Global Availability ()
* Estimated dollar value based off of rounded currency conversions only from active accounts.
Heads-up: We're just grabbing your name and email address so you don't have to type it out. We're not requesting any other Facebook information.

我要回帖

更多关于 香港占中是什么意思 的文章

 

随机推荐