public static SectionLabelValue GetSectionLabelValueByID(int id) { SectionLabelValue sectionLabelValue = new SectionLabelValue(); SqlSectionLabelValueProvider sqlSectionLabelValueProvider = new SqlSectionLabelValueProvider(); sectionLabelValue = sqlSectionLabelValueProvider.GetSectionLabelValueByID(id); return sectionLabelValue; }
public static SectionLabelValue GetSectionLabelValueByID(int id) { SectionLabelValue sectionLabelValue = new SectionLabelValue(); SqlSectionLabelValueProvider sqlSectionLabelValueProvider = new SqlSectionLabelValueProvider(); sectionLabelValue = sqlSectionLabelValueProvider.GetSectionLabelValueByID(id); return(sectionLabelValue); }
private void showSectionLabelValueData() { SectionLabelValue sectionLabelValue = new SectionLabelValue(); sectionLabelValue = SectionLabelValueManager.GetSectionLabelValueByID(Int32.Parse(Request.QueryString["sectionLabelValueID"])); ddlSectionLabel.SelectedValue = sectionLabelValue.SectionLabelID.ToString(); txtAddedBy.Text = sectionLabelValue.AddedBy.ToString(); txtValue.Text = sectionLabelValue.Value; txtExtraField1.Text = sectionLabelValue.ExtraField1; txtExtraField2.Text = sectionLabelValue.ExtraField2; }
protected void btnAdd_Click(object sender, EventArgs e) { SectionLabelValue sectionLabelValue = new SectionLabelValue(); sectionLabelValue.SectionLabelID = Int32.Parse(ddlSectionLabel.SelectedValue); sectionLabelValue.AddedBy = Int32.Parse(txtAddedBy.Text); sectionLabelValue.AddedDate = DateTime.Now; sectionLabelValue.Value = txtValue.Text; sectionLabelValue.ExtraField1 = txtExtraField1.Text; sectionLabelValue.ExtraField2 = txtExtraField2.Text; int resutl = SectionLabelValueManager.InsertSectionLabelValue(sectionLabelValue); Response.Redirect("AdminSectionLabelValueDisplay.aspx"); }
public bool UpdateSectionLabelValue(SectionLabelValue sectionLabelValue) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("AL_UpdateSectionLabelValue", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@SectionLabelValueID", SqlDbType.Int).Value = sectionLabelValue.SectionLabelValueID; cmd.Parameters.Add("@SectionLabelID", SqlDbType.Int).Value = sectionLabelValue.SectionLabelID; cmd.Parameters.Add("@AddedBy", SqlDbType.Int).Value = sectionLabelValue.AddedBy; cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = sectionLabelValue.AddedDate; cmd.Parameters.Add("@Value", SqlDbType.NVarChar).Value = sectionLabelValue.Value; cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = sectionLabelValue.ExtraField1; cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = sectionLabelValue.ExtraField2; connection.Open(); int result = cmd.ExecuteNonQuery(); return(result == 1); } }
protected void btnUpdate_Click(object sender, EventArgs e) { SectionLabelValue sectionLabelValue = new SectionLabelValue(); sectionLabelValue = SectionLabelValueManager.GetSectionLabelValueByID(Int32.Parse(Request.QueryString["sectionLabelValueID"])); SectionLabelValue tempSectionLabelValue = new SectionLabelValue(); tempSectionLabelValue.SectionLabelValueID = sectionLabelValue.SectionLabelValueID; tempSectionLabelValue.SectionLabelID = Int32.Parse(ddlSectionLabel.SelectedValue); tempSectionLabelValue.AddedBy = Int32.Parse(txtAddedBy.Text); tempSectionLabelValue.AddedDate = DateTime.Now; tempSectionLabelValue.Value = txtValue.Text; tempSectionLabelValue.ExtraField1 = txtExtraField1.Text; tempSectionLabelValue.ExtraField2 = txtExtraField2.Text; bool result = SectionLabelValueManager.UpdateSectionLabelValue(tempSectionLabelValue); Response.Redirect("AdminSectionLabelValueDisplay.aspx"); }
public SectionLabelValue GetSectionLabelValueFromReader(IDataReader reader) { try { SectionLabelValue sectionLabelValue = new SectionLabelValue ( (int)reader["SectionLabelValueID"], (int)reader["SectionLabelID"], (int)reader["AddedBy"], (DateTime)reader["AddedDate"], reader["Value"].ToString(), reader["ExtraField1"].ToString(), reader["ExtraField2"].ToString() ); return(sectionLabelValue); } catch (Exception ex) { return(null); } }
public static bool UpdateSectionLabelValue(SectionLabelValue sectionLabelValue) { SqlSectionLabelValueProvider sqlSectionLabelValueProvider = new SqlSectionLabelValueProvider(); return(sqlSectionLabelValueProvider.UpdateSectionLabelValue(sectionLabelValue)); }
public static int InsertSectionLabelValue(SectionLabelValue sectionLabelValue) { SqlSectionLabelValueProvider sqlSectionLabelValueProvider = new SqlSectionLabelValueProvider(); return(sqlSectionLabelValueProvider.InsertSectionLabelValue(sectionLabelValue)); }
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; } } } }
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 bool UpdateSectionLabelValue(SectionLabelValue sectionLabelValue) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("AL_UpdateSectionLabelValue", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@SectionLabelValueID", SqlDbType.Int).Value = sectionLabelValue.SectionLabelValueID; cmd.Parameters.Add("@SectionLabelID", SqlDbType.Int).Value = sectionLabelValue.SectionLabelID; cmd.Parameters.Add("@AddedBy", SqlDbType.Int).Value = sectionLabelValue.AddedBy; cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = sectionLabelValue.AddedDate; cmd.Parameters.Add("@Value", SqlDbType.NVarChar).Value = sectionLabelValue.Value; cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = sectionLabelValue.ExtraField1; cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = sectionLabelValue.ExtraField2; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }
public SectionLabelValue GetSectionLabelValueFromReader(IDataReader reader) { try { SectionLabelValue sectionLabelValue = new SectionLabelValue ( (int)reader["SectionLabelValueID"], (int)reader["SectionLabelID"], (int)reader["AddedBy"], (DateTime)reader["AddedDate"], reader["Value"].ToString(), reader["ExtraField1"].ToString(), reader["ExtraField2"].ToString() ); return sectionLabelValue; } catch(Exception ex) { return null; } }
public static bool UpdateSectionLabelValue(SectionLabelValue sectionLabelValue) { SqlSectionLabelValueProvider sqlSectionLabelValueProvider = new SqlSectionLabelValueProvider(); return sqlSectionLabelValueProvider.UpdateSectionLabelValue(sectionLabelValue); }
public static int InsertSectionLabelValue(SectionLabelValue sectionLabelValue) { SqlSectionLabelValueProvider sqlSectionLabelValueProvider = new SqlSectionLabelValueProvider(); return sqlSectionLabelValueProvider.InsertSectionLabelValue(sectionLabelValue); }