public static Pos_ProductTransaction GetPos_ProductTransactionByID(int id) { Pos_ProductTransaction pos_ProductTransaction = new Pos_ProductTransaction(); SqlPos_ProductTransactionProvider sqlPos_ProductTransactionProvider = new SqlPos_ProductTransactionProvider(); pos_ProductTransaction = sqlPos_ProductTransactionProvider.GetPos_ProductTransactionByID(id); return pos_ProductTransaction; }
public Pos_ProductTransaction GetPos_ProductTransactionFromReader(IDataReader reader) { try { Pos_ProductTransaction pos_ProductTransaction = new Pos_ProductTransaction ( (int)reader["Pos_ProductTransactionID"], (int)reader["Pos_ProductID"], (decimal)reader["Quantity"], (int)reader["Pos_ProductTrasactionTypeID"], (int)reader["Pos_ProductTransactionMasterID"], reader["ExtraField1"].ToString(), reader["ExtraField2"].ToString(), reader["ExtraField3"].ToString(), reader["ExtraField4"].ToString(), reader["ExtraField5"].ToString(), (int)reader["AddedBy"], (DateTime)reader["AddedDate"], (int)reader["UpdatedBy"], (DateTime)reader["UpdatedDate"], (int)reader["RowStatusID"] ); return(pos_ProductTransaction); } catch (Exception ex) { return(null); } }
public bool UpdatePos_ProductTransaction(Pos_ProductTransaction pos_ProductTransaction) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_UpdatePos_ProductTransaction", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_ProductTransactionID", SqlDbType.Int).Value = pos_ProductTransaction.Pos_ProductTransactionID; cmd.Parameters.Add("@Pos_ProductID", SqlDbType.Int).Value = pos_ProductTransaction.Pos_ProductID; cmd.Parameters.Add("@Quantity", SqlDbType.Decimal).Value = pos_ProductTransaction.Quantity; cmd.Parameters.Add("@Pos_ProductTrasactionTypeID", SqlDbType.Int).Value = pos_ProductTransaction.Pos_ProductTrasactionTypeID; cmd.Parameters.Add("@Pos_ProductTransactionMasterID", SqlDbType.Int).Value = pos_ProductTransaction.Pos_ProductTransactionMasterID; cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = pos_ProductTransaction.ExtraField1; cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = pos_ProductTransaction.ExtraField2; cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value = pos_ProductTransaction.ExtraField3; cmd.Parameters.Add("@ExtraField4", SqlDbType.NVarChar).Value = pos_ProductTransaction.ExtraField4; cmd.Parameters.Add("@ExtraField5", SqlDbType.NVarChar).Value = pos_ProductTransaction.ExtraField5; cmd.Parameters.Add("@AddedBy", SqlDbType.Int).Value = pos_ProductTransaction.AddedBy; cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = pos_ProductTransaction.AddedDate; cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value = pos_ProductTransaction.UpdatedBy; cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = pos_ProductTransaction.UpdatedDate; cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = pos_ProductTransaction.RowStatusID; connection.Open(); int result = cmd.ExecuteNonQuery(); return(result == 1); } }
public static Pos_ProductTransaction GetPos_ProductTransactionByID(int id) { Pos_ProductTransaction pos_ProductTransaction = new Pos_ProductTransaction(); SqlPos_ProductTransactionProvider sqlPos_ProductTransactionProvider = new SqlPos_ProductTransactionProvider(); pos_ProductTransaction = sqlPos_ProductTransactionProvider.GetPos_ProductTransactionByID(id); return(pos_ProductTransaction); }
public static bool UpdatePos_ProductTransaction(Pos_ProductTransaction pos_ProductTransaction) { SqlPos_ProductTransactionProvider sqlPos_ProductTransactionProvider = new SqlPos_ProductTransactionProvider(); return sqlPos_ProductTransactionProvider.UpdatePos_ProductTransaction(pos_ProductTransaction); }
public static int InsertPos_ProductTransaction(Pos_ProductTransaction pos_ProductTransaction) { SqlPos_ProductTransactionProvider sqlPos_ProductTransactionProvider = new SqlPos_ProductTransactionProvider(); return sqlPos_ProductTransactionProvider.InsertPos_ProductTransaction(pos_ProductTransaction); }
public static bool UpdatePos_ProductTransaction(Pos_ProductTransaction pos_ProductTransaction) { SqlPos_ProductTransactionProvider sqlPos_ProductTransactionProvider = new SqlPos_ProductTransactionProvider(); return(sqlPos_ProductTransactionProvider.UpdatePos_ProductTransaction(pos_ProductTransaction)); }
public static int InsertPos_ProductTransaction(Pos_ProductTransaction pos_ProductTransaction) { SqlPos_ProductTransactionProvider sqlPos_ProductTransactionProvider = new SqlPos_ProductTransactionProvider(); return(sqlPos_ProductTransactionProvider.InsertPos_ProductTransaction(pos_ProductTransaction)); }
public Pos_ProductTransaction GetPos_ProductTransactionFromReader(IDataReader reader) { try { Pos_ProductTransaction pos_ProductTransaction = new Pos_ProductTransaction ( (int)reader["Pos_ProductTransactionID"], (int)reader["Pos_ProductID"], (decimal)reader["Quantity"], (int)reader["Pos_ProductTrasactionTypeID"], (int)reader["Pos_ProductTransactionMasterID"], reader["ExtraField1"].ToString(), reader["ExtraField2"].ToString(), reader["ExtraField3"].ToString(), reader["ExtraField4"].ToString(), reader["ExtraField5"].ToString(), (int)reader["AddedBy"], (DateTime)reader["AddedDate"], (int)reader["UpdatedBy"], (DateTime)reader["UpdatedDate"], (int)reader["RowStatusID"] ); return pos_ProductTransaction; } catch(Exception ex) { return null; } }
public bool UpdatePos_ProductTransaction(Pos_ProductTransaction pos_ProductTransaction) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_UpdatePos_ProductTransaction", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_ProductTransactionID", SqlDbType.Int).Value = pos_ProductTransaction.Pos_ProductTransactionID; cmd.Parameters.Add("@Pos_ProductID", SqlDbType.Int).Value = pos_ProductTransaction.Pos_ProductID; cmd.Parameters.Add("@Quantity", SqlDbType.Decimal).Value = pos_ProductTransaction.Quantity; cmd.Parameters.Add("@Pos_ProductTrasactionTypeID", SqlDbType.Int).Value = pos_ProductTransaction.Pos_ProductTrasactionTypeID; cmd.Parameters.Add("@Pos_ProductTransactionMasterID", SqlDbType.Int).Value = pos_ProductTransaction.Pos_ProductTransactionMasterID; cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = pos_ProductTransaction.ExtraField1; cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = pos_ProductTransaction.ExtraField2; cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value = pos_ProductTransaction.ExtraField3; cmd.Parameters.Add("@ExtraField4", SqlDbType.NVarChar).Value = pos_ProductTransaction.ExtraField4; cmd.Parameters.Add("@ExtraField5", SqlDbType.NVarChar).Value = pos_ProductTransaction.ExtraField5; cmd.Parameters.Add("@AddedBy", SqlDbType.Int).Value = pos_ProductTransaction.AddedBy; cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = pos_ProductTransaction.AddedDate; cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value = pos_ProductTransaction.UpdatedBy; cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = pos_ProductTransaction.UpdatedDate; cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = pos_ProductTransaction.RowStatusID; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }