public personDMCS Insert_personDMCS_select(int ID) { personDMCS = personDMCS.Select(ID); Insert_Resource_ID_txt.Text = Convert.ToString(personDMCS.Resource_ID); Insert_f_name_txt.Text = Convert.ToString(personDMCS.f_name); Insert_l_name_txt.Text = Convert.ToString(personDMCS.l_name); Insert_address_txt.Text = Convert.ToString(personDMCS.address); Insert_city_txt.Text = Convert.ToString(personDMCS.city); Insert_state_txt.Text = Convert.ToString(personDMCS.state); Insert_zipcode_txt.Text = Convert.ToString(personDMCS.zipcode); Insert_phone_primary_txt.Text = Convert.ToString(personDMCS.phone_primary); Insert_email_txt.Text = Convert.ToString(personDMCS.email); Insert_creditcard_txt.Text = Convert.ToString(personDMCS.creditcard); Insert_availability_date_txt.Text = Convert.ToString(personDMCS.availability_date); Insert_availability_hours_txt.Text = Convert.ToString(personDMCS.availability_hours); Insert_birthdate_txt.Text = Convert.ToString(personDMCS.birthdate); Insert_marital_status_txt.Text = Convert.ToString(personDMCS.marital_status); Insert_gender_txt.Text = Convert.ToString(personDMCS.gender); Insert_jobtitle_txt.Text = Convert.ToString(personDMCS.jobtitle); Insert_workdate_txt.Text = Convert.ToString(personDMCS.workdate); Insert_regpay_txt.Text = Convert.ToString(personDMCS.regpay); Insert_OT_txt.Text = Convert.ToString(personDMCS.OT); Insert_OT_rate_txt.Text = Convert.ToString(personDMCS.OT_rate); Insert_hourly_rate_txt.Text = Convert.ToString(personDMCS.hourly_rate); return personDMCS; }
public personDMCS personDMCS_update(int ID) { personDMCS = personDMCS.Select(ID); personDMCS.Person_ID = Convert.ToInt32(Update_Person_ID_txt.Text); personDMCS.Resource_ID = Convert.ToInt32(Update_Resource_ID_txt.Text); personDMCS.f_name = Update_f_name_txt.Text; personDMCS.l_name = Update_l_name_txt.Text; personDMCS.address = Update_address_txt.Text; personDMCS.city = Update_city_txt.Text; personDMCS.state = Update_state_txt.Text; personDMCS.zipcode = Convert.ToInt32(Update_zipcode_txt.Text); personDMCS.phone_primary = Update_phone_primary_txt.Text; personDMCS.email = Update_email_txt.Text; personDMCS.creditcard = Update_creditcard_txt.Text; personDMCS.availability_date = Convert.ToDateTime(Update_availability_date_txt.Text); personDMCS.availability_hours = Convert.ToInt32(Update_availability_hours_txt.Text); personDMCS.birthdate = Convert.ToDateTime(Update_birthdate_txt.Text); personDMCS.marital_status = Update_marital_status_txt.Text; personDMCS.gender = Update_gender_txt.Text; personDMCS.jobtitle = Update_jobtitle_txt.Text; personDMCS.workdate = Convert.ToDateTime(Update_workdate_txt.Text); personDMCS.regpay = Convert.ToDecimal(Update_regpay_txt.Text); personDMCS.OT = Convert.ToInt32(Update_OT_txt.Text); personDMCS.OT_rate = Convert.ToDecimal(Update_OT_rate_txt.Text); personDMCS.hourly_rate = Convert.ToDecimal(Update_hourly_rate_txt.Text); personDMCS.Update(personDMCS); Insert_personDMCS_GridView.DataBind(); Update_personDMCS_GridView.DataBind(); Delete_personDMCS_GridView.DataBind(); return(personDMCS); }
public personDMCS personDMCS_insert() { personDMCS.Resource_ID = Convert.ToInt32(Insert_Resource_ID_txt.Text); personDMCS.f_name = Insert_f_name_txt.Text; personDMCS.l_name = Insert_l_name_txt.Text; personDMCS.address = Insert_address_txt.Text; personDMCS.city = Insert_city_txt.Text; personDMCS.state = Insert_state_txt.Text; personDMCS.zipcode = Convert.ToInt32(Insert_zipcode_txt.Text); personDMCS.phone_primary = Insert_phone_primary_txt.Text; personDMCS.email = Insert_email_txt.Text; personDMCS.creditcard = Insert_creditcard_txt.Text; personDMCS.availability_date = Convert.ToDateTime(Insert_availability_date_txt.Text); personDMCS.availability_hours = Convert.ToInt32(Insert_availability_hours_txt.Text); personDMCS.birthdate = Convert.ToDateTime(Insert_birthdate_txt.Text); personDMCS.marital_status = Insert_marital_status_txt.Text; personDMCS.gender = Insert_gender_txt.Text; personDMCS.jobtitle = Insert_jobtitle_txt.Text; personDMCS.workdate = Convert.ToDateTime(Insert_workdate_txt.Text); personDMCS.regpay = Convert.ToDecimal(Insert_regpay_txt.Text); personDMCS.OT = Convert.ToInt32(Insert_OT_txt.Text); personDMCS.OT_rate = Convert.ToDecimal(Insert_OT_rate_txt.Text); personDMCS.hourly_rate = Convert.ToDecimal(Insert_hourly_rate_txt.Text); personDMCS = personDMCS.Insert(personDMCS); Insert_personDMCS_GridView.DataBind(); Update_personDMCS_GridView.DataBind(); Delete_personDMCS_GridView.DataBind(); return(personDMCS); }
public personDMCS Insert_personDMCS_select(int ID) { personDMCS = personDMCS.Select(ID); Insert_Resource_ID_txt.Text = Convert.ToString(personDMCS.Resource_ID); Insert_f_name_txt.Text = Convert.ToString(personDMCS.f_name); Insert_l_name_txt.Text = Convert.ToString(personDMCS.l_name); Insert_address_txt.Text = Convert.ToString(personDMCS.address); Insert_city_txt.Text = Convert.ToString(personDMCS.city); Insert_state_txt.Text = Convert.ToString(personDMCS.state); Insert_zipcode_txt.Text = Convert.ToString(personDMCS.zipcode); Insert_phone_primary_txt.Text = Convert.ToString(personDMCS.phone_primary); Insert_email_txt.Text = Convert.ToString(personDMCS.email); Insert_creditcard_txt.Text = Convert.ToString(personDMCS.creditcard); Insert_availability_date_txt.Text = Convert.ToString(personDMCS.availability_date); Insert_availability_hours_txt.Text = Convert.ToString(personDMCS.availability_hours); Insert_birthdate_txt.Text = Convert.ToString(personDMCS.birthdate); Insert_marital_status_txt.Text = Convert.ToString(personDMCS.marital_status); Insert_gender_txt.Text = Convert.ToString(personDMCS.gender); Insert_jobtitle_txt.Text = Convert.ToString(personDMCS.jobtitle); Insert_workdate_txt.Text = Convert.ToString(personDMCS.workdate); Insert_regpay_txt.Text = Convert.ToString(personDMCS.regpay); Insert_OT_txt.Text = Convert.ToString(personDMCS.OT); Insert_OT_rate_txt.Text = Convert.ToString(personDMCS.OT_rate); Insert_hourly_rate_txt.Text = Convert.ToString(personDMCS.hourly_rate); return(personDMCS); }
public Boolean Update(personDMCS id) { string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_UPDATE_PERSONDMCS", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Person_ID", id.Person_ID); cmd.Parameters.AddWithValue("@Resource_ID", id.Resource_ID); cmd.Parameters.AddWithValue("@f_name", id.f_name); cmd.Parameters.AddWithValue("@l_name", id.l_name); cmd.Parameters.AddWithValue("@address", id.address); cmd.Parameters.AddWithValue("@city", id.city); cmd.Parameters.AddWithValue("@state", id.state); cmd.Parameters.AddWithValue("@zipcode", id.zipcode); cmd.Parameters.AddWithValue("@phone_primary", id.phone_primary); cmd.Parameters.AddWithValue("@email", id.email); cmd.Parameters.AddWithValue("@creditcard", id.creditcard); cmd.Parameters.AddWithValue("@availability_date", id.availability_date); cmd.Parameters.AddWithValue("@availability_hours", id.availability_hours); cmd.Parameters.AddWithValue("@birthdate", id.birthdate); cmd.Parameters.AddWithValue("@marital_status", id.marital_status); cmd.Parameters.AddWithValue("@gender", id.gender); cmd.Parameters.AddWithValue("@jobtitle", id.jobtitle); cmd.Parameters.AddWithValue("@workdate", id.workdate); cmd.Parameters.AddWithValue("@regpay", id.regpay); cmd.Parameters.AddWithValue("@OT", id.OT); cmd.Parameters.AddWithValue("@OT_rate", id.OT_rate); cmd.Parameters.AddWithValue("@hourly_rate", id.hourly_rate); cmd.ExecuteReader(); con.Close(); return(true); } catch (Exception ex) { return(false); } finally { con.Close(); } }
public personDMCS Select(int id) { personDMCS personDMCS = new personDMCS(); string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_SELECT_PERSONDMCS", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Person_ID", id); SqlDataReader rdr = cmd.ExecuteReader(); if (rdr.HasRows) { rdr.Read(); if (!rdr.IsDBNull(0)) { personDMCS.Person_ID = rdr.GetInt32(0); } else { personDMCS.Person_ID = 0; } if (!rdr.IsDBNull(1)) { personDMCS.Resource_ID = rdr.GetInt32(1); } else { personDMCS.Resource_ID = 0; } if (!rdr.IsDBNull(2)) { personDMCS.f_name = rdr.GetString(2); } else { personDMCS.f_name = " "; } if (!rdr.IsDBNull(3)) { personDMCS.l_name = rdr.GetString(3); } else { personDMCS.l_name = " "; } if (!rdr.IsDBNull(4)) { personDMCS.address = rdr.GetString(4); } else { personDMCS.address = " "; } if (!rdr.IsDBNull(5)) { personDMCS.city = rdr.GetString(5); } else { personDMCS.city = " "; } if (!rdr.IsDBNull(6)) { personDMCS.state = rdr.GetString(6); } else { personDMCS.state = " "; } if (!rdr.IsDBNull(7)) { personDMCS.zipcode = rdr.GetInt32(7); } else { personDMCS.zipcode = 0; } if (!rdr.IsDBNull(8)) { personDMCS.phone_primary = rdr.GetString(8); } else { personDMCS.phone_primary = " "; } if (!rdr.IsDBNull(9)) { personDMCS.email = rdr.GetString(9); } else { personDMCS.email = " "; } if (!rdr.IsDBNull(10)) { personDMCS.creditcard = rdr.GetString(10); } else { personDMCS.creditcard = " "; } if (!rdr.IsDBNull(11)) { personDMCS.availability_date = rdr.GetDateTime(11); } else { personDMCS.availability_date = DateTime.Now; } if (!rdr.IsDBNull(12)) { personDMCS.availability_hours = rdr.GetInt32(12); } else { personDMCS.availability_hours = 0; } if (!rdr.IsDBNull(13)) { personDMCS.birthdate = rdr.GetDateTime(13); } else { personDMCS.birthdate = DateTime.Now; } if (!rdr.IsDBNull(14)) { personDMCS.marital_status = rdr.GetString(14); } else { personDMCS.marital_status = " "; } if (!rdr.IsDBNull(15)) { personDMCS.gender = rdr.GetString(15); } else { personDMCS.gender = " "; } if (!rdr.IsDBNull(16)) { personDMCS.jobtitle = rdr.GetString(16); } else { personDMCS.jobtitle = " "; } if (!rdr.IsDBNull(17)) { personDMCS.workdate = rdr.GetDateTime(17); } else { personDMCS.workdate = DateTime.Now; } if (!rdr.IsDBNull(18)) { personDMCS.regpay = rdr.GetDecimal(18); } else { personDMCS.regpay = 0; } if (!rdr.IsDBNull(19)) { personDMCS.OT = rdr.GetInt32(19); } else { personDMCS.OT = 0; } if (!rdr.IsDBNull(20)) { personDMCS.OT_rate = rdr.GetDecimal(20); } else { personDMCS.OT_rate = 0; } if (!rdr.IsDBNull(21)) { personDMCS.hourly_rate = rdr.GetDecimal(21); } else { personDMCS.hourly_rate = 0; } } else { personDMCS.SetColumnDefaults(); } } catch (Exception ex) { personDMCS.SetColumnDefaults(); return(personDMCS); } finally { con.Close(); } return(personDMCS); }
public Boolean Update(personDMCS id) { string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_UPDATE_PERSONDMCS", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Person_ID", id.Person_ID); cmd.Parameters.AddWithValue("@Resource_ID", id.Resource_ID); cmd.Parameters.AddWithValue("@f_name", id.f_name); cmd.Parameters.AddWithValue("@l_name", id.l_name); cmd.Parameters.AddWithValue("@address", id.address); cmd.Parameters.AddWithValue("@city", id.city); cmd.Parameters.AddWithValue("@state", id.state); cmd.Parameters.AddWithValue("@zipcode", id.zipcode); cmd.Parameters.AddWithValue("@phone_primary", id.phone_primary); cmd.Parameters.AddWithValue("@email", id.email); cmd.Parameters.AddWithValue("@creditcard", id.creditcard); cmd.Parameters.AddWithValue("@availability_date", id.availability_date); cmd.Parameters.AddWithValue("@availability_hours", id.availability_hours); cmd.Parameters.AddWithValue("@birthdate", id.birthdate); cmd.Parameters.AddWithValue("@marital_status", id.marital_status); cmd.Parameters.AddWithValue("@gender", id.gender); cmd.Parameters.AddWithValue("@jobtitle", id.jobtitle); cmd.Parameters.AddWithValue("@workdate", id.workdate); cmd.Parameters.AddWithValue("@regpay", id.regpay); cmd.Parameters.AddWithValue("@OT", id.OT); cmd.Parameters.AddWithValue("@OT_rate", id.OT_rate); cmd.Parameters.AddWithValue("@hourly_rate", id.hourly_rate); cmd.ExecuteReader(); con.Close(); return true; } catch (Exception ex) { return false; } finally { con.Close(); } }
public personDMCS Select(int id) { personDMCS personDMCS = new personDMCS(); string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_SELECT_PERSONDMCS", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Person_ID", id); SqlDataReader rdr = cmd.ExecuteReader(); if (rdr.HasRows) { rdr.Read(); if (!rdr.IsDBNull(0)) { personDMCS.Person_ID = rdr.GetInt32(0); } else { personDMCS.Person_ID = 0; } if (!rdr.IsDBNull(1)) { personDMCS.Resource_ID = rdr.GetInt32(1); } else { personDMCS.Resource_ID = 0; } if (!rdr.IsDBNull(2)) { personDMCS.f_name = rdr.GetString(2); } else { personDMCS.f_name = " "; } if (!rdr.IsDBNull(3)) { personDMCS.l_name = rdr.GetString(3); } else { personDMCS.l_name = " "; } if (!rdr.IsDBNull(4)) { personDMCS.address = rdr.GetString(4); } else { personDMCS.address = " "; } if (!rdr.IsDBNull(5)) { personDMCS.city = rdr.GetString(5); } else { personDMCS.city = " "; } if (!rdr.IsDBNull(6)) { personDMCS.state = rdr.GetString(6); } else { personDMCS.state = " "; } if (!rdr.IsDBNull(7)) { personDMCS.zipcode = rdr.GetInt32(7); } else { personDMCS.zipcode = 0; } if (!rdr.IsDBNull(8)) { personDMCS.phone_primary = rdr.GetString(8); } else { personDMCS.phone_primary = " "; } if (!rdr.IsDBNull(9)) { personDMCS.email = rdr.GetString(9); } else { personDMCS.email = " "; } if (!rdr.IsDBNull(10)) { personDMCS.creditcard = rdr.GetString(10); } else { personDMCS.creditcard = " "; } if (!rdr.IsDBNull(11)) { personDMCS.availability_date = rdr.GetDateTime(11); } else { personDMCS.availability_date = DateTime.Now; } if (!rdr.IsDBNull(12)) { personDMCS.availability_hours = rdr.GetInt32(12); } else { personDMCS.availability_hours = 0; } if (!rdr.IsDBNull(13)) { personDMCS.birthdate = rdr.GetDateTime(13); } else { personDMCS.birthdate = DateTime.Now; } if (!rdr.IsDBNull(14)) { personDMCS.marital_status = rdr.GetString(14); } else { personDMCS.marital_status = " "; } if (!rdr.IsDBNull(15)) { personDMCS.gender = rdr.GetString(15); } else { personDMCS.gender = " "; } if (!rdr.IsDBNull(16)) { personDMCS.jobtitle = rdr.GetString(16); } else { personDMCS.jobtitle = " "; } if (!rdr.IsDBNull(17)) { personDMCS.workdate = rdr.GetDateTime(17); } else { personDMCS.workdate = DateTime.Now; } if (!rdr.IsDBNull(18)) { personDMCS.regpay = rdr.GetDecimal(18); } else { personDMCS.regpay = 0; } if (!rdr.IsDBNull(19)) { personDMCS.OT = rdr.GetInt32(19); } else { personDMCS.OT = 0; } if (!rdr.IsDBNull(20)) { personDMCS.OT_rate = rdr.GetDecimal(20); } else { personDMCS.OT_rate = 0; } if (!rdr.IsDBNull(21)) { personDMCS.hourly_rate = rdr.GetDecimal(21); } else { personDMCS.hourly_rate = 0; } } else { personDMCS.SetColumnDefaults(); } } catch (Exception ex) { personDMCS.SetColumnDefaults(); return personDMCS; } finally { con.Close(); } return personDMCS; }
public personDMCS Insert(personDMCS id) { string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_INSERT_PERSONDMCS", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Resource_ID", id.Resource_ID); cmd.Parameters.AddWithValue("@f_name", id.f_name); cmd.Parameters.AddWithValue("@l_name", id.l_name); cmd.Parameters.AddWithValue("@address", id.address); cmd.Parameters.AddWithValue("@city", id.city); cmd.Parameters.AddWithValue("@state", id.state); cmd.Parameters.AddWithValue("@zipcode", id.zipcode); cmd.Parameters.AddWithValue("@phone_primary", id.phone_primary); cmd.Parameters.AddWithValue("@email", id.email); cmd.Parameters.AddWithValue("@creditcard", id.creditcard); cmd.Parameters.AddWithValue("@availability_date", id.availability_date); cmd.Parameters.AddWithValue("@availability_hours", id.availability_hours); cmd.Parameters.AddWithValue("@birthdate", id.birthdate); cmd.Parameters.AddWithValue("@marital_status", id.marital_status); cmd.Parameters.AddWithValue("@gender", id.gender); cmd.Parameters.AddWithValue("@jobtitle", id.jobtitle); cmd.Parameters.AddWithValue("@workdate", id.workdate); cmd.Parameters.AddWithValue("@regpay", id.regpay); cmd.Parameters.AddWithValue("@OT", id.OT); cmd.Parameters.AddWithValue("@OT_rate", id.OT_rate); cmd.Parameters.AddWithValue("@hourly_rate", id.hourly_rate); cmd.ExecuteReader(); con.Close(); con.Open(); cmd = new SqlCommand("SP_DMCS_GET_PERSONDMCS", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Resource_ID", id.Resource_ID); cmd.Parameters.AddWithValue("@f_name", id.f_name); cmd.Parameters.AddWithValue("@l_name", id.l_name); cmd.Parameters.AddWithValue("@address", id.address); cmd.Parameters.AddWithValue("@city", id.city); cmd.Parameters.AddWithValue("@state", id.state); cmd.Parameters.AddWithValue("@zipcode", id.zipcode); cmd.Parameters.AddWithValue("@phone_primary", id.phone_primary); cmd.Parameters.AddWithValue("@email", id.email); cmd.Parameters.AddWithValue("@creditcard", id.creditcard); cmd.Parameters.AddWithValue("@availability_date", id.availability_date); cmd.Parameters.AddWithValue("@availability_hours", id.availability_hours); cmd.Parameters.AddWithValue("@birthdate", id.birthdate); cmd.Parameters.AddWithValue("@marital_status", id.marital_status); cmd.Parameters.AddWithValue("@gender", id.gender); cmd.Parameters.AddWithValue("@jobtitle", id.jobtitle); cmd.Parameters.AddWithValue("@workdate", id.workdate); cmd.Parameters.AddWithValue("@regpay", id.regpay); cmd.Parameters.AddWithValue("@OT", id.OT); cmd.Parameters.AddWithValue("@OT_rate", id.OT_rate); cmd.Parameters.AddWithValue("@hourly_rate", id.hourly_rate); SqlDataReader rdr = cmd.ExecuteReader(); if (rdr.HasRows) { rdr.Read(); id.Person_ID = rdr.GetInt32(0); } } catch (Exception ex) { id.SetColumnDefaults(); } finally { con.Close(); } return id; }
///////////////////////// //////////////////////// /////////////////////// ////////////////////// ///////////////////// //Update Tab Methods protected void Update_Select_Record(object sender, EventArgs e) { personDMCS = Update_personDMCS_select(Convert.ToInt32(Update_personDMCS_GridView.SelectedValue)); }
protected void INSERT(object sender, EventArgs e) { personDMCS = personDMCS_insert(); }
public personDMCS personDMCS_update(int ID) { personDMCS = personDMCS.Select(ID); personDMCS.Person_ID = Convert.ToInt32(Update_Person_ID_txt.Text); personDMCS.Resource_ID = Convert.ToInt32(Update_Resource_ID_txt.Text); personDMCS.f_name = Update_f_name_txt.Text; personDMCS.l_name = Update_l_name_txt.Text; personDMCS.address = Update_address_txt.Text; personDMCS.city = Update_city_txt.Text; personDMCS.state = Update_state_txt.Text; personDMCS.zipcode = Convert.ToInt32(Update_zipcode_txt.Text); personDMCS.phone_primary = Update_phone_primary_txt.Text; personDMCS.email = Update_email_txt.Text; personDMCS.creditcard = Update_creditcard_txt.Text; personDMCS.availability_date = Convert.ToDateTime(Update_availability_date_txt.Text); personDMCS.availability_hours = Convert.ToInt32(Update_availability_hours_txt.Text); personDMCS.birthdate = Convert.ToDateTime(Update_birthdate_txt.Text); personDMCS.marital_status = Update_marital_status_txt.Text; personDMCS.gender = Update_gender_txt.Text; personDMCS.jobtitle = Update_jobtitle_txt.Text; personDMCS.workdate = Convert.ToDateTime(Update_workdate_txt.Text); personDMCS.regpay = Convert.ToDecimal(Update_regpay_txt.Text); personDMCS.OT = Convert.ToInt32(Update_OT_txt.Text); personDMCS.OT_rate = Convert.ToDecimal(Update_OT_rate_txt.Text); personDMCS.hourly_rate = Convert.ToDecimal(Update_hourly_rate_txt.Text); personDMCS.Update(personDMCS); Insert_personDMCS_GridView.DataBind(); Update_personDMCS_GridView.DataBind(); Delete_personDMCS_GridView.DataBind(); return personDMCS; }
public personDMCS personDMCS_insert() { personDMCS.Resource_ID = Convert.ToInt32(Insert_Resource_ID_txt.Text); personDMCS.f_name = Insert_f_name_txt.Text; personDMCS.l_name = Insert_l_name_txt.Text; personDMCS.address = Insert_address_txt.Text; personDMCS.city = Insert_city_txt.Text; personDMCS.state = Insert_state_txt.Text; personDMCS.zipcode = Convert.ToInt32(Insert_zipcode_txt.Text); personDMCS.phone_primary = Insert_phone_primary_txt.Text; personDMCS.email = Insert_email_txt.Text; personDMCS.creditcard = Insert_creditcard_txt.Text; personDMCS.availability_date = Convert.ToDateTime(Insert_availability_date_txt.Text); personDMCS.availability_hours = Convert.ToInt32(Insert_availability_hours_txt.Text); personDMCS.birthdate = Convert.ToDateTime(Insert_birthdate_txt.Text); personDMCS.marital_status = Insert_marital_status_txt.Text; personDMCS.gender = Insert_gender_txt.Text; personDMCS.jobtitle = Insert_jobtitle_txt.Text; personDMCS.workdate = Convert.ToDateTime(Insert_workdate_txt.Text); personDMCS.regpay = Convert.ToDecimal(Insert_regpay_txt.Text); personDMCS.OT = Convert.ToInt32(Insert_OT_txt.Text); personDMCS.OT_rate = Convert.ToDecimal(Insert_OT_rate_txt.Text); personDMCS.hourly_rate = Convert.ToDecimal(Insert_hourly_rate_txt.Text); personDMCS = personDMCS.Insert(personDMCS); Insert_personDMCS_GridView.DataBind(); Update_personDMCS_GridView.DataBind(); Delete_personDMCS_GridView.DataBind(); return personDMCS; }
///////////////////////// //////////////////////// /////////////////////// ////////////////////// ///////////////////// //Insert Tab Methods protected void Insert_Select_Record(object sender, EventArgs e) { personDMCS = Insert_personDMCS_select(Convert.ToInt32(Insert_personDMCS_GridView.SelectedValue)); }
public personDMCS Insert(personDMCS id) { string ConnectionString = IDManager.connection(); SqlConnection con = new SqlConnection(ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("SP_DMCS_INSERT_PERSONDMCS", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Resource_ID", id.Resource_ID); cmd.Parameters.AddWithValue("@f_name", id.f_name); cmd.Parameters.AddWithValue("@l_name", id.l_name); cmd.Parameters.AddWithValue("@address", id.address); cmd.Parameters.AddWithValue("@city", id.city); cmd.Parameters.AddWithValue("@state", id.state); cmd.Parameters.AddWithValue("@zipcode", id.zipcode); cmd.Parameters.AddWithValue("@phone_primary", id.phone_primary); cmd.Parameters.AddWithValue("@email", id.email); cmd.Parameters.AddWithValue("@creditcard", id.creditcard); cmd.Parameters.AddWithValue("@availability_date", id.availability_date); cmd.Parameters.AddWithValue("@availability_hours", id.availability_hours); cmd.Parameters.AddWithValue("@birthdate", id.birthdate); cmd.Parameters.AddWithValue("@marital_status", id.marital_status); cmd.Parameters.AddWithValue("@gender", id.gender); cmd.Parameters.AddWithValue("@jobtitle", id.jobtitle); cmd.Parameters.AddWithValue("@workdate", id.workdate); cmd.Parameters.AddWithValue("@regpay", id.regpay); cmd.Parameters.AddWithValue("@OT", id.OT); cmd.Parameters.AddWithValue("@OT_rate", id.OT_rate); cmd.Parameters.AddWithValue("@hourly_rate", id.hourly_rate); cmd.ExecuteReader(); con.Close(); con.Open(); cmd = new SqlCommand("SP_DMCS_GET_PERSONDMCS", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Resource_ID", id.Resource_ID); cmd.Parameters.AddWithValue("@f_name", id.f_name); cmd.Parameters.AddWithValue("@l_name", id.l_name); cmd.Parameters.AddWithValue("@address", id.address); cmd.Parameters.AddWithValue("@city", id.city); cmd.Parameters.AddWithValue("@state", id.state); cmd.Parameters.AddWithValue("@zipcode", id.zipcode); cmd.Parameters.AddWithValue("@phone_primary", id.phone_primary); cmd.Parameters.AddWithValue("@email", id.email); cmd.Parameters.AddWithValue("@creditcard", id.creditcard); cmd.Parameters.AddWithValue("@availability_date", id.availability_date); cmd.Parameters.AddWithValue("@availability_hours", id.availability_hours); cmd.Parameters.AddWithValue("@birthdate", id.birthdate); cmd.Parameters.AddWithValue("@marital_status", id.marital_status); cmd.Parameters.AddWithValue("@gender", id.gender); cmd.Parameters.AddWithValue("@jobtitle", id.jobtitle); cmd.Parameters.AddWithValue("@workdate", id.workdate); cmd.Parameters.AddWithValue("@regpay", id.regpay); cmd.Parameters.AddWithValue("@OT", id.OT); cmd.Parameters.AddWithValue("@OT_rate", id.OT_rate); cmd.Parameters.AddWithValue("@hourly_rate", id.hourly_rate); SqlDataReader rdr = cmd.ExecuteReader(); if (rdr.HasRows) { rdr.Read(); id.Person_ID = rdr.GetInt32(0); } } catch (Exception ex) { id.SetColumnDefaults(); } finally { con.Close(); } return(id); }
protected void UPDATE(object sender, EventArgs e) { personDMCS = personDMCS_update(Convert.ToInt32(Update_personDMCS_GridView.SelectedValue)); }