Ejemplo n.º 1
0
        public bool UpdateSOrder(AlternativeOrder ent)
        {
            bool success = true;
            AlternativeOrderDAO entDAO = new AlternativeOrderDAO();

            sc             = new SqlCommand("UpdateSOrder");
            sc.CommandType = CommandType.StoredProcedure;
            sc.Parameters.Add("@ID", ent.ID);
            sc.Parameters.Add("@IsPaid", ent.IsPaid);
            sc.Parameters.Add("@UserID", ent.UserID);
            if (ent.DateOut == null)
            {
                sc.Parameters.Add("@DateOut", DBNull.Value);
            }
            else
            {
                sc.Parameters.Add("@DateOut", ent.DateOut);
            }
            if (ent.PaymentDay == null)
            {
                sc.Parameters.Add("@PaymentDay", DBNull.Value);
            }
            else
            {
                sc.Parameters.Add("@PaymentDay", ent.PaymentDay.Value);
            }
            //addParameters(ent);
            success = entDAO.updateEntity(sc);
            return(success);
        }
Ejemplo n.º 2
0
        /* public UniversalEntity RetrieveSOrderByID(int id)
         * {
         *   SOrderDAO entDAO = new SOrderDAO();
         *   sc = new SqlCommand("RetrieveSOrderById");
         *   sc.CommandType = CommandType.StoredProcedure;
         *   sc.Parameters.Add("@ID", id);
         *   return (entDAO.retrieveEntity(sc));
         * }*/


        public UniversalEntity RetrieveSOrderById(int id)
        {
            AlternativeOrderDAO entDAO = new AlternativeOrderDAO();

            sc             = new SqlCommand("RetrieveSOrderById");
            sc.CommandType = CommandType.StoredProcedure;
            sc.Parameters.Add("@ID", id);
            return(entDAO.retrieveEntity(sc));
        }
Ejemplo n.º 3
0
        public int CreateSOrder(AlternativeOrder ent)
        {
            int createid = 0;
            AlternativeOrderDAO entDAO = new AlternativeOrderDAO();

            sc             = new SqlCommand("CreateSOrder");
            sc.CommandType = CommandType.StoredProcedure;
            addParametres(ent);
            createid = entDAO.createEntity(sc);
            return(createid);
        }