Exemplo n.º 1
0
        public Publisher GetPublisherDeatils(int SpecialID)
        {
            Publisher publisher = null;

            SqlParameter[] Params = { new SqlParameter("@PublisherID", SpecialID) };
            using (DataTable table = DataProvider.ExecuteParamatizedSelectCommand("sp_ViewPublisher",
                CommandType.StoredProcedure, Params))
            {
                if (table.Rows.Count == 1)
                {
                    DataRow row = table.Rows[0];
                    publisher = new Publisher();
                    publisher.PublisherID = Convert.ToInt32(row["PublisherID"]);
                    publisher.Name = row["Name"].ToString();

                }
            }
            return publisher;
        }
Exemplo n.º 2
0
 public List<Publisher> CheckDuplicatePublisher(string name)
 {
     List<Publisher> publisherList = null;
     SqlParameter[] Params = { new SqlParameter("@Name", name) };
     using (DataTable table = DataProvider.ExecuteParamatizedSelectCommand("sp_CheckDuplicatePublisher", CommandType.StoredProcedure, Params))
     {
         if(table.Rows.Count > 0)
         {
             publisherList = new List<Publisher>();
             foreach (DataRow row in table.Rows)
             {
                 Publisher publisher = new Publisher();
                 publisher.PublisherID = Convert.ToInt32(row["PublisherID"]);
                 publisher.Name = row["Name"].ToString();
                 publisherList.Add(publisher);
             }
         }
     }
     return publisherList;
 }
Exemplo n.º 3
0
        public List<Publisher> GetPublisherList()
        {
            List<Publisher> PublisherList = null;

            using (DataTable table = DataProvider.ExecuteSelectCommand("sp_ViewAllPublishers", //*Note
                CommandType.StoredProcedure))
            {
                if (table.Rows.Count > 0)
                {
                    PublisherList = new List<Publisher>();
                    foreach (DataRow row in table.Rows)
                    {
                        Publisher publisher = new Publisher();
                        publisher.PublisherID = Convert.ToInt32(row["PublisherID"]);
                        publisher.Name = row["Publisher"].ToString();
                        PublisherList.Add(publisher);
                    }
                }
            }
            return PublisherList;
        }
Exemplo n.º 4
0
 public bool AddPublisher(Publisher publisher)
 {
     PublisherHandler myHandler = new PublisherHandler(); return myHandler.InsertPublisher(publisher);
 }
Exemplo n.º 5
0
 public bool UpdatePublisher(Publisher publisher)
 {
     PublisherHandler myHandler = new PublisherHandler(); return myHandler.UpdatePublisher(publisher);
 }
Exemplo n.º 6
0
 public bool InsertPublisher(Publisher publisher)
 {
     SqlParameter[] Params = new SqlParameter[]
     {
         new SqlParameter("@Name", publisher.Name)
     };
     return DataProvider.ExecuteNonQuery("sp_InsertPublisher", CommandType.StoredProcedure,
         Params);
 }
Exemplo n.º 7
0
 public bool UpdatePublisher(Publisher publisher)
 {
     SqlParameter[] Params = new SqlParameter[]
     {
         new SqlParameter("@PublisherID", publisher.PublisherID ),
         new SqlParameter("@Name", publisher.Name),
     };
     return DataProvider.ExecuteNonQuery("sp_UpdatePublisher", CommandType.StoredProcedure,
         Params);
 }