public Pos_ProductTransactionMaster GetPos_ProductTransactionMasterFromReader(IDataReader reader) { try { Pos_ProductTransactionMaster pos_ProductTransactionMaster = new Pos_ProductTransactionMaster ( (int)reader["Pos_ProductTransactionMasterID"], (DateTime)reader["TransactionDate"], (int)reader["TransactionID"], (int)reader["ToOrFromID"], reader["Record"].ToString(), reader["Particulars"].ToString(), (int)reader["WorkSatationID"], 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_ProductTransactionMaster); } catch (Exception ex) { return(null); } }
public bool UpdatePos_ProductTransactionMaster(Pos_ProductTransactionMaster pos_ProductTransactionMaster) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_UpdatePos_ProductTransactionMaster", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_ProductTransactionMasterID", SqlDbType.Int).Value = pos_ProductTransactionMaster.Pos_ProductTransactionMasterID; cmd.Parameters.Add("@TransactionDate", SqlDbType.DateTime).Value = pos_ProductTransactionMaster.TransactionDate; cmd.Parameters.Add("@TransactionID", SqlDbType.Int).Value = pos_ProductTransactionMaster.TransactionID; cmd.Parameters.Add("@ToOrFromID", SqlDbType.Int).Value = pos_ProductTransactionMaster.ToOrFromID; cmd.Parameters.Add("@Record", SqlDbType.NVarChar).Value = pos_ProductTransactionMaster.Record; cmd.Parameters.Add("@Particulars", SqlDbType.NText).Value = pos_ProductTransactionMaster.Particulars; cmd.Parameters.Add("@WorkSatationID", SqlDbType.Int).Value = pos_ProductTransactionMaster.WorkSatationID; cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = pos_ProductTransactionMaster.ExtraField1; cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = pos_ProductTransactionMaster.ExtraField2; cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value = pos_ProductTransactionMaster.ExtraField3; cmd.Parameters.Add("@ExtraField4", SqlDbType.NVarChar).Value = pos_ProductTransactionMaster.ExtraField4; cmd.Parameters.Add("@ExtraField5", SqlDbType.NVarChar).Value = pos_ProductTransactionMaster.ExtraField5; cmd.Parameters.Add("@AddedBy", SqlDbType.Int).Value = pos_ProductTransactionMaster.AddedBy; cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = pos_ProductTransactionMaster.AddedDate; cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value = pos_ProductTransactionMaster.UpdatedBy; cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = pos_ProductTransactionMaster.UpdatedDate; cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = pos_ProductTransactionMaster.RowStatusID; connection.Open(); int result = cmd.ExecuteNonQuery(); return(result == 1); } }
public static Pos_ProductTransactionMaster GetPos_ProductTransactionMasterByID(int id) { Pos_ProductTransactionMaster pos_ProductTransactionMaster = new Pos_ProductTransactionMaster(); SqlPos_ProductTransactionMasterProvider sqlPos_ProductTransactionMasterProvider = new SqlPos_ProductTransactionMasterProvider(); pos_ProductTransactionMaster = sqlPos_ProductTransactionMasterProvider.GetPos_ProductTransactionMasterByID(id); return(pos_ProductTransactionMaster); }
public Pos_ProductTransactionMaster GetPos_ProductTransactionMasterFromReader(IDataReader reader) { try { Pos_ProductTransactionMaster pos_ProductTransactionMaster = new Pos_ProductTransactionMaster ( (int)reader["Pos_ProductTransactionMasterID"], (DateTime)reader["TransactionDate"], (int)reader["TransactionID"], (int)reader["ToOrFromID"], reader["Record"].ToString(), reader["Particulars"].ToString(), (int)reader["WorkSatationID"], 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_ProductTransactionMaster; } catch(Exception ex) { return null; } }
public bool UpdatePos_ProductTransactionMaster(Pos_ProductTransactionMaster pos_ProductTransactionMaster) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_UpdatePos_ProductTransactionMaster", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_ProductTransactionMasterID", SqlDbType.Int).Value = pos_ProductTransactionMaster.Pos_ProductTransactionMasterID; cmd.Parameters.Add("@TransactionDate", SqlDbType.DateTime).Value = pos_ProductTransactionMaster.TransactionDate; cmd.Parameters.Add("@TransactionID", SqlDbType.Int).Value = pos_ProductTransactionMaster.TransactionID; cmd.Parameters.Add("@ToOrFromID", SqlDbType.Int).Value = pos_ProductTransactionMaster.ToOrFromID; cmd.Parameters.Add("@Record", SqlDbType.NVarChar).Value = pos_ProductTransactionMaster.Record; cmd.Parameters.Add("@Particulars", SqlDbType.NText).Value = pos_ProductTransactionMaster.Particulars; cmd.Parameters.Add("@WorkSatationID", SqlDbType.Int).Value = pos_ProductTransactionMaster.WorkSatationID; cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = pos_ProductTransactionMaster.ExtraField1; cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = pos_ProductTransactionMaster.ExtraField2; cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value = pos_ProductTransactionMaster.ExtraField3; cmd.Parameters.Add("@ExtraField4", SqlDbType.NVarChar).Value = pos_ProductTransactionMaster.ExtraField4; cmd.Parameters.Add("@ExtraField5", SqlDbType.NVarChar).Value = pos_ProductTransactionMaster.ExtraField5; cmd.Parameters.Add("@AddedBy", SqlDbType.Int).Value = pos_ProductTransactionMaster.AddedBy; cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = pos_ProductTransactionMaster.AddedDate; cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value = pos_ProductTransactionMaster.UpdatedBy; cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = pos_ProductTransactionMaster.UpdatedDate; cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = pos_ProductTransactionMaster.RowStatusID; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }
public static bool UpdatePos_ProductTransactionMaster(Pos_ProductTransactionMaster pos_ProductTransactionMaster) { SqlPos_ProductTransactionMasterProvider sqlPos_ProductTransactionMasterProvider = new SqlPos_ProductTransactionMasterProvider(); return(sqlPos_ProductTransactionMasterProvider.UpdatePos_ProductTransactionMaster(pos_ProductTransactionMaster)); }
public static int InsertPos_ProductTransactionMaster(Pos_ProductTransactionMaster pos_ProductTransactionMaster) { SqlPos_ProductTransactionMasterProvider sqlPos_ProductTransactionMasterProvider = new SqlPos_ProductTransactionMasterProvider(); return(sqlPos_ProductTransactionMasterProvider.InsertPos_ProductTransactionMaster(pos_ProductTransactionMaster)); }