private void showPos_FabricsTypeData() { Pos_FabricsType pos_FabricsType = new Pos_FabricsType(); pos_FabricsType = Pos_FabricsTypeManager.GetPos_FabricsTypeByID(Int32.Parse(Request.QueryString["pos_FabricsTypeID"])); txtFabricsTypeName.Text = pos_FabricsType.FabricsTypeName; }
public static Pos_FabricsType GetPos_FabricsTypeByID(int id) { Pos_FabricsType pos_FabricsType = new Pos_FabricsType(); SqlPos_FabricsTypeProvider sqlPos_FabricsTypeProvider = new SqlPos_FabricsTypeProvider(); pos_FabricsType = sqlPos_FabricsTypeProvider.GetPos_FabricsTypeByID(id); return pos_FabricsType; }
public static Pos_FabricsType GetPos_FabricsTypeByID(int id) { Pos_FabricsType pos_FabricsType = new Pos_FabricsType(); SqlPos_FabricsTypeProvider sqlPos_FabricsTypeProvider = new SqlPos_FabricsTypeProvider(); pos_FabricsType = sqlPos_FabricsTypeProvider.GetPos_FabricsTypeByID(id); return(pos_FabricsType); }
protected void btnAdd_Click(object sender, EventArgs e) { Pos_FabricsType pos_FabricsType = new Pos_FabricsType(); pos_FabricsType.FabricsTypeName = txtFabricsTypeName.Text; int resutl = Pos_FabricsTypeManager.InsertPos_FabricsType(pos_FabricsType); Response.Redirect("AdminPos_FabricsTypeDisplay.aspx"); }
protected void btnUpdate_Click(object sender, EventArgs e) { Pos_FabricsType pos_FabricsType = new Pos_FabricsType(); pos_FabricsType = Pos_FabricsTypeManager.GetPos_FabricsTypeByID(Int32.Parse(Request.QueryString["pos_FabricsTypeID"])); Pos_FabricsType tempPos_FabricsType = new Pos_FabricsType(); tempPos_FabricsType.Pos_FabricsTypeID = pos_FabricsType.Pos_FabricsTypeID; tempPos_FabricsType.FabricsTypeName = txtFabricsTypeName.Text; bool result = Pos_FabricsTypeManager.UpdatePos_FabricsType(tempPos_FabricsType); Response.Redirect("AdminPos_FabricsTypeDisplay.aspx"); }
public int InsertPos_FabricsType(Pos_FabricsType pos_FabricsType) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_InsertPos_FabricsType", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_FabricsTypeID", SqlDbType.Int).Direction = ParameterDirection.Output; cmd.Parameters.Add("@FabricsTypeName", SqlDbType.NVarChar).Value = pos_FabricsType.FabricsTypeName; connection.Open(); int result = cmd.ExecuteNonQuery(); return((int)cmd.Parameters["@Pos_FabricsTypeID"].Value); } }
public bool UpdatePos_FabricsType(Pos_FabricsType pos_FabricsType) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_UpdatePos_FabricsType", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_FabricsTypeID", SqlDbType.Int).Value = pos_FabricsType.Pos_FabricsTypeID; cmd.Parameters.Add("@FabricsTypeName", SqlDbType.NVarChar).Value = pos_FabricsType.FabricsTypeName; connection.Open(); int result = cmd.ExecuteNonQuery(); return(result == 1); } }
public Pos_FabricsType GetPos_FabricsTypeFromReader(IDataReader reader) { try { Pos_FabricsType pos_FabricsType = new Pos_FabricsType ( (int)reader["Pos_FabricsTypeID"], reader["FabricsTypeName"].ToString() ); return pos_FabricsType; } catch(Exception ex) { return null; } }
public Pos_FabricsType GetPos_FabricsTypeFromReader(IDataReader reader) { try { Pos_FabricsType pos_FabricsType = new Pos_FabricsType ( (int)reader["Pos_FabricsTypeID"], reader["FabricsTypeName"].ToString() ); return(pos_FabricsType); } catch (Exception ex) { return(null); } }
public bool UpdatePos_FabricsType(Pos_FabricsType pos_FabricsType) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_UpdatePos_FabricsType", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_FabricsTypeID", SqlDbType.Int).Value = pos_FabricsType.Pos_FabricsTypeID; cmd.Parameters.Add("@FabricsTypeName", SqlDbType.NVarChar).Value = pos_FabricsType.FabricsTypeName; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }
public int InsertPos_FabricsType(Pos_FabricsType pos_FabricsType) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_InsertPos_FabricsType", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_FabricsTypeID", SqlDbType.Int).Direction = ParameterDirection.Output; cmd.Parameters.Add("@FabricsTypeName", SqlDbType.NVarChar).Value = pos_FabricsType.FabricsTypeName; connection.Open(); int result = cmd.ExecuteNonQuery(); return (int)cmd.Parameters["@Pos_FabricsTypeID"].Value; } }
public static bool UpdatePos_FabricsType(Pos_FabricsType pos_FabricsType) { SqlPos_FabricsTypeProvider sqlPos_FabricsTypeProvider = new SqlPos_FabricsTypeProvider(); return sqlPos_FabricsTypeProvider.UpdatePos_FabricsType(pos_FabricsType); }
public static int InsertPos_FabricsType(Pos_FabricsType pos_FabricsType) { SqlPos_FabricsTypeProvider sqlPos_FabricsTypeProvider = new SqlPos_FabricsTypeProvider(); return sqlPos_FabricsTypeProvider.InsertPos_FabricsType(pos_FabricsType); }
public static bool UpdatePos_FabricsType(Pos_FabricsType pos_FabricsType) { SqlPos_FabricsTypeProvider sqlPos_FabricsTypeProvider = new SqlPos_FabricsTypeProvider(); return(sqlPos_FabricsTypeProvider.UpdatePos_FabricsType(pos_FabricsType)); }
public static int InsertPos_FabricsType(Pos_FabricsType pos_FabricsType) { SqlPos_FabricsTypeProvider sqlPos_FabricsTypeProvider = new SqlPos_FabricsTypeProvider(); return(sqlPos_FabricsTypeProvider.InsertPos_FabricsType(pos_FabricsType)); }