Ejemplo n.º 1
0
        public Int32 Save(CreditBillItemDetails Details)
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = "INSERT INTO tblCreditBillDetailss(CreditBillHeaderID, TransactionDate, Description, Amount, " +
                             "TransactionTypeID, TransactionRefID, TerminalNoRefID, BranchIDRefID)VALUES(" +
                             "@CreditBillHeaderID, @TransactionDate, @Description, @Amount, " +
                             "@TransactionTypeID, @TransactionRefID, @TerminalNoRefID, @BranchIDRefID)";

                cmd.Parameters.AddWithValue("CreditBillHeaderID", Details.CreditBillHeaderID);
                cmd.Parameters.AddWithValue("TransactionDate", Details.TransactionDate);
                cmd.Parameters.AddWithValue("Description", Details.Description);
                cmd.Parameters.AddWithValue("Amount", Details.Amount);
                cmd.Parameters.AddWithValue("TransactionTypeID", Details.TransactionTypeID);
                cmd.Parameters.AddWithValue("TransactionRefID", Details.TransactionRefID);
                cmd.Parameters.AddWithValue("TerminalNoRefID", Details.TerminalNoRefID);
                cmd.Parameters.AddWithValue("BranchIDRefID", Details.BranchIDRefID);

                cmd.CommandText = SQL;
                return(base.ExecuteNonQuery(cmd));
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Ejemplo n.º 2
0
        public Int32 Save(CreditBillItemDetails Details)
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = "INSERT INTO tblCreditBillDetailss(CreditBillHeaderID, TransactionDate, Description, Amount, " +
                                "TransactionTypeID, TransactionRefID, TerminalNoRefID, BranchIDRefID)VALUES(" +
                                "@CreditBillHeaderID, @TransactionDate, @Description, @Amount, " +
                                "@TransactionTypeID, @TransactionRefID, @TerminalNoRefID, @BranchIDRefID)";

                cmd.Parameters.AddWithValue("CreditBillHeaderID", Details.CreditBillHeaderID);
                cmd.Parameters.AddWithValue("TransactionDate", Details.TransactionDate);
                cmd.Parameters.AddWithValue("Description", Details.Description);
                cmd.Parameters.AddWithValue("Amount", Details.Amount);
                cmd.Parameters.AddWithValue("TransactionTypeID", Details.TransactionTypeID);
                cmd.Parameters.AddWithValue("TransactionRefID", Details.TransactionRefID);
                cmd.Parameters.AddWithValue("TerminalNoRefID", Details.TerminalNoRefID);
                cmd.Parameters.AddWithValue("BranchIDRefID", Details.BranchIDRefID);

                cmd.CommandText = SQL;
                return base.ExecuteNonQuery(cmd);
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Ejemplo n.º 3
0
        public CreditBillItemDetails[] setArrayDetails(System.Data.DataTable dt)
        {
            System.Collections.ArrayList arrItems = new System.Collections.ArrayList();
            CreditBillItemDetails        Details  = new CreditBillItemDetails();

            foreach (System.Data.DataRow dr in dt.Rows)
            {
                Details = new CreditBillItemDetails();
                Details.CreditBillDetailID = Int64.Parse(dr["CreditBillDetailID"].ToString());
                Details.CreditBillHeaderID = Int64.Parse(dr["CreditBillHeaderID"].ToString());
                Details.TransactionDate    = DateTime.Parse(dr["TransactionDate"].ToString());
                Details.Description        = dr["Description"].ToString();
                Details.Amount             = decimal.Parse(dr["Amount"].ToString());
                Details.TransactionTypeID  = Int32.Parse(dr["TransactionTypeID"].ToString());
                Details.TransactionRefID   = Int64.Parse(dr["TransactionRefID"].ToString());
                Details.TerminalNoRefID    = dr["TerminalNoRefID"].ToString();
                Details.BranchIDRefID      = Int32.Parse(dr["BranchIDRefID"].ToString());

                arrItems.Add(Details);
            }

            CreditBillItemDetails[] retDetails = new Data.CreditBillItemDetails[0];
            if (arrItems.Count > 0)
            {
                retDetails = new Data.CreditBillItemDetails[arrItems.Count];
                arrItems.CopyTo(retDetails);
            }

            return(retDetails);
        }
Ejemplo n.º 4
0
        public Int64 Insert(CreditBillItemDetails Details)
        {
            try
            {
                Save(Details);

                return Int64.Parse(base.getLAST_INSERT_ID(this));
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }	
        }
Ejemplo n.º 5
0
        public Int64 Insert(CreditBillItemDetails Details)
        {
            try
            {
                Save(Details);

                return(Int64.Parse(base.getLAST_INSERT_ID(this)));
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Ejemplo n.º 6
0
        public CreditBillItemDetails setDetails(System.Data.DataTable dt)
        {
            CreditBillItemDetails Details = new CreditBillItemDetails();

            foreach (System.Data.DataRow dr in dt.Rows)
            {
                Details.CreditBillDetailID = Int64.Parse(dr["CreditBillDetailID"].ToString());
                Details.CreditBillHeaderID = Int64.Parse(dr["CreditBillHeaderID"].ToString());
                Details.TransactionDate    = DateTime.Parse(dr["TransactionDate"].ToString());
                Details.Description        = dr["Description"].ToString();
                Details.Amount             = decimal.Parse(dr["Amount"].ToString());
                Details.TransactionTypeID  = Int32.Parse(dr["TransactionTypeID"].ToString());
                Details.TransactionRefID   = Int64.Parse(dr["TransactionRefID"].ToString());
                Details.TerminalNoRefID    = dr["TerminalNoRefID"].ToString();
                Details.BranchIDRefID      = Int32.Parse(dr["BranchIDRefID"].ToString());
            }
            return(Details);
        }
Ejemplo n.º 7
0
        public CreditBillItemDetails Details(Int64 CreditBillItemID)
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = SQLSelect() + "WHERE CreditBillItemID = @CreditBillItemID;";

                cmd.Parameters.AddWithValue("@CreditBillItemID", CreditBillItemID);

                cmd.CommandText = SQL;
                string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);
                base.MySqlDataAdapterFill(cmd, dt);

                CreditBillItemDetails Details = setDetails(dt);

                return(Details);
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Ejemplo n.º 8
0
        public CreditBillItemDetails[] setArrayDetails(System.Data.DataTable dt)
        {
            System.Collections.ArrayList arrItems = new System.Collections.ArrayList();
            CreditBillItemDetails Details = new CreditBillItemDetails();
            foreach (System.Data.DataRow dr in dt.Rows)
            {
                Details = new CreditBillItemDetails();
                Details.CreditBillDetailID = Int64.Parse(dr["CreditBillDetailID"].ToString());
                Details.CreditBillHeaderID = Int64.Parse(dr["CreditBillHeaderID"].ToString());
                Details.TransactionDate = DateTime.Parse(dr["TransactionDate"].ToString());
                Details.Description = dr["Description"].ToString();
                Details.Amount = decimal.Parse(dr["Amount"].ToString());
                Details.TransactionTypeID = Int32.Parse(dr["TransactionTypeID"].ToString());
                Details.TransactionRefID = Int64.Parse(dr["TransactionRefID"].ToString());
                Details.TerminalNoRefID = dr["TerminalNoRefID"].ToString();
                Details.BranchIDRefID = Int32.Parse(dr["BranchIDRefID"].ToString());

                arrItems.Add(Details);
            }

            CreditBillItemDetails[] retDetails = new Data.CreditBillItemDetails[0];
            if (arrItems.Count > 0)
            {
                retDetails = new Data.CreditBillItemDetails[arrItems.Count];
                arrItems.CopyTo(retDetails);
            }

            return retDetails;
        }
Ejemplo n.º 9
0
 public CreditBillItemDetails setDetails(System.Data.DataTable dt)
 {
     CreditBillItemDetails Details = new CreditBillItemDetails();
     foreach (System.Data.DataRow dr in dt.Rows)
     {
         Details.CreditBillDetailID = Int64.Parse(dr["CreditBillDetailID"].ToString());
         Details.CreditBillHeaderID = Int64.Parse(dr["CreditBillHeaderID"].ToString());
         Details.TransactionDate = DateTime.Parse(dr["TransactionDate"].ToString());
         Details.Description = dr["Description"].ToString();
         Details.Amount = decimal.Parse(dr["Amount"].ToString());
         Details.TransactionTypeID = Int32.Parse(dr["TransactionTypeID"].ToString());
         Details.TransactionRefID = Int64.Parse(dr["TransactionRefID"].ToString());
         Details.TerminalNoRefID = dr["TerminalNoRefID"].ToString();
         Details.BranchIDRefID = Int32.Parse(dr["BranchIDRefID"].ToString());
     }
     return Details;
 }