Ejemplo n.º 1
0
    protected void btnImgDelete_Click(object sender, EventArgs e)//fuProImage,fuProImage
    {
        moHMSDataContext = new HMSDataContext();
        tblPatient loSelect = moHMSDataContext.tblPatients.Where(c => c.inPatientId == Convert.ToInt32(lblId.Text)).FirstOrDefault();

        loSelect.stImage = string.Empty;
        moHMSDataContext.SubmitChanges();
        trView.Visible = false;
        lblPath.Text   = string.Empty;
    }
Ejemplo n.º 2
0
    protected void rptMedicine_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "IsDeleted")
        {
            int inlProdId = Convert.ToInt32(e.CommandArgument);
            lblId.Text        = Convert.ToString(inlProdId);
            mNewsEventContext = new HMSDataContext();

            tblPatientMedicineMapping loDelete = mNewsEventContext.tblPatientMedicineMappings.Where(c => c.inPatientMedicineMappingId == inlProdId).FirstOrDefault();
            mNewsEventContext.tblPatientMedicineMappings.DeleteOnSubmit(loDelete);
            mNewsEventContext.SubmitChanges();
            Common.CommonFunction.showMsg("Patient medicine has been deleted successfully.", this.Page);
            bindPatientMedicine(Convert.ToInt32(ddlPatients.SelectedValue));
        }
    }
Ejemplo n.º 3
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         mNewsEventContext = new HMSDataContext();
         tblPatientMedicineMapping loMedicine = new tblPatientMedicineMapping();
         loMedicine.inPatientId  = Convert.ToInt32(ddlPatients.SelectedValue);
         loMedicine.inMedicineId = Convert.ToInt32(ddlMedicine.SelectedValue);
         loMedicine.dtGivenDate  = DateTime.Now;
         mNewsEventContext.tblPatientMedicineMappings.InsertOnSubmit(loMedicine);
         mNewsEventContext.SubmitChanges();
         ClearControl();
         bindPatientMedicine(Convert.ToInt32(ddlPatients.SelectedValue));
         //mvProduct.ActiveViewIndex = 1;
         Common.CommonFunction.showMsg("Medicine has been added to the patient.", this.Page);
     }
 }
Ejemplo n.º 4
0
    protected void btnEdit_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            if (editImgCode())
            {
                moHMSDataContext = new HMSDataContext();
                tblPatient loSelect = moHMSDataContext.tblPatients.Where(c => c.inPatientId == Convert.ToInt32(lblId.Text)).FirstOrDefault();
                loSelect.stFirstName = txtFirstName.Text;
                loSelect.stLastName  = txtLastName.Text;
                if (rdSingle.Checked)
                {
                    loSelect.stStatus = "Single";
                }
                else
                {
                    loSelect.stStatus = "Married";
                }

                if (rdMale.Checked)
                {
                    loSelect.stGender = "Male";
                }
                else
                {
                    loSelect.stGender = "Female";
                }

                if (rdINStatus.Checked)
                {
                    loSelect.flgIsIn = true;
                }
                else
                {
                    loSelect.flgIsIn = false;
                }

                loSelect.stAddress      = txtAddress.Text;
                loSelect.inAge          = Convert.ToByte(txtAge.Text);
                loSelect.inPhone        = Convert.ToInt64(txtPhone.Text);
                loSelect.stSymtoms      = txtSymtoms.Text;
                loSelect.inWeight       = Convert.ToByte(txtWeight.Text);
                loSelect.inBedId        = Convert.ToInt32(ddlBed.SelectedValue);
                loSelect.inFloorId      = Convert.ToInt32(ddlFloor.SelectedValue);
                loSelect.inDepartmentId = Convert.ToInt32(ddlDepartment.SelectedValue);
                loSelect.inDoctorId     = Convert.ToInt32(ddlDoctor.SelectedValue);
                loSelect.stImage        = lblPath.Text;

                if (rdOutStatus.Checked)
                {
                    loSelect.dtOutDate = DateTime.Now;
                }

                moHMSDataContext.SubmitChanges();
                ClearControl();
                BindData();
                mvProduct.ActiveViewIndex = 1;
                Common.CommonFunction.showMsg("Patient details updated successfully.", this.Page);
            }
        }
    }
Ejemplo n.º 5
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            moHMSDataContext = new HMSDataContext();

            if (editImgCode())
            {
                tblPatient loSelect = new tblPatient();
                loSelect.stFirstName = txtFirstName.Text;
                loSelect.stLastName  = txtLastName.Text;
                loSelect.stAddress   = txtAddress.Text;
                if (rdSingle.Checked)
                {
                    loSelect.stStatus = "Single";
                }
                else
                {
                    loSelect.stStatus = "Married";
                }

                if (rdMale.Checked)
                {
                    loSelect.stGender = "Male";
                }
                else
                {
                    loSelect.stGender = "Female";
                }

                if (rdINStatus.Checked)
                {
                    loSelect.flgIsIn = true;
                }
                else
                {
                    loSelect.flgIsIn = false;
                }

                loSelect.inEmployeeId    = Convert.ToInt32(Session["ID"]);
                loSelect.inAge           = Convert.ToByte(txtAge.Text);
                loSelect.inPhone         = Convert.ToInt64(txtPhone.Text);
                loSelect.stSymtoms       = txtSymtoms.Text;
                loSelect.inWeight        = Convert.ToByte(txtWeight.Text);
                loSelect.inBedId         = Convert.ToInt32(ddlBed.SelectedValue);
                loSelect.inFloorId       = Convert.ToInt32(ddlFloor.SelectedValue);
                loSelect.inDepartmentId  = Convert.ToInt32(ddlDepartment.SelectedValue);
                loSelect.inDoctorId      = Convert.ToInt32(ddlDoctor.SelectedValue);
                loSelect.dtAdmissionDate = DateTime.Now;
                loSelect.stImage         = lblPath.Text;


                moHMSDataContext.tblPatients.InsertOnSubmit(loSelect);
                moHMSDataContext.SubmitChanges();
                ClearControl();
                BindData();
                mvProduct.ActiveViewIndex = 1;
                Common.CommonFunction.showMsg("Patient saved successfully.", this.Page);
            }
        }
    }
Ejemplo n.º 6
0
    protected void rptPatients_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Header && e.CommandName == "Sort")
        {
            if (Convert.ToString(ViewState["Sort"]).EndsWith(" asc"))
            {
                ViewState["Sort"] = e.CommandArgument.ToString() + " desc";
            }
            else
            {
                ViewState["Sort"] = e.CommandArgument.ToString() + " asc";
            }
            BindData();
        }
        else if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            if (e.CommandName == "IsEdit")
            {
                int inlProdId = Convert.ToInt32(e.CommandArgument);
                lblId.Text             = Convert.ToString(inlProdId);
                ViewState["PatientId"] = Convert.ToString(inlProdId);
                moHMSDataContext       = new HMSDataContext();

                tblPatient loSelect = moHMSDataContext.tblPatients.Where(c => c.inPatientId == inlProdId).First();
                if (loSelect != null)
                {
                    txtFirstName.Text = loSelect.stFirstName;
                    txtLastName.Text  = loSelect.stLastName;
                    txtAddress.Text   = loSelect.stAddress;

                    if (loSelect.stStatus == "Single")
                    {
                        rdSingle.Checked = true;
                    }
                    else
                    {
                        rdMarried.Checked = true;
                    }

                    if (loSelect.stGender == "Male")
                    {
                        rdMale.Checked = true;
                    }
                    else
                    {
                        rdFemale.Checked = true;
                    }

                    if (loSelect.flgIsIn == true)
                    {
                        rdINStatus.Checked = true;
                    }
                    else
                    {
                        rdOutStatus.Checked = true;
                    }

                    txtAge.Text                 = Convert.ToString(loSelect.inAge);
                    txtPhone.Text               = Convert.ToString(loSelect.inPhone);
                    txtSymtoms.Text             = loSelect.stSymtoms;
                    txtWeight.Text              = Convert.ToString(loSelect.inWeight);
                    ddlFloor.SelectedValue      = Convert.ToString(loSelect.inFloorId);
                    ddlDepartment.SelectedValue = Convert.ToString(loSelect.inDepartmentId);
                    ddlDoctor.SelectedValue     = Convert.ToString(loSelect.inDoctorId);

                    fillBeds(Convert.ToInt32(loSelect.inFloorId), inlProdId);
                    ddlBed.SelectedValue = Convert.ToString(loSelect.inBedId);

                    lblPath.Text = loSelect.stImage;
                    if (lblPath.Text != string.Empty)
                    {
                        trView.Visible = true;
                    }
                    else
                    {
                        trView.Visible = false;
                    }
                    tdView.HRef = ConfigurationSettings.AppSettings["PatientImagePath"] + loSelect.stImage;

                    mvProduct.ActiveViewIndex = 0;
                    btnSave.Visible           = false;
                    btnEdit.Visible           = true;
                    lblMessage.Text           = "Update Patient";
                }
                txtFirstName.Focus();
            }
            if (e.CommandName == "IsDeleted")
            {
                int inlProdId = Convert.ToInt32(e.CommandArgument);
                lblId.Text       = Convert.ToString(inlProdId);
                moHMSDataContext = new HMSDataContext();

                tblPatient loDelete = moHMSDataContext.tblPatients.Where(c => c.inPatientId == inlProdId).FirstOrDefault();
                moHMSDataContext.tblPatients.DeleteOnSubmit(loDelete);
                moHMSDataContext.SubmitChanges();
                Common.CommonFunction.showMsg("Patient deleted successfully.", this.Page);
                BindData();
                ClearControl();
            }
        }
    }