protected void Page_Load(object sender, EventArgs e) { drugsRepository = new DrugsRepository(); if (!IsPostBack) { string value = Session["drugId"] as string; if (!string.IsNullOrEmpty(value)) { code.Enabled = false; code.Text = value; title.Text = "Edit Drug Information"; cancelButton.Visible = false; var drug = drugsRepository.Get(code.Text); if (drug != null) { code.Text = drug.BR_ID; name.Text = drug.DRUG_NAME; unitPrice.Text = drug.UNITARY_PRICE.ToString(); bulkPrice.Text = drug.BulkPrice; expDate.Text = Convert.ToDateTime(drug.ExpireDate).ToString("dd-M-yyyy", CultureInfo.InvariantCulture); } } else { backButton.Visible = false; } } }
protected void Page_Load(object sender, EventArgs e) { stockRepository = new StockRepository(); drugsRepository = new DrugsRepository(); tansactionRepository = new TansactionRepository(); //if (!IsPostBack) }
protected void Page_Load(object sender, EventArgs e) { drugsRepository = new DrugsRepository(); Session["drugId"] = string.Empty; GetAllProducts(); }
protected void Page_Load(object sender, EventArgs e) { drugsRepository = new DrugsRepository(); stockRepository = new StockRepository(); if (!IsPostBack) { GetAllProducts(); } }