public task_location Insert(task_location id) { string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_INSERT_TASK_LOCATION", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@task_id", id.task_id); cmd.Parameters.AddWithValue("@task_loc_description", id.task_loc_description); cmd.ExecuteReader(); con.Close(); con.Open(); cmd = new SqlCommand("SP_DMCS_GET_TASK_LOCATION", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@task_id", id.task_id); cmd.Parameters.AddWithValue("@task_loc_description", id.task_loc_description); SqlDataReader rdr = cmd.ExecuteReader(); if (rdr.HasRows) { rdr.Read(); id.task_loc_id = rdr.GetInt32(0); } } catch (Exception ex) { id.SetColumnDefaults(); } finally { con.Close(); } return id; }
public Boolean Update(task_location id) { string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_UPDATE_TASK_LOCATION", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@task_loc_id", id.task_loc_id); cmd.Parameters.AddWithValue("@task_id", id.task_id); cmd.Parameters.AddWithValue("@task_loc_description", id.task_loc_description); cmd.ExecuteReader(); con.Close(); return(true); } catch (Exception ex) { return(false); } finally { con.Close(); } }
public task_location Insert_task_location_select(int ID) { task_location = task_location.Select(ID); Insert_task_id_txt.Text = Convert.ToString(task_location.task_id); Insert_task_loc_description_txt.Text = Convert.ToString(task_location.task_loc_description); return task_location; }
public task_location Insert_task_location_select(int ID) { task_location = task_location.Select(ID); Insert_task_id_txt.Text = Convert.ToString(task_location.task_id); Insert_task_loc_description_txt.Text = Convert.ToString(task_location.task_loc_description); return(task_location); }
public task_location Delete_task_location_select(int ID) { task_location = task_location.Select(ID); Delete_task_loc_id_txt_lbl.Text = Convert.ToString(task_location.task_loc_id); Delete_task_id_txt_lbl.Text = Convert.ToString(task_location.task_id); Delete_task_loc_description_txt_lbl.Text = Convert.ToString(task_location.task_loc_description); return(task_location); }
public task_location Delete_task_location_select(int ID) { task_location = task_location.Select(ID); Delete_task_loc_id_txt_lbl.Text = Convert.ToString(task_location.task_loc_id); Delete_task_id_txt_lbl.Text = Convert.ToString(task_location.task_id); Delete_task_loc_description_txt_lbl.Text = Convert.ToString(task_location.task_loc_description); return task_location; }
public task_location Select(int id) { task_location task_location = new task_location(); string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_SELECT_TASK_LOCATION", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@task_loc_id", id); SqlDataReader rdr = cmd.ExecuteReader(); if (rdr.HasRows) { rdr.Read(); if (!rdr.IsDBNull(0)) { task_location.task_loc_id = rdr.GetInt32(0); } else { task_location.task_loc_id = 0; } if (!rdr.IsDBNull(1)) { task_location.task_id = rdr.GetInt32(1); } else { task_location.task_id = 0; } if (!rdr.IsDBNull(2)) { task_location.task_loc_description = rdr.GetString(2); } else { task_location.task_loc_description = " "; } } else { task_location.SetColumnDefaults(); } } catch (Exception ex) { task_location.SetColumnDefaults(); return(task_location); } finally { con.Close(); } return(task_location); }
public task_location task_location_insert() { task_location.task_id = Convert.ToInt32(Insert_task_id_txt.Text); task_location.task_loc_description = Insert_task_loc_description_txt.Text; task_location = task_location.Insert(task_location); Insert_task_location_GridView.DataBind(); Update_task_location_GridView.DataBind(); Delete_task_location_GridView.DataBind(); return(task_location); }
public task_location task_location_insert() { task_location.task_id = Convert.ToInt32(Insert_task_id_txt.Text); task_location.task_loc_description = Insert_task_loc_description_txt.Text; task_location = task_location.Insert(task_location); Insert_task_location_GridView.DataBind(); Update_task_location_GridView.DataBind(); Delete_task_location_GridView.DataBind(); return task_location; }
public task_location task_location_update(int ID) { task_location = task_location.Select(ID); task_location.task_loc_id = Convert.ToInt32(Update_task_loc_id_txt.Text); task_location.task_id = Convert.ToInt32(Update_task_id_txt.Text); task_location.task_loc_description = Update_task_loc_description_txt.Text; task_location.Update(task_location); Insert_task_location_GridView.DataBind(); Update_task_location_GridView.DataBind(); Delete_task_location_GridView.DataBind(); return(task_location); }
public task_location Insert(task_location id) { string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_INSERT_TASK_LOCATION", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@task_id", id.task_id); cmd.Parameters.AddWithValue("@task_loc_description", id.task_loc_description); cmd.ExecuteReader(); con.Close(); con.Open(); cmd = new SqlCommand("SP_DMCS_GET_TASK_LOCATION", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@task_id", id.task_id); cmd.Parameters.AddWithValue("@task_loc_description", id.task_loc_description); SqlDataReader rdr = cmd.ExecuteReader(); if (rdr.HasRows) { rdr.Read(); id.task_loc_id = rdr.GetInt32(0); } } catch (Exception ex) { id.SetColumnDefaults(); } finally { con.Close(); } return(id); }
protected void UPDATE(object sender, EventArgs e) { task_location = task_location_update(Convert.ToInt32(Update_task_location_GridView.SelectedValue)); }
public task_location Select(int id) { task_location task_location = new task_location(); string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_SELECT_TASK_LOCATION", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@task_loc_id", id); SqlDataReader rdr = cmd.ExecuteReader(); if (rdr.HasRows) { rdr.Read(); if (!rdr.IsDBNull(0)) { task_location.task_loc_id = rdr.GetInt32(0); } else { task_location.task_loc_id = 0; } if (!rdr.IsDBNull(1)) { task_location.task_id = rdr.GetInt32(1); } else { task_location.task_id = 0; } if (!rdr.IsDBNull(2)) { task_location.task_loc_description = rdr.GetString(2); } else { task_location.task_loc_description = " "; } } else { task_location.SetColumnDefaults(); } } catch (Exception ex) { task_location.SetColumnDefaults(); return task_location; } finally { con.Close(); } return task_location; }
public task_location task_location_update(int ID) { task_location = task_location.Select(ID); task_location.task_loc_id = Convert.ToInt32(Update_task_loc_id_txt.Text); task_location.task_id = Convert.ToInt32(Update_task_id_txt.Text); task_location.task_loc_description = Update_task_loc_description_txt.Text; task_location.Update(task_location); Insert_task_location_GridView.DataBind(); Update_task_location_GridView.DataBind(); Delete_task_location_GridView.DataBind(); return task_location; }
///////////////////////// //////////////////////// /////////////////////// ////////////////////// ///////////////////// //Update Tab Methods protected void Update_Select_Record(object sender, EventArgs e) { task_location = Update_task_location_select(Convert.ToInt32(Update_task_location_GridView.SelectedValue)); }
protected void INSERT(object sender, EventArgs e) { task_location = task_location_insert(); }
public Boolean Update(task_location id) { string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_UPDATE_TASK_LOCATION", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@task_loc_id", id.task_loc_id); cmd.Parameters.AddWithValue("@task_id", id.task_id); cmd.Parameters.AddWithValue("@task_loc_description", id.task_loc_description); cmd.ExecuteReader(); con.Close(); return true; } catch (Exception ex) { return false; } finally { con.Close(); } }