public static SectionTextValue GetSectionTextValueByID(int id) { SectionTextValue sectionTextValue = new SectionTextValue(); SqlSectionTextValueProvider sqlSectionTextValueProvider = new SqlSectionTextValueProvider(); sectionTextValue = sqlSectionTextValueProvider.GetSectionTextValueByID(id); return sectionTextValue; }
public static SectionTextValue GetSectionTextValueByCarePlanDateTimeID(int CarePlanDateTimeID) { SectionTextValue sectionTextValue = new SectionTextValue(); SqlSectionTextValueProvider sqlSectionTextValueProvider = new SqlSectionTextValueProvider(); sectionTextValue = sqlSectionTextValueProvider.GetSectionTextValueByCarePlanDateTimeID(CarePlanDateTimeID); return sectionTextValue; }
public static SectionTextValue GetSectionTextValueByCarePlanDateTimeID(int CarePlanDateTimeID) { SectionTextValue sectionTextValue = new SectionTextValue(); SqlSectionTextValueProvider sqlSectionTextValueProvider = new SqlSectionTextValueProvider(); sectionTextValue = sqlSectionTextValueProvider.GetSectionTextValueByCarePlanDateTimeID(CarePlanDateTimeID); return(sectionTextValue); }
public static SectionTextValue GetSectionTextValueByID(int id) { SectionTextValue sectionTextValue = new SectionTextValue(); SqlSectionTextValueProvider sqlSectionTextValueProvider = new SqlSectionTextValueProvider(); sectionTextValue = sqlSectionTextValueProvider.GetSectionTextValueByID(id); return(sectionTextValue); }
private void showSectionTextValueData() { SectionTextValue sectionTextValue = new SectionTextValue(); sectionTextValue = SectionTextValueManager.GetSectionTextValueByID(Int32.Parse(Request.QueryString["sectionTextValueID"])); ddlCarePlanDateTime.SelectedValue = sectionTextValue.CarePlanDateTimeID.ToString(); txtSection_2.Text = sectionTextValue.Section_2; txtSection_3.Text = sectionTextValue.Section_3; txtSection_6.Text = sectionTextValue.Section_6; txtSection_7.Text = sectionTextValue.Section_7; txtAddedBy.Text = sectionTextValue.AddedBy.ToString(); txtUpdatedBy.Text = sectionTextValue.UpdatedBy.ToString(); txtUpdatedDate.Text = sectionTextValue.UpdatedDate; }
protected void btnAdd_Click(object sender, EventArgs e) { SectionTextValue sectionTextValue = new SectionTextValue(); sectionTextValue.CarePlanDateTimeID = Int32.Parse(ddlCarePlanDateTime.SelectedValue); 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 = Int32.Parse(txtAddedBy.Text); sectionTextValue.AddedDate = DateTime.Now; sectionTextValue.UpdatedBy = Int32.Parse(txtUpdatedBy.Text); sectionTextValue.UpdatedDate = txtUpdatedDate.Text; int resutl = SectionTextValueManager.InsertSectionTextValue(sectionTextValue); Response.Redirect("AdminSectionTextValueDisplay.aspx"); }
public bool UpdateSectionTextValue(SectionTextValue sectionTextValue) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("AL_UpdateSectionTextValue", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@SectionTextValueID", SqlDbType.Int).Value = sectionTextValue.SectionTextValueID; cmd.Parameters.Add("@CarePlanDateTimeID", SqlDbType.Int).Value = sectionTextValue.CarePlanDateTimeID; cmd.Parameters.Add("@Section_2", SqlDbType.NText).Value = sectionTextValue.Section_2; cmd.Parameters.Add("@Section_3", SqlDbType.NText).Value = sectionTextValue.Section_3; cmd.Parameters.Add("@Section_6", SqlDbType.NText).Value = sectionTextValue.Section_6; cmd.Parameters.Add("@Section_7", SqlDbType.NText).Value = sectionTextValue.Section_7; cmd.Parameters.Add("@AddedBy", SqlDbType.Int).Value = sectionTextValue.AddedBy; cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = sectionTextValue.AddedDate; cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value = sectionTextValue.UpdatedBy; cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = sectionTextValue.UpdatedDate; connection.Open(); int result = cmd.ExecuteNonQuery(); return(result == 1); } }
protected void btnUpdate_Click(object sender, EventArgs e) { SectionTextValue sectionTextValue = new SectionTextValue(); sectionTextValue = SectionTextValueManager.GetSectionTextValueByID(Int32.Parse(Request.QueryString["sectionTextValueID"])); SectionTextValue tempSectionTextValue = new SectionTextValue(); tempSectionTextValue.SectionTextValueID = sectionTextValue.SectionTextValueID; tempSectionTextValue.CarePlanDateTimeID = Int32.Parse(ddlCarePlanDateTime.SelectedValue); tempSectionTextValue.Section_2 = txtSection_2.Text; tempSectionTextValue.Section_3 = txtSection_3.Text; tempSectionTextValue.Section_6 = txtSection_6.Text; tempSectionTextValue.Section_7 = txtSection_7.Text; tempSectionTextValue.AddedBy = Int32.Parse(txtAddedBy.Text); tempSectionTextValue.AddedDate = DateTime.Now; tempSectionTextValue.UpdatedBy = Int32.Parse(txtUpdatedBy.Text); tempSectionTextValue.UpdatedDate = txtUpdatedDate.Text; bool result = SectionTextValueManager.UpdateSectionTextValue(tempSectionTextValue); Response.Redirect("AdminSectionTextValueDisplay.aspx"); }
public SectionTextValue GetSectionTextValueFromReader(IDataReader reader) { try { SectionTextValue sectionTextValue = new SectionTextValue ( (int)reader["SectionTextValueID"], (int)reader["CarePlanDateTimeID"], reader["Section_2"].ToString(), reader["Section_3"].ToString(), reader["Section_6"].ToString(), reader["Section_7"].ToString(), (int)reader["AddedBy"], (DateTime)reader["AddedDate"], (int)reader["UpdatedBy"], (DateTime)reader["UpdatedDate"] ); return(sectionTextValue); } catch (Exception ex) { return(null); } }
public SectionTextValue GetSectionTextValueFromReader(IDataReader reader) { try { SectionTextValue sectionTextValue = new SectionTextValue ( (int)reader["SectionTextValueID"], (int)reader["CarePlanDateTimeID"], reader["Section_2"].ToString(), reader["Section_3"].ToString(), reader["Section_6"].ToString(), reader["Section_7"].ToString(), (int)reader["AddedBy"], (DateTime)reader["AddedDate"], (int)reader["UpdatedBy"], (DateTime)reader["UpdatedDate"] ); return sectionTextValue; } catch(Exception ex) { return null; } }
public bool UpdateSectionTextValue(SectionTextValue sectionTextValue) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("AL_UpdateSectionTextValue", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@SectionTextValueID", SqlDbType.Int).Value = sectionTextValue.SectionTextValueID; cmd.Parameters.Add("@CarePlanDateTimeID", SqlDbType.Int).Value = sectionTextValue.CarePlanDateTimeID; cmd.Parameters.Add("@Section_2", SqlDbType.NText).Value = sectionTextValue.Section_2; cmd.Parameters.Add("@Section_3", SqlDbType.NText).Value = sectionTextValue.Section_3; cmd.Parameters.Add("@Section_6", SqlDbType.NText).Value = sectionTextValue.Section_6; cmd.Parameters.Add("@Section_7", SqlDbType.NText).Value = sectionTextValue.Section_7; cmd.Parameters.Add("@AddedBy", SqlDbType.Int).Value = sectionTextValue.AddedBy; cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = sectionTextValue.AddedDate; cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value = sectionTextValue.UpdatedBy; cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = sectionTextValue.UpdatedDate; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }
public static bool UpdateSectionTextValue(SectionTextValue sectionTextValue) { SqlSectionTextValueProvider sqlSectionTextValueProvider = new SqlSectionTextValueProvider(); return sqlSectionTextValueProvider.UpdateSectionTextValue(sectionTextValue); }
public static int InsertSectionTextValue(SectionTextValue sectionTextValue) { SqlSectionTextValueProvider sqlSectionTextValueProvider = new SqlSectionTextValueProvider(); return sqlSectionTextValueProvider.InsertSectionTextValue(sectionTextValue); }
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(); }
public static bool UpdateSectionTextValue(SectionTextValue sectionTextValue) { SqlSectionTextValueProvider sqlSectionTextValueProvider = new SqlSectionTextValueProvider(); return(sqlSectionTextValueProvider.UpdateSectionTextValue(sectionTextValue)); }
public static int InsertSectionTextValue(SectionTextValue sectionTextValue) { SqlSectionTextValueProvider sqlSectionTextValueProvider = new SqlSectionTextValueProvider(); return(sqlSectionTextValueProvider.InsertSectionTextValue(sectionTextValue)); }
private void loadSelectData() { //load the text boxs SectionTextValue sectionTextValue = SectionTextValueManager.GetSectionTextValueByCarePlanDateTimeID(int.Parse(ddlExistingRecord.SelectedValue)); txtSection_2.Text = sectionTextValue.Section_2; txtSection_3.Text = sectionTextValue.Section_3; txtSection_6.Text = sectionTextValue.Section_6; txtSection_7.Text = sectionTextValue.Section_7; hfSectionTextValueID.Value = sectionTextValue.SectionTextValueID.ToString(); List <SectionLabelValue> SectionLabelValue = SectionLabelValueManager.GetAllSectionLabelValuesByCarePlanDateTimeID(int.Parse(ddlExistingRecord.SelectedValue)); //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"); foreach (SectionLabelValue item in SectionLabelValue) { if (item.SectionLabelID.ToString() == hfSectionLabelID.Value) { rbtnlSection.SelectedValue = item.Value; break; } } } //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"); foreach (SectionLabelValue item in SectionLabelValue) { if (item.SectionLabelID.ToString() == hfSectionLabelID.Value) { txtValue.Text = item.Value; break; } } } //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"); foreach (SectionLabelValue item in SectionLabelValue) { if (item.SectionLabelID.ToString() == hfSectionLabelID.Value) { rbtnlSection.SelectedValue = item.Value; break; } } } //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"); foreach (SectionLabelValue item in SectionLabelValue) { if (item.SectionLabelID.ToString() == hfSectionLabelID.Value) { txtValue.Text = item.Value; break; } } } //Saving the grid value for Section 8 foreach (GridViewRow gr in gvSection_9.Rows) { HiddenField hfSectionLabelID = (HiddenField)gr.FindControl("hfSectionLabelID"); TextBox txtValue = (TextBox)gr.FindControl("txtValue"); SectionLabelValue sectionLabelValue = new SectionLabelValue(); foreach (SectionLabelValue item in SectionLabelValue) { if (item.SectionLabelID.ToString() == hfSectionLabelID.Value) { txtValue.Text = item.Value; break; } } } }