public static Pos_ProductCost GetPos_ProductCostByID(int id) { Pos_ProductCost pos_ProductCost = new Pos_ProductCost(); SqlPos_ProductCostProvider sqlPos_ProductCostProvider = new SqlPos_ProductCostProvider(); pos_ProductCost = sqlPos_ProductCostProvider.GetPos_ProductCostByID(id); return pos_ProductCost; }
public static Pos_ProductCost GetPos_ProductCostByID(int id) { Pos_ProductCost pos_ProductCost = new Pos_ProductCost(); SqlPos_ProductCostProvider sqlPos_ProductCostProvider = new SqlPos_ProductCostProvider(); pos_ProductCost = sqlPos_ProductCostProvider.GetPos_ProductCostByID(id); return(pos_ProductCost); }
private void showPos_ProductCostData() { Pos_ProductCost pos_ProductCost = new Pos_ProductCost(); pos_ProductCost = Pos_ProductCostManager.GetPos_ProductCostByID(Int32.Parse(Request.QueryString["pos_ProductCostID"])); ddlPos_CostType.SelectedValue = pos_ProductCost.Pos_CostTypeID.ToString(); ddlProduct.SelectedValue = pos_ProductCost.ProductID.ToString(); txtAmount.Text = pos_ProductCost.Amount.ToString(); txtExtraField1.Text = pos_ProductCost.ExtraField1; txtExtraField2.Text = pos_ProductCost.ExtraField2; txtExtraField3.Text = pos_ProductCost.ExtraField3; }
protected void btnAdd_Click(object sender, EventArgs e) { Pos_ProductCost pos_ProductCost = new Pos_ProductCost(); pos_ProductCost.Pos_CostTypeID = Int32.Parse(ddlPos_CostType.SelectedValue); pos_ProductCost.ProductID = Int32.Parse(ddlProduct.SelectedValue); pos_ProductCost.Amount = Decimal.Parse(txtAmount.Text); pos_ProductCost.ExtraField1 = txtExtraField1.Text; pos_ProductCost.ExtraField2 = txtExtraField2.Text; pos_ProductCost.ExtraField3 = txtExtraField3.Text; int resutl = Pos_ProductCostManager.InsertPos_ProductCost(pos_ProductCost); Response.Redirect("AdminPos_ProductCostDisplay.aspx"); }
public bool UpdatePos_ProductCost(Pos_ProductCost pos_ProductCost) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_UpdatePos_ProductCost", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_ProductCostID", SqlDbType.Int).Value = pos_ProductCost.Pos_ProductCostID; cmd.Parameters.Add("@Pos_CostTypeID", SqlDbType.Int).Value = pos_ProductCost.Pos_CostTypeID; cmd.Parameters.Add("@ProductID", SqlDbType.Int).Value = pos_ProductCost.ProductID; cmd.Parameters.Add("@Amount", SqlDbType.Decimal).Value = pos_ProductCost.Amount; cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = pos_ProductCost.ExtraField1; cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = pos_ProductCost.ExtraField2; cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value = pos_ProductCost.ExtraField3; connection.Open(); int result = cmd.ExecuteNonQuery(); return(result == 1); } }
protected void btnUpdate_Click(object sender, EventArgs e) { Pos_ProductCost pos_ProductCost = new Pos_ProductCost(); pos_ProductCost = Pos_ProductCostManager.GetPos_ProductCostByID(Int32.Parse(Request.QueryString["pos_ProductCostID"])); Pos_ProductCost tempPos_ProductCost = new Pos_ProductCost(); tempPos_ProductCost.Pos_ProductCostID = pos_ProductCost.Pos_ProductCostID; tempPos_ProductCost.Pos_CostTypeID = Int32.Parse(ddlPos_CostType.SelectedValue); tempPos_ProductCost.ProductID = Int32.Parse(ddlProduct.SelectedValue); tempPos_ProductCost.Amount = Decimal.Parse(txtAmount.Text); tempPos_ProductCost.ExtraField1 = txtExtraField1.Text; tempPos_ProductCost.ExtraField2 = txtExtraField2.Text; tempPos_ProductCost.ExtraField3 = txtExtraField3.Text; bool result = Pos_ProductCostManager.UpdatePos_ProductCost(tempPos_ProductCost); Response.Redirect("AdminPos_ProductCostDisplay.aspx"); }
public Pos_ProductCost GetPos_ProductCostFromReader(IDataReader reader) { try { Pos_ProductCost pos_ProductCost = new Pos_ProductCost ( (int)reader["Pos_ProductCostID"], (int)reader["Pos_CostTypeID"], (int)reader["ProductID"], (decimal)reader["Amount"], reader["ExtraField1"].ToString(), reader["ExtraField2"].ToString(), reader["ExtraField3"].ToString() ); return(pos_ProductCost); } catch (Exception ex) { return(null); } }
public static bool UpdatePos_ProductCost(Pos_ProductCost pos_ProductCost) { SqlPos_ProductCostProvider sqlPos_ProductCostProvider = new SqlPos_ProductCostProvider(); return sqlPos_ProductCostProvider.UpdatePos_ProductCost(pos_ProductCost); }
public static int InsertPos_ProductCost(Pos_ProductCost pos_ProductCost) { SqlPos_ProductCostProvider sqlPos_ProductCostProvider = new SqlPos_ProductCostProvider(); return sqlPos_ProductCostProvider.InsertPos_ProductCost(pos_ProductCost); }
public Pos_ProductCost GetPos_ProductCostFromReader(IDataReader reader) { try { Pos_ProductCost pos_ProductCost = new Pos_ProductCost ( (int)reader["Pos_ProductCostID"], (int)reader["Pos_CostTypeID"], (int)reader["ProductID"], (decimal)reader["Amount"], reader["ExtraField1"].ToString(), reader["ExtraField2"].ToString(), reader["ExtraField3"].ToString() ); return pos_ProductCost; } catch(Exception ex) { return null; } }
public bool UpdatePos_ProductCost(Pos_ProductCost pos_ProductCost) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_UpdatePos_ProductCost", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_ProductCostID", SqlDbType.Int).Value = pos_ProductCost.Pos_ProductCostID; cmd.Parameters.Add("@Pos_CostTypeID", SqlDbType.Int).Value = pos_ProductCost.Pos_CostTypeID; cmd.Parameters.Add("@ProductID", SqlDbType.Int).Value = pos_ProductCost.ProductID; cmd.Parameters.Add("@Amount", SqlDbType.Decimal).Value = pos_ProductCost.Amount; cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = pos_ProductCost.ExtraField1; cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = pos_ProductCost.ExtraField2; cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value = pos_ProductCost.ExtraField3; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }
public static bool UpdatePos_ProductCost(Pos_ProductCost pos_ProductCost) { SqlPos_ProductCostProvider sqlPos_ProductCostProvider = new SqlPos_ProductCostProvider(); return(sqlPos_ProductCostProvider.UpdatePos_ProductCost(pos_ProductCost)); }
public static int InsertPos_ProductCost(Pos_ProductCost pos_ProductCost) { SqlPos_ProductCostProvider sqlPos_ProductCostProvider = new SqlPos_ProductCostProvider(); return(sqlPos_ProductCostProvider.InsertPos_ProductCost(pos_ProductCost)); }