public demobilization Insert(demobilization id) { string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_INSERT_DEMOBILIZATION", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.ExecuteReader(); con.Close(); con.Open(); cmd = new SqlCommand("SP_DMCS_GET_DEMOBILIZATION", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; SqlDataReader rdr = cmd.ExecuteReader(); if (rdr.HasRows) { rdr.Read(); id.demo_id = rdr.GetInt32(0); } } catch (Exception ex) { id.SetColumnDefaults(); } finally { con.Close(); } return id; }
public demobilization Insert(demobilization id) { string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_INSERT_DEMOBILIZATION", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.ExecuteReader(); con.Close(); con.Open(); cmd = new SqlCommand("SP_DMCS_GET_DEMOBILIZATION", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; SqlDataReader rdr = cmd.ExecuteReader(); if (rdr.HasRows) { rdr.Read(); id.demo_id = rdr.GetInt32(0); } } catch (Exception ex) { id.SetColumnDefaults(); } finally { con.Close(); } return(id); }
public demobilization demobilization_insert() { demobilization = demobilization.Insert(demobilization); Insert_demobilization_GridView.DataBind(); Update_demobilization_GridView.DataBind(); Delete_demobilization_GridView.DataBind(); return demobilization; }
public demobilization demobilization_insert() { demobilization = demobilization.Insert(demobilization); Insert_demobilization_GridView.DataBind(); Update_demobilization_GridView.DataBind(); Delete_demobilization_GridView.DataBind(); return(demobilization); }
public demobilization demobilization_update(int ID) { demobilization = demobilization.Select(ID); demobilization.demo_id = Convert.ToInt32(Update_demo_id_txt.Text); demobilization.Update(demobilization); Insert_demobilization_GridView.DataBind(); Update_demobilization_GridView.DataBind(); Delete_demobilization_GridView.DataBind(); return demobilization; }
public demobilization demobilization_update(int ID) { demobilization = demobilization.Select(ID); demobilization.demo_id = Convert.ToInt32(Update_demo_id_txt.Text); demobilization.Update(demobilization); Insert_demobilization_GridView.DataBind(); Update_demobilization_GridView.DataBind(); Delete_demobilization_GridView.DataBind(); return(demobilization); }
public demobilization Select(int id) { demobilization demobilization = new demobilization(); string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_SELECT_DEMOBILIZATION", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@demo_id", id); SqlDataReader rdr = cmd.ExecuteReader(); if (rdr.HasRows) { rdr.Read(); if (!rdr.IsDBNull(0)) { demobilization.demo_id = rdr.GetInt32(0); } else { demobilization.demo_id = 0; } } else { demobilization.SetColumnDefaults(); } } catch (Exception ex) { demobilization.SetColumnDefaults(); return(demobilization); } finally { con.Close(); } return(demobilization); }
public demobilization Select(int id) { demobilization demobilization = new demobilization(); string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_SELECT_DEMOBILIZATION", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@demo_id", id); SqlDataReader rdr = cmd.ExecuteReader(); if (rdr.HasRows) { rdr.Read(); if (!rdr.IsDBNull(0)) { demobilization.demo_id = rdr.GetInt32(0); } else { demobilization.demo_id = 0; } } else { demobilization.SetColumnDefaults(); } } catch (Exception ex) { demobilization.SetColumnDefaults(); return demobilization; } finally { con.Close(); } return demobilization; }
public Boolean Update(demobilization id) { string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_UPDATE_DEMOBILIZATION", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@demo_id", id.demo_id); cmd.ExecuteReader(); con.Close(); return(true); } catch (Exception ex) { return(false); } finally { con.Close(); } }
public demobilization Update_demobilization_select(int ID) { demobilization = demobilization.Select(ID); Update_demo_id_txt.Text = Convert.ToString(demobilization.demo_id); return demobilization; }
protected void INSERT(object sender, EventArgs e) { demobilization = demobilization_insert(); }
public demobilization Insert_demobilization_select(int ID) { demobilization = demobilization.Select(ID); return(demobilization); }
protected void UPDATE(object sender, EventArgs e) { demobilization = demobilization_update(Convert.ToInt32(Update_demobilization_GridView.SelectedValue)); }
///////////////////////// //////////////////////// /////////////////////// ////////////////////// ///////////////////// //Update Tab Methods protected void Update_Select_Record(object sender, EventArgs e) { demobilization = Update_demobilization_select(Convert.ToInt32(Update_demobilization_GridView.SelectedValue)); }
public demobilization Insert_demobilization_select(int ID) { demobilization = demobilization.Select(ID); return demobilization; }
public demobilization Update_demobilization_select(int ID) { demobilization = demobilization.Select(ID); Update_demo_id_txt.Text = Convert.ToString(demobilization.demo_id); return(demobilization); }
public Boolean Update(demobilization id) { string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_UPDATE_DEMOBILIZATION", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@demo_id", id.demo_id); cmd.ExecuteReader(); con.Close(); return true; } catch (Exception ex) { return false; } finally { con.Close(); } }