protected void btnAddMedication_Click(object sender, EventArgs e) { medication_group_id = Convert.ToInt32(Request.QueryString["medicationGroupID"]); if (!String.IsNullOrEmpty(Convert.ToString(txtMedicationName.Text))) { string med_name = txtMedicationName.Text; string med_description = reMedicationDescription.Content; string med_special_instructions = reMedicationSpecialInstructions.Content; qSoc_Medication med = new qSoc_Medication(); med.ScopeID = Convert.ToInt32(Context.Items["ScopeID"]); med.Created = DateTime.Now; med.CreatedBy = Convert.ToInt32(Context.Items["UserID"]); med.LastModified = DateTime.Now; med.LastModifiedBy = Convert.ToInt32(Context.Items["UserID"]); med.Available = "Yes"; med.MarkAsDelete = 0; med.MedicationGroupID = medication_group_id; med.Name = med_name; med.Description = med_description; med.SpecialInstructions = med_special_instructions; med.Insert(); Response.Redirect("medication-group-edit.aspx?medicationGroupID=" + medication_group_id); } else { lblMedicationLinksMessage.Text = " *** WARNING *** You must include a medication name."; } }
protected void btnAddMedication_Click(object sender, EventArgs e) { medication_group_id = Convert.ToInt32(Request.QueryString["medicationGroupID"]); if (!String.IsNullOrEmpty(Convert.ToString(txtMedicationName.Text))) { string med_name = txtMedicationName.Text; string med_description = reMedicationDescription.Content; string med_special_instructions = reMedicationSpecialInstructions.Content; qSoc_Medication med = new qSoc_Medication(); med.ScopeID = Convert.ToInt32(Context.Items["ScopeID"]); med.Created = DateTime.Now; med.CreatedBy = Convert.ToInt32(Context.Items["UserID"]); med.LastModified = DateTime.Now; med.LastModifiedBy = Convert.ToInt32(Context.Items["UserID"]); med.Available = "Yes"; med.MarkAsDelete = 0; med.MedicationGroupID = medication_group_id; med.Name = med_name; med.Description = med_description; med.SpecialInstructions = med_special_instructions; med.Insert(); Response.Redirect("medication-group-edit.aspx?medicationGroupID=" + medication_group_id); } else { lblMedicationLinksMessage.Text = " *** WARNING *** You must include a medication name."; } }