Beispiel #1
0
        protected void btnUpdateHerbStock_Click(object sender, EventArgs e)
        {
            HerbStockModel hsModel = new HerbStockModel();
            HerbStock      hs      = CreateHerbStock();

            if (!String.IsNullOrWhiteSpace(Request.QueryString["id"]))
            {
                int id       = Convert.ToInt32(Request.QueryString["id"]);
                int rowIndex = Convert.ToInt32(Request.QueryString["rowIndex"]);

                divAlertSuccess.Visible        = true;
                lblNoSelectionAlertHeader.Text = hsModel.UpdateHerbStock(id, hs);
                Response.Redirect("ViewInventory.aspx?rowIndex=" + rowIndex);
            }
        }
Beispiel #2
0
        private void FillPage(int id)
        {
            HerbStockModel herbStock = new HerbStockModel();
            HerbStock      hs        = herbStock.GetHerbStock(id);
            AllHerbsModel  ahm       = new AllHerbsModel();
            AllHerb        ah        = ahm.GetAllHerb(hs.HerbRefNum.ToString());

            tbxHerb.Text              = ah.HerbName;
            tbxQuantity.Text          = hs.Quantity.ToString();
            tbxBatchNumber.Text       = hs.BatchNum;
            tbxExpiaryDate.Text       = String.Format("{0:dd/MM/yyyy}", hs.ExpiryDate);
            ddlSupplier.SelectedValue = hs.SupplierID.ToString();
            tbxSupplierPrice.Text     = String.Format("{0:0.0000}", hs.BuyPrice);
            ddlHerbForm.SelectedValue = hs.HerbForm.ToString();
            tbxRatio.Text             = hs.HerbRawToGranRatio.ToString();
            tbxDateReceived.Text      = String.Format("{0:dd/MM/yyyy}", hs.DateReceived);

            tbxDateToDispensery.Text = String.Format("{0:dd/MM/yyyy}", hs.DateToDispensery);
        }