예제 #1
0
    private void showCarePlanDateTimeData()
    {
        CarePlanDateTime carePlanDateTime = new CarePlanDateTime();

        carePlanDateTime = CarePlanDateTimeManager.GetCarePlanDateTimeByID(Int32.Parse(Request.QueryString["carePlanDateTimeID"]));

        txtCarePlanDateTimeValue.Text = carePlanDateTime.CarePlanDateTimeValue;
    }
예제 #2
0
    public static CarePlanDateTime GetCarePlanDateTimeByID(int id)
    {
        CarePlanDateTime            carePlanDateTime            = new CarePlanDateTime();
        SqlCarePlanDateTimeProvider sqlCarePlanDateTimeProvider = new SqlCarePlanDateTimeProvider();

        carePlanDateTime = sqlCarePlanDateTimeProvider.GetCarePlanDateTimeByID(id);
        return(carePlanDateTime);
    }
예제 #3
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        CarePlanDateTime carePlanDateTime = new CarePlanDateTime();

        carePlanDateTime.CarePlanDateTimeValue = txtCarePlanDateTimeValue.Text;
        int resutl = CarePlanDateTimeManager.InsertCarePlanDateTime(carePlanDateTime);

        Response.Redirect("AdminCarePlanDateTimeDisplay.aspx");
    }
예제 #4
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        CarePlanDateTime carePlanDateTime = new CarePlanDateTime();

        carePlanDateTime = CarePlanDateTimeManager.GetCarePlanDateTimeByID(Int32.Parse(Request.QueryString["carePlanDateTimeID"]));
        CarePlanDateTime tempCarePlanDateTime = new CarePlanDateTime();

        tempCarePlanDateTime.CarePlanDateTimeID = carePlanDateTime.CarePlanDateTimeID;

        tempCarePlanDateTime.CarePlanDateTimeValue = txtCarePlanDateTimeValue.Text;
        bool result = CarePlanDateTimeManager.UpdateCarePlanDateTime(tempCarePlanDateTime);

        Response.Redirect("AdminCarePlanDateTimeDisplay.aspx");
    }
예제 #5
0
    public bool UpdateCarePlanDateTime(CarePlanDateTime carePlanDateTime)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("AL_UpdateCarePlanDateTime", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@CarePlanDateTimeID", SqlDbType.Int).Value         = carePlanDateTime.CarePlanDateTimeID;
            cmd.Parameters.Add("@CarePlanDateTimeValue", SqlDbType.NVarChar).Value = carePlanDateTime.CarePlanDateTimeValue;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return(result == 1);
        }
    }
예제 #6
0
    public int InsertCarePlanDateTime(CarePlanDateTime carePlanDateTime)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("AL_InsertCarePlanDateTime", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@CarePlanDateTimeID", SqlDbType.Int).Direction     = ParameterDirection.Output;
            cmd.Parameters.Add("@CarePlanDateTimeValue", SqlDbType.NVarChar).Value = carePlanDateTime.CarePlanDateTimeValue;
            cmd.Parameters.Add("@ResidentID", SqlDbType.Int).Value = carePlanDateTime.ResidentID;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return((int)cmd.Parameters["@CarePlanDateTimeID"].Value);
        }
    }
예제 #7
0
 public CarePlanDateTime GetCarePlanDateTimeFromReader(IDataReader reader)
 {
     try
     {
         CarePlanDateTime carePlanDateTime = new CarePlanDateTime
                                             (
             (int)reader["CarePlanDateTimeID"],
             (DateTime)reader["CarePlanDateTimeValue"]
                                             );
         return(carePlanDateTime);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
예제 #8
0
 public CarePlanDateTime GetCarePlanDateTimeFromReader(IDataReader reader)
 {
     try
     {
         CarePlanDateTime carePlanDateTime = new CarePlanDateTime
             (
                 (int)reader["CarePlanDateTimeID"],
                 (DateTime)reader["CarePlanDateTimeValue"]
             );
          return carePlanDateTime;
     }
     catch(Exception ex)
     {
         return null;
     }
 }
예제 #9
0
    public bool UpdateCarePlanDateTime(CarePlanDateTime carePlanDateTime)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("AL_UpdateCarePlanDateTime", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@CarePlanDateTimeID", SqlDbType.Int).Value = carePlanDateTime.CarePlanDateTimeID;
            cmd.Parameters.Add("@CarePlanDateTimeValue", SqlDbType.NVarChar).Value = carePlanDateTime.CarePlanDateTimeValue;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return result == 1;
        }
    }
예제 #10
0
    public int InsertCarePlanDateTime(CarePlanDateTime carePlanDateTime)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("AL_InsertCarePlanDateTime", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@CarePlanDateTimeID", SqlDbType.Int).Direction = ParameterDirection.Output;
            cmd.Parameters.Add("@CarePlanDateTimeValue", SqlDbType.NVarChar).Value = carePlanDateTime.CarePlanDateTimeValue;
            cmd.Parameters.Add("@ResidentID", SqlDbType.Int).Value = carePlanDateTime.ResidentID;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return (int)cmd.Parameters["@CarePlanDateTimeID"].Value;
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        CarePlanDateTime carePlanDateTime = new CarePlanDateTime();

        if (ddlExistingRecord.SelectedIndex == 0)
        {
            carePlanDateTime.ResidentID            = int.Parse(Request.QueryString["ResidentID"]);
            carePlanDateTime.CarePlanDateTimeValue = DateTime.Now;
            carePlanDateTime.CarePlanDateTimeID    = CarePlanDateTimeManager.InsertCarePlanDateTime(carePlanDateTime);
        }
        else
        {
            carePlanDateTime.CarePlanDateTimeID = int.Parse(ddlExistingRecord.SelectedValue);
        }

        //Saving the textbox value those are Section-2,3,6,7
        SectionTextValue sectionTextValue = new SectionTextValue();

        sectionTextValue.CarePlanDateTimeID = carePlanDateTime.CarePlanDateTimeID;
        sectionTextValue.Section_2          = txtSection_2.Text;
        sectionTextValue.Section_3          = txtSection_3.Text;
        sectionTextValue.Section_6          = txtSection_6.Text;
        sectionTextValue.Section_7          = txtSection_7.Text;
        sectionTextValue.AddedBy            = getLogin().LoginID;
        sectionTextValue.AddedDate          = DateTime.Now;
        sectionTextValue.UpdatedBy          = getLogin().LoginID;
        sectionTextValue.UpdatedDate        = DateTime.Now;
        sectionTextValue.SectionTextValueID = int.Parse(hfSectionTextValueID.Value);
        if (ddlExistingRecord.SelectedIndex == 0)
        {
            int resutl = SectionTextValueManager.InsertSectionTextValue(sectionTextValue);
        }
        else
        {
            SectionTextValueManager.UpdateSectionTextValue(sectionTextValue);
        }

        if (ddlExistingRecord.SelectedIndex != 0)
        {
            //Delete all the value of selected Date
            SectionLabelValueManager.DeleteSectionLabelValueByCarePlanDateTimeID(carePlanDateTime.CarePlanDateTimeID.ToString());
        }
        //Saving the grid value for Section 1
        foreach (GridViewRow gr in gvSection_1.Rows)
        {
            HiddenField     hfSectionLabelID = (HiddenField)gr.FindControl("hfSectionLabelID");
            RadioButtonList rbtnlSection     = (RadioButtonList)gr.FindControl("rbtnlSection");

            SectionLabelValue sectionLabelValue = new SectionLabelValue();

            sectionLabelValue.SectionLabelID = Int32.Parse(hfSectionLabelID.Value);
            sectionLabelValue.AddedBy        = getLogin().LoginID;
            sectionLabelValue.AddedDate      = DateTime.Now;
            sectionLabelValue.Value          = rbtnlSection.SelectedValue;
            sectionLabelValue.ExtraField1    = carePlanDateTime.CarePlanDateTimeID.ToString();
            sectionLabelValue.ExtraField2    = "";
            int resutl = SectionLabelValueManager.InsertSectionLabelValue(sectionLabelValue);
        }

        //Saving the grid value for Section 4
        foreach (GridViewRow gr in gvSection_4.Rows)
        {
            HiddenField hfSectionLabelID = (HiddenField)gr.FindControl("hfSectionLabelID");
            TextBox     txtValue         = (TextBox)gr.FindControl("txtValue");

            SectionLabelValue sectionLabelValue = new SectionLabelValue();

            sectionLabelValue.SectionLabelID = Int32.Parse(hfSectionLabelID.Value);
            sectionLabelValue.AddedBy        = getLogin().LoginID;
            sectionLabelValue.AddedDate      = DateTime.Now;
            sectionLabelValue.Value          = txtValue.Text;
            sectionLabelValue.ExtraField1    = carePlanDateTime.CarePlanDateTimeID.ToString();
            sectionLabelValue.ExtraField2    = "";
            int resutl = SectionLabelValueManager.InsertSectionLabelValue(sectionLabelValue);
        }

        //Saving the grid value for Section 5
        foreach (GridViewRow gr in gvSection_5.Rows)
        {
            HiddenField     hfSectionLabelID = (HiddenField)gr.FindControl("hfSectionLabelID");
            RadioButtonList rbtnlSection     = (RadioButtonList)gr.FindControl("rbtnlSection");

            SectionLabelValue sectionLabelValue = new SectionLabelValue();

            sectionLabelValue.SectionLabelID = Int32.Parse(hfSectionLabelID.Value);
            sectionLabelValue.AddedBy        = getLogin().LoginID;
            sectionLabelValue.AddedDate      = DateTime.Now;
            sectionLabelValue.Value          = rbtnlSection.SelectedValue;
            sectionLabelValue.ExtraField1    = carePlanDateTime.CarePlanDateTimeID.ToString();
            sectionLabelValue.ExtraField2    = "";
            int resutl = SectionLabelValueManager.InsertSectionLabelValue(sectionLabelValue);
        }

        //Saving the grid value for Section 8
        foreach (GridViewRow gr in gvSection_8.Rows)
        {
            HiddenField hfSectionLabelID = (HiddenField)gr.FindControl("hfSectionLabelID");
            TextBox     txtValue         = (TextBox)gr.FindControl("txtValue");

            SectionLabelValue sectionLabelValue = new SectionLabelValue();

            sectionLabelValue.SectionLabelID = Int32.Parse(hfSectionLabelID.Value);
            sectionLabelValue.AddedBy        = getLogin().LoginID;
            sectionLabelValue.AddedDate      = DateTime.Now;
            sectionLabelValue.Value          = txtValue.Text;
            sectionLabelValue.ExtraField1    = carePlanDateTime.CarePlanDateTimeID.ToString();
            sectionLabelValue.ExtraField2    = "";
            int resutl = SectionLabelValueManager.InsertSectionLabelValue(sectionLabelValue);
        }

        //Saving the grid value for Section 9
        foreach (GridViewRow gr in gvSection_9.Rows)
        {
            HiddenField hfSectionLabelID = (HiddenField)gr.FindControl("hfSectionLabelID");
            TextBox     txtValue         = (TextBox)gr.FindControl("txtValue");

            SectionLabelValue sectionLabelValue = new SectionLabelValue();

            sectionLabelValue.SectionLabelID = Int32.Parse(hfSectionLabelID.Value);
            sectionLabelValue.AddedBy        = getLogin().LoginID;
            sectionLabelValue.AddedDate      = DateTime.Now;
            sectionLabelValue.Value          = txtValue.Text;
            sectionLabelValue.ExtraField1    = carePlanDateTime.CarePlanDateTimeID.ToString();
            sectionLabelValue.ExtraField2    = "";
            int resutl = SectionLabelValueManager.InsertSectionLabelValue(sectionLabelValue);
        }

        cleanData();
        loadAssessmentnCareDate();
    }
예제 #12
0
    public static bool UpdateCarePlanDateTime(CarePlanDateTime carePlanDateTime)
    {
        SqlCarePlanDateTimeProvider sqlCarePlanDateTimeProvider = new SqlCarePlanDateTimeProvider();

        return(sqlCarePlanDateTimeProvider.UpdateCarePlanDateTime(carePlanDateTime));
    }
예제 #13
0
    public static int InsertCarePlanDateTime(CarePlanDateTime carePlanDateTime)
    {
        SqlCarePlanDateTimeProvider sqlCarePlanDateTimeProvider = new SqlCarePlanDateTimeProvider();

        return(sqlCarePlanDateTimeProvider.InsertCarePlanDateTime(carePlanDateTime));
    }