private void cekAdd() { idnya = Request.QueryString["ID"]; if (Request.QueryString["Status"] == "Update") { if (Session["access"].ToString().Equals("0")) { Response.Redirect("~/ui/Dashboard.aspx"); } if (idnya != "") { dt = controller.getDetailDrug(idnya); txtIdDrug.Text = idnya; txtDrugName.Text = dt.Rows[0][1].ToString(); string drugType = dt.Rows[0][2].ToString().Trim(); DDdrugType.Items.FindByText(drugType).Selected = true; txtStock.Text = dt.Rows[0][3].ToString(); txtExpDate.Text = Convert.ToDateTime(dt.Rows[0][4]).ToString("dd/MM/yyyy"); double price = Convert.ToDouble(dt.Rows[0][5].ToString()); txtPrice.Text = Convert.ToInt32(price).ToString(); tulisanatas.InnerText = "Update Data Patient"; btnSave.Text = "Update"; btnSave.CommandName = "Update"; } } else if (Request.QueryString["Status"] == "Add") { txtIdDrug.Text = controller.AutoGenerateID(); btnSave.Text = "Save"; btnSave.CommandName = "Save"; txtDrugName.Focus(); } else { Response.Redirect("~/ui/AddDrug.aspx"); } }