Exemple #1
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            String result = Util.generateKey("FoodCategory");

            MessageBox.Show(result);
            txtCategoryID.Text = result;
        }
        private void btnGenerate_Click_1(object sender, EventArgs e)
        {
            String key = Util.generateKey(empType);

            MessageBox.Show(key);
            txtempid.Text = key;
        }
Exemple #3
0
        private void btnProductIDGenerate_Click(object sender, EventArgs e)
        {
            String result = Util.generateKey(status);

            MessageBox.Show(result);
            txtID.Text = result;
        }
Exemple #4
0
        private void btnGenerate_ItemCategoryID_Click(object sender, EventArgs e)
        {
            String keyy = Util.generateKey(itemtype);

            MessageBox.Show("New key generated - " + keyy);
            txtItemCategoryID.Text = keyy;
        }
        //method to remove the selected items from the stock
        private void performStockOut(List <BillItemRow> outList)
        {
            using (DBEntities db = new DBEntities())
            {
                foreach (BillItemRow Item in outList)
                {
                    stockAuditModel = new StockAudit(); //creating a new stock audit row

                    //auto generating an stock audit id
                    stockAuditModel.stockAuditID = Util.generateKey("stock");
                    stockAuditModel.itemID       = Item.billrowID;

                    stockAuditModel.date = DateTime.Today;
                    stockAuditModel.time = DateTime.Now.TimeOfDay;

                    stockAuditModel.quantity   = Int32.Parse(Item.Quantity);
                    stockAuditModel.inOut      = false; //indicating this is a stock out
                    stockAuditModel.expireDate = null;

                    //we need to check whether that any of item has cross thier limit quantities as well

                    //adding new record to the stockAudit
                    db.StockAudits.Add(stockAuditModel);
                    db.SaveChanges();

                    bool r = Util.checkForLimitCross(billItemRow.billrowID); //equals to the item id
                    if (!r)
                    {
                        break;
                    }
                }
            }
            MessageBox.Show("Stock Updated Successfully ");
        }
        //method to set values
        public void setValues(String id)
        {
            using (DBEntities db = new DBEntities())
            {
                stockItem = db.Items.Where(x => x.itemID == id).FirstOrDefault();

                //generate and assign a key
                lblAuditNumber.Text = Util.generateKey("stock");
                lblItemName.Text    = stockItem.name;
                lblitemID.Text      = stockItem.itemID;
            }
        }
        //method to add order details to table
        public String addOrderToTable()
        {
            using (DBEntities db = new DBEntities())
            {
                orderModel.orderID  = Util.generateKey("orders");
                orderModel.recordBy = "recep1";
                orderModel.date     = DateTime.Today;
                orderModel.time     = DateTime.Now.TimeOfDay;
                orderModel.amount   = (float)amountToPay;

                addBillDetailsToTable(orderModel.orderID);

                db.Order_.Add(orderModel);
                db.SaveChanges();

                MessageBox.Show("Order Added Successfully !!!");
            }
            return(orderModel.orderID);
        }
 private void btngen_Click(object sender, EventArgs e)
 {
     textBoxCID.Text = Util.generateKey("customer");
 }
 private void btnGenerate_Click(object sender, EventArgs e)
 {
     txtItemID.Text = Util.generateKey("item");
 }
 private void btnGenerate_Click(object sender, EventArgs e)
 {
     txtCategoryID.Text = Util.generateKey("vehicleCategory");
 }
 private void btnProductIDGenerate_Click(object sender, EventArgs e)
 {
     txtVID.Text = Util.generateKey("vehicle");
 }