//Submit Add Form
        protected void AddLabOrderDetailButton_Click(object sender, EventArgs e)
        {
            Button btn = (Button)sender;
            String btnId = btn.ID;

            if (btnId.Equals("AddLabOrderDetailButton"))
            {
                if (IsValid)
                {
                    System.Threading.Thread.Sleep(3000);
                    var labOrderId = long.Parse(LabIdDropDown.SelectedItem.Text);
                    var msId = GetMedicalServiceID(MSTextBox.Text)[0];
                    var result = ResultTextBox.Text;

                    var labOrderDetail = new LabOrderDetail() { labOrderId = labOrderId, medicalServiceId = msId, labResult = result };
                    _dataContext.LabOrderDetails.InsertOnSubmit(labOrderDetail);
                    _dataContext.SubmitChanges();
                    LabOrderDetailList.DataBind();

                    //Use for testing
                    //Debug.WriteLine("presID: " + presId);
                    //Debug.WriteLine("presID: " + drug);
                    //Debug.WriteLine("presID: " + quantity);
                    //Debug.WriteLine("presID: " + dose);
                    //Debug.WriteLine("presID: " + instruction);

                    ResetInputField();
                }
            }
            else if (btnId.Equals("ResetLabOrderDetailButton"))
            {
                ResetInputField();
            }
        }
Ejemplo n.º 2
0
 partial void DeleteLabOrderDetail(LabOrderDetail instance);
Ejemplo n.º 3
0
 partial void UpdateLabOrderDetail(LabOrderDetail instance);
Ejemplo n.º 4
0
 partial void InsertLabOrderDetail(LabOrderDetail instance);
Ejemplo n.º 5
0
		private void detach_LabOrderDetails(LabOrderDetail entity)
		{
			this.SendPropertyChanging();
			entity.MedicalService = null;
		}
Ejemplo n.º 6
0
		private void detach_LabOrderDetails(LabOrderDetail entity)
		{
			this.SendPropertyChanging();
			entity.LabOrder = null;
		}
        protected void UpdateButton_Click(object sender, EventArgs e)
        {
            if (IsValid)
            {
                System.Threading.Thread.Sleep(3000);
                var editedRowIndex = LabOrderDetailList.EditIndex;
                var lblId = LabOrderDetailList.Rows[editedRowIndex].FindControl("EditId") as Label;
                var txtbLabOrder = LabOrderDetailList.Rows[editedRowIndex].FindControl("EditLabOrder") as TextBox;
                var txtbMedicalService = LabOrderDetailList.Rows[editedRowIndex].FindControl("EditMSName") as TextBox;
                var txtbResult = LabOrderDetailList.Rows[editedRowIndex].FindControl("EditResult") as TextBox;

                var id = long.Parse(lblId.Text);
                var labOrder = long.Parse(txtbLabOrder.Text);
                var medicalService = GetMedicalServiceID(txtbMedicalService.Text)[0];
                var result = txtbResult.Text;

                var labOrderDetails = new LabOrderDetail() {labOrderDetailId = id, labOrderId = labOrder, medicalServiceId = medicalService, labResult = result };
                _dataContext.LabOrderDetails.Attach(labOrderDetails);
                _dataContext.Refresh(RefreshMode.KeepCurrentValues, labOrderDetails);
                _dataContext.SubmitChanges();
                LabOrderDetailList.EditIndex = -1;

                //Use For Debug passed value
                //Debug.WriteLine("id: " + id);
                //Debug.WriteLine("DName: " + doctorId);
                //Debug.WriteLine("Date: " + date);
            }
        }