public static Inv_ItemTransactionType GetInv_ItemTransactionTypeByID(int id) { Inv_ItemTransactionType inv_ItemTransactionType = new Inv_ItemTransactionType(); SqlInv_ItemTransactionTypeProvider sqlInv_ItemTransactionTypeProvider = new SqlInv_ItemTransactionTypeProvider(); inv_ItemTransactionType = sqlInv_ItemTransactionTypeProvider.GetInv_ItemTransactionTypeByID(id); return(inv_ItemTransactionType); }
protected void btnAdd_Click(object sender, EventArgs e) { Inv_ItemTransactionType inv_ItemTransactionType = new Inv_ItemTransactionType(); inv_ItemTransactionType.ItemTransactionTypeName = txtItemTransactionTypeName.Text; inv_ItemTransactionType.RowStatusID = 1; int resutl = Inv_ItemTransactionTypeManager.InsertInv_ItemTransactionType(inv_ItemTransactionType); Response.Redirect("AdminInv_ItemTransactionTypeDisplay.aspx"); }
private void showInv_ItemTransactionTypeData() { Inv_ItemTransactionType inv_ItemTransactionType = new Inv_ItemTransactionType(); inv_ItemTransactionType = Inv_ItemTransactionTypeManager.GetInv_ItemTransactionTypeByID(Int32.Parse(Request.QueryString["inv_ItemTransactionTypeID"])); txtItemTransactionTypeName.Text = inv_ItemTransactionType.ItemTransactionTypeName; ddlRowStatus.SelectedValue = inv_ItemTransactionType.RowStatusID.ToString(); }
protected void btnUpdate_Click(object sender, EventArgs e) { Inv_ItemTransactionType inv_ItemTransactionType = new Inv_ItemTransactionType(); inv_ItemTransactionType = Inv_ItemTransactionTypeManager.GetInv_ItemTransactionTypeByID(Int32.Parse(Request.QueryString["inv_ItemTransactionTypeID"])); Inv_ItemTransactionType tempInv_ItemTransactionType = new Inv_ItemTransactionType(); tempInv_ItemTransactionType.Inv_ItemTransactionTypeID = inv_ItemTransactionType.Inv_ItemTransactionTypeID; tempInv_ItemTransactionType.ItemTransactionTypeName = txtItemTransactionTypeName.Text; tempInv_ItemTransactionType.RowStatusID = 1; bool result = Inv_ItemTransactionTypeManager.UpdateInv_ItemTransactionType(tempInv_ItemTransactionType); Response.Redirect("AdminInv_ItemTransactionTypeDisplay.aspx"); }
public int InsertInv_ItemTransactionType(Inv_ItemTransactionType inv_ItemTransactionType) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_InsertInv_ItemTransactionType", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Inv_ItemTransactionTypeID", SqlDbType.Int).Direction = ParameterDirection.Output; cmd.Parameters.Add("@ItemTransactionTypeName", SqlDbType.NVarChar).Value = inv_ItemTransactionType.ItemTransactionTypeName; cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = inv_ItemTransactionType.RowStatusID; connection.Open(); int result = cmd.ExecuteNonQuery(); return((int)cmd.Parameters["@Inv_ItemTransactionTypeID"].Value); } }
public Inv_ItemTransactionType GetInv_ItemTransactionTypeFromReader(IDataReader reader) { try { Inv_ItemTransactionType inv_ItemTransactionType = new Inv_ItemTransactionType ( (int)reader["Inv_ItemTransactionTypeID"], reader["ItemTransactionTypeName"].ToString(), (int)reader["RowStatusID"] ); return inv_ItemTransactionType; } catch(Exception ex) { return null; } }
public Inv_ItemTransactionType GetInv_ItemTransactionTypeFromReader(IDataReader reader) { try { Inv_ItemTransactionType inv_ItemTransactionType = new Inv_ItemTransactionType ( (int)reader["Inv_ItemTransactionTypeID"], reader["ItemTransactionTypeName"].ToString(), (int)reader["RowStatusID"] ); return(inv_ItemTransactionType); } catch (Exception ex) { return(null); } }
public bool UpdateInv_ItemTransactionType(Inv_ItemTransactionType inv_ItemTransactionType) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_UpdateInv_ItemTransactionType", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Inv_ItemTransactionTypeID", SqlDbType.Int).Value = inv_ItemTransactionType.Inv_ItemTransactionTypeID; cmd.Parameters.Add("@ItemTransactionTypeName", SqlDbType.NVarChar).Value = inv_ItemTransactionType.ItemTransactionTypeName; cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = inv_ItemTransactionType.RowStatusID; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }
public static bool UpdateInv_ItemTransactionType(Inv_ItemTransactionType inv_ItemTransactionType) { SqlInv_ItemTransactionTypeProvider sqlInv_ItemTransactionTypeProvider = new SqlInv_ItemTransactionTypeProvider(); return(sqlInv_ItemTransactionTypeProvider.UpdateInv_ItemTransactionType(inv_ItemTransactionType)); }
public static int InsertInv_ItemTransactionType(Inv_ItemTransactionType inv_ItemTransactionType) { SqlInv_ItemTransactionTypeProvider sqlInv_ItemTransactionTypeProvider = new SqlInv_ItemTransactionTypeProvider(); return(sqlInv_ItemTransactionTypeProvider.InsertInv_ItemTransactionType(inv_ItemTransactionType)); }