예제 #1
0
        public bool UpdateFOrder(NewFOrder ent)
        {
            bool         success = true;
            NewFOrderDAO entDAO  = new NewFOrderDAO();

            sc             = new SqlCommand("UpdateFOrder2018");
            sc.CommandType = CommandType.StoredProcedure;
            sc.Parameters.Add("@ID", ent.ID);
            sc.Parameters.Add("@IsPaid", ent.IsPaid);
            sc.Parameters.Add("@DefectVodomer", ent.DefectVodomer);
            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);
        }
예제 #2
0
        public UniversalEntity RetrieveFOrderById(int id)
        {
            NewFOrderDAO entDAO = new NewFOrderDAO();

            sc             = new SqlCommand("RetrieveFOrderById2018");
            sc.CommandType = CommandType.StoredProcedure;
            sc.Parameters.Add("@ID", id);
            return(entDAO.retrieveEntity(sc));
        }
예제 #3
0
        public int Create(NewFOrder ent)
        {
            int          createdid = 0;
            NewFOrderDAO entDAO    = new NewFOrderDAO();

            sc             = new SqlCommand("CreateFOrder2018");
            sc.CommandType = CommandType.StoredProcedure;
            addParameters(ent);
            createdid = entDAO.createEntity(sc);
            return(createdid);
        }