Пример #1
0
 public void BindAllocatedTestToPatient()
 {
     try
     {
         if (ddlPatient.SelectedIndex > 0 && ddlTest.SelectedIndex > 0)
         {
             List <EntityPathology> lst = new PathologyBLL().GetAllocatedTestsToPatient(Convert.ToInt32(ddlPatient.SelectedValue), Convert.ToInt32(ddlTest.SelectedValue));
             GridView1.DataSource    = lst;
             lblFinalComment.Visible = true;
             txtFinalComment.Visible = true;
             GridView1.DataBind();
         }
         else
         {
             if (ddlPatient.SelectedIndex > 0 && ddlTest.SelectedIndex == 0)
             {
                 ddlTest.Focus();
                 return;
             }
             if (ddlPatient.SelectedIndex == 0 && ddlTest.SelectedIndex > 0)
             {
                 ddlPatient.Focus();
                 return;
             }
         }
     }
     catch (Exception ex)
     {
         lblMessage.Text = ex.Message;
     }
 }
Пример #2
0
 protected void btnShowTest_Click(object sender, EventArgs e)
 {
     try
     {
         ImageButton imgEdit = (ImageButton)sender;
         GridViewRow cnt     = (GridViewRow)imgEdit.NamingContainer;
         Session["Patient_ID"] = cnt.Cells[0].Text;
         PathologyBLL           Pathology = new PathologyBLL();
         List <EntityPathology> lst       = Pathology.SearchPathologyDetails(Convert.ToString(Session["Patient_ID"]));
         if (lst.Count > 0)
         {
             dgvTest.DataSource = lst;
             dgvTest.DataBind();
             MultiView1.SetActiveView(View2);
             lblMessage.Text = string.Empty;
         }
         else
         {
             lblMessage.Text = "No Test Done";
             MultiView1.SetActiveView(View1);
         }
     }
     catch (Exception ex)
     {
         lblMessage.Text = ex.Message;
     }
 }
Пример #3
0
        private void SelectPathologyDetail(string Prefix)
        {
            PathologyBLL           Pathology = new PathologyBLL();
            List <EntityPathology> lst       = Pathology.SearchPathologyDetails(Prefix);

            if (lst != null)
            {
                dgvTestParameter.DataSource = lst;
                dgvTestParameter.DataBind();

                lblRowCount.Text = string.Empty;
            }
        }
Пример #4
0
        protected void BtnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (ddlPatient.SelectedIndex == 0)
                {
                    lblMsg.Text = "Please Select Patient";
                    ddlPatient.SelectedIndex = 0;
                    ddlPatient.Focus();
                }
                if (ddlTest.SelectedIndex == 0)
                {
                    lblMsg.Text           = "Please Select Test";
                    ddlTest.SelectedIndex = 0;
                    ddlTest.Focus();
                }
                if (txtFinalComment.Text == null)
                {
                    lblMsg.Text           = "Please Enter Final Comment";
                    ddlTest.SelectedIndex = 0;
                    ddlTest.Focus();
                    return;
                }
                bool flag = false;
                List <tblPathologyDetail> lst = new List <tblPathologyDetail>();
                foreach (GridViewRow item in GridView1.Rows)
                {
                    var textbox = item.FindControl("txtResult") as TextBox;
                    var a       = textbox.Text;
                    if (string.IsNullOrEmpty(a))
                    {
                        flag = true;
                        break;
                    }
                    var textboxCommnet = item.FindControl("ddlComment") as DropDownList;
                    var comm           = textboxCommnet.SelectedItem.Text;
                    if (string.IsNullOrEmpty(comm))
                    {
                        flag = true;
                        break;
                    }
                    var ddl  = item.FindControl("ddlUnit") as DropDownList;
                    int unit = Convert.ToInt32(ddl.SelectedValue);
                    if (unit == 0)
                    {
                        flag = true;
                        break;
                    }
                    var ddltestMeth = item.FindControl("ddlTestMethod") as DropDownList;
                    int testmethod  = Convert.ToInt32(ddltestMeth.SelectedValue);
                    if (testmethod == 0)
                    {
                        flag = true;
                        break;
                    }
                    lst.Add(new tblPathologyDetail {
                        TestParaId = Convert.ToInt32(GridView1.DataKeys[item.RowIndex].Value), Result = Convert.ToDecimal(a), UnitId = Convert.ToInt32(unit), TestMethodId = Convert.ToInt32(testmethod), Comment = comm, Isdelete = false
                    });
                }

                if (flag)
                {
                    lblMsg.Text = "Please Fill Valid & Complete Data";
                }
                else
                {
                    EntityLogin entLogin = (EntityLogin)Session["user"];

                    PathologyBLL PBll      = new PathologyBLL();
                    tblPathology pathology = new tblPathology();
                    pathology.PatientId    = Convert.ToInt32(ddlPatient.SelectedValue);
                    pathology.TestId       = Convert.ToInt32(ddlTest.SelectedValue);
                    pathology.TestDate     = DateTime.Now.Date;
                    pathology.FinalComment = txtFinalComment.Text;
                    pathology.TestDoneById = entLogin.PKId;
                    HttpPostedFile File = (HttpPostedFile)Session["Photo"];
                    if (File != null)
                    {
                        string appPath = Server.MapPath("~/PathologyImages/");
                        string Id      = Convert.ToString(mobjDeptBLL.GetLabId());
                        File.SaveAs(appPath + Id + ".jpg");
                    }

                    int i = PBll.Save(pathology, lst);
                    lblMessage.Text = "Record Saved Sucessfully";
                    BindPatientPathologyTest();
                    MultiView1.SetActiveView(View1);
                }
            }
            catch (Exception ex)
            {
                lblMessage.Text = ex.Message;
            }
        }