public static SectionLabel GetSectionLabelByID(int id) { SectionLabel sectionLabel = new SectionLabel(); SqlSectionLabelProvider sqlSectionLabelProvider = new SqlSectionLabelProvider(); sectionLabel = sqlSectionLabelProvider.GetSectionLabelByID(id); return(sectionLabel); }
private void showSectionLabelData(int id) { SectionLabel sectionLabel = new SectionLabel(); sectionLabel = SectionLabelManager.GetSectionLabelByID(id); txtSectionNo.Text = sectionLabel.SectionNo.ToString(); txtLabelText.Text = sectionLabel.LabelText; txtExtraField1.Text = sectionLabel.ExtraField1; txtExtraField2.Text = sectionLabel.ExtraField2; txtExtraField3.Text = sectionLabel.ExtraField3; txtExtraField4.Text = sectionLabel.ExtraField4; txtExtraField5.Text = sectionLabel.ExtraField5; }
private void showSectionLabelData() { SectionLabel sectionLabel = new SectionLabel(); sectionLabel = SectionLabelManager.GetSectionLabelByID(Int32.Parse(Request.QueryString["sectionLabelID"])); txtSectionNo.Text = sectionLabel.SectionNo.ToString(); txtLabelText.Text = sectionLabel.LabelText; txtExtraField1.Text = sectionLabel.ExtraField1; txtExtraField2.Text = sectionLabel.ExtraField2; txtExtraField3.Text = sectionLabel.ExtraField3; txtExtraField4.Text = sectionLabel.ExtraField4; txtExtraField5.Text = sectionLabel.ExtraField5; }
protected void btnAdd_Click(object sender, EventArgs e) { SectionLabel sectionLabel = new SectionLabel(); sectionLabel.SectionNo = Int32.Parse(txtSectionNo.Text); sectionLabel.LabelText = txtLabelText.Text; sectionLabel.ExtraField1 = txtExtraField1.Text; sectionLabel.ExtraField2 = txtExtraField2.Text; sectionLabel.ExtraField3 = txtExtraField3.Text; sectionLabel.ExtraField4 = txtExtraField4.Text; sectionLabel.ExtraField5 = txtExtraField5.Text; int resutl = SectionLabelManager.InsertSectionLabel(sectionLabel); Response.Redirect("AdminSectionLabelDisplay.aspx"); }
protected void btnAdd_Click(object sender, EventArgs e) { SectionLabel sectionLabel = new SectionLabel(); sectionLabel.SectionNo = Int32.Parse(txtSectionNo.Text); sectionLabel.LabelText = txtLabelText.Text; sectionLabel.ExtraField1 = txtExtraField1.Text; sectionLabel.ExtraField2 = txtExtraField2.Text; sectionLabel.ExtraField3 = txtExtraField3.Text; sectionLabel.ExtraField4 = txtExtraField4.Text; sectionLabel.ExtraField5 = txtExtraField5.Text; int resutl = SectionLabelManager.InsertSectionLabel(sectionLabel); showSectionLabelGrid(); }
public bool UpdateSectionLabel(SectionLabel sectionLabel) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("AL_UpdateSectionLabel", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@SectionLabelID", SqlDbType.Int).Value = sectionLabel.SectionLabelID; cmd.Parameters.Add("@SectionNo", SqlDbType.Int).Value = sectionLabel.SectionNo; cmd.Parameters.Add("@LabelText", SqlDbType.NVarChar).Value = sectionLabel.LabelText; cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = sectionLabel.ExtraField1; cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = sectionLabel.ExtraField2; cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value = sectionLabel.ExtraField3; cmd.Parameters.Add("@ExtraField4", SqlDbType.NVarChar).Value = sectionLabel.ExtraField4; cmd.Parameters.Add("@ExtraField5", SqlDbType.NVarChar).Value = sectionLabel.ExtraField5; connection.Open(); int result = cmd.ExecuteNonQuery(); return(result == 1); } }
protected void btnUpdate_Click(object sender, EventArgs e) { SectionLabel sectionLabel = new SectionLabel(); sectionLabel = SectionLabelManager.GetSectionLabelByID(Int32.Parse(Request.QueryString["sectionLabelID"])); SectionLabel tempSectionLabel = new SectionLabel(); tempSectionLabel.SectionLabelID = sectionLabel.SectionLabelID; tempSectionLabel.SectionNo = Int32.Parse(txtSectionNo.Text); tempSectionLabel.LabelText = txtLabelText.Text; tempSectionLabel.ExtraField1 = txtExtraField1.Text; tempSectionLabel.ExtraField2 = txtExtraField2.Text; tempSectionLabel.ExtraField3 = txtExtraField3.Text; tempSectionLabel.ExtraField4 = txtExtraField4.Text; tempSectionLabel.ExtraField5 = txtExtraField5.Text; bool result = SectionLabelManager.UpdateSectionLabel(tempSectionLabel); Response.Redirect("AdminSectionLabelDisplay.aspx"); }
public SectionLabel GetSectionLabelFromReader(IDataReader reader) { try { SectionLabel sectionLabel = new SectionLabel ( (int)reader["SectionLabelID"], (int)reader["SectionNo"], reader["LabelText"].ToString(), reader["ExtraField1"].ToString(), reader["ExtraField2"].ToString(), reader["ExtraField3"].ToString(), reader["ExtraField4"].ToString(), reader["ExtraField5"].ToString() ); return(sectionLabel); } catch (Exception ex) { return(null); } }
protected void btnUpdate_Click(object sender, EventArgs e) { SectionLabel tempSectionLabel = new SectionLabel(); tempSectionLabel.SectionNo = Int32.Parse(txtSectionNo.Text); tempSectionLabel.LabelText = txtLabelText.Text; tempSectionLabel.ExtraField1 = txtExtraField1.Text; tempSectionLabel.ExtraField2 = txtExtraField2.Text; tempSectionLabel.ExtraField3 = txtExtraField3.Text; tempSectionLabel.ExtraField4 = txtExtraField4.Text; tempSectionLabel.ExtraField5 = txtExtraField5.Text; if (hfID.Value != "0") { tempSectionLabel.SectionLabelID = int.Parse(hfID.Value); SectionLabelManager.UpdateSectionLabel(tempSectionLabel); } else { SectionLabelManager.InsertSectionLabel(tempSectionLabel); } showSectionLabelGrid(); Clear_Click(); }
public static bool UpdateSectionLabel(SectionLabel sectionLabel) { SqlSectionLabelProvider sqlSectionLabelProvider = new SqlSectionLabelProvider(); return(sqlSectionLabelProvider.UpdateSectionLabel(sectionLabel)); }
public static int InsertSectionLabel(SectionLabel sectionLabel) { SqlSectionLabelProvider sqlSectionLabelProvider = new SqlSectionLabelProvider(); return(sqlSectionLabelProvider.InsertSectionLabel(sectionLabel)); }
void Awake() { sectionLabel = this; }
public SectionLabel GetSectionLabelFromReader(IDataReader reader) { try { SectionLabel sectionLabel = new SectionLabel ( (int)reader["SectionLabelID"], (int)reader["SectionNo"], reader["LabelText"].ToString(), reader["ExtraField1"].ToString(), reader["ExtraField2"].ToString(), reader["ExtraField3"].ToString(), reader["ExtraField4"].ToString(), reader["ExtraField5"].ToString() ); return sectionLabel; } catch(Exception ex) { return null; } }
public bool UpdateSectionLabel(SectionLabel sectionLabel) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("AL_UpdateSectionLabel", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@SectionLabelID", SqlDbType.Int).Value = sectionLabel.SectionLabelID; cmd.Parameters.Add("@SectionNo", SqlDbType.Int).Value = sectionLabel.SectionNo; cmd.Parameters.Add("@LabelText", SqlDbType.NVarChar).Value = sectionLabel.LabelText; cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = sectionLabel.ExtraField1; cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = sectionLabel.ExtraField2; cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value = sectionLabel.ExtraField3; cmd.Parameters.Add("@ExtraField4", SqlDbType.NVarChar).Value = sectionLabel.ExtraField4; cmd.Parameters.Add("@ExtraField5", SqlDbType.NVarChar).Value = sectionLabel.ExtraField5; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }