Click here to Skip to main content
15,867,991 members
Please Sign up or sign in to vote.
1.67/5 (3 votes)
See more:
my project is supply chain managment and i want to send mail

when inventory is low in stock then i want to send mail in asp.net in c#..total inventory is 50

i have a submit button anad in this button i done this code
C#
b = inv.get_Inv(Convert.ToInt32(ddl_product.SelectedValue));
            
            d = inv.get_reorder(Convert.ToInt16(ddl_product.SelectedValue));
            if (b > 0 && b >= Convert.ToInt32(Txtquantity.Text))
            {
                c = b - Convert.ToInt32(Txtquantity.Text);
                saleorderid = (DLL.ClassSales.addsales(Convert.ToInt32(ddl_customer.SelectedValue), Convert.ToDateTime(Calendar1.SelectedDate), Convert.ToInt16(ddl_status.SelectedValue))).ToString();

                DLL.ClassSales.addsaleOrderDetail(Convert.ToInt16(saleorderid), Convert.ToInt32(ddl_product.SelectedValue), Convert.ToDecimal(Txtupprice.Text), Convert.ToInt32(Txtquantity.Text));


                DLL.ClassInventory.Update_inventory(Convert.ToInt32(ddl_product.SelectedValue), c);
            }
            if (c <= d)
            {  // alert and email (main menu pe jana chahiye)
                Response.Redirect("Purchases.aspx");
            }
            else
            {
                //Label1.Text = "Inventory invalid";
            }




now here anybody tell me please how i send mail when inventory is below 50

anyone help me please>
Posted
Updated 9-Dec-13 7:40am
v2
Comments
Sergey Alexandrovich Kryukov 9-Dec-13 13:40pm    
Help with what? I cannot see any questions?
—SA
Diya Ayesa 9-Dec-13 13:45pm    
i want to send mail when inventory is less than 50 then how to send mail total inventroy is 50

1 solution

1) When purchase is made check stock.
2) If stock is now less than minimum stock level (and it wasn't before) send email.

That is pretty simple.
Sending an email is also pretty simple: Sending an Email in C# with or without attachments: generic routine.[^]
 
Share this answer
 
Comments
Diya Ayesa 9-Dec-13 14:11pm    
but how i apply condition in mail code when stock is less than 50
OriginalGriff 9-Dec-13 14:19pm    
Um.
The code you show has "if" statements, so I will assume you know what that part will be...
And it has "<=" as a condition within one of the "if" statements, so it can't be that you need help with...
And I'll assume you know how to write a number...
Which leaves us with: what do you actually need help with?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900