예제 #1
0
        protected void grdItems_IDB(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Product p = (Product)e.Item.DataItem;

                Label lblTitle   = (Label)e.Item.FindControl("lblTitle");
                Label lblQty     = (Label)e.Item.FindControl("lblQty");
                Label lblDetails = (Label)e.Item.FindControl("lblDetails");

                lblTitle.Text   = p.LongTitle;
                lblQty.Text     = p.NumQtyOrdered.ToString();
                lblDetails.Text = "TODO:";

                if (p.ProductId.ToLower().EndsWith("c"))
                {
                    KVPair Nerdo = new KVPair();
                    //***EAc  @%$#*@# UI is giving me problems...hardcoding class for now
                    lblTitle.Text = "<span class=textLoud>Cover Only: </span>" + p.LongTitle;
                    Nerdo.Key     = p.LongTitle;
                    Nerdo.Val     = PubEnt.DAL2.DAL.GetNerdoURLByChild(p.ProductId);
                    Nerdos.Add(Nerdo);
                }
            }
        }
예제 #2
0
        public static KVPairCollection GetAllShippingMethods()
        {
            Database  db = DatabaseFactory.CreateDatabase();
            DbCommand cw = db.GetStoredProcCommand("sp_NCIPL_GetAllShippingMethods");

            using (System.Data.IDataReader dr = db.ExecuteReader(cw))
            {
                KVPairCollection coll = new KVPairCollection();
                while (dr.Read())
                {
                    KVPair k = new KVPair((string)dr.GetString(0), (string)dr.GetString(1));
                    coll.Add(k);
                }
                return(coll);
            }
        }
예제 #3
0
        //*********************************************************************
        //
        // Generate Collection  Methods
        //
        // The following methods are used to generate collections of objects
        //[]
        //*********************************************************************


        public static KVPairCollection GetKVPair(string s)
        {
            Database  db = DatabaseFactory.CreateDatabase();
            DbCommand cw = db.GetStoredProcCommand(s);

            using (System.Data.IDataReader dr = db.ExecuteReader(cw))
            {
                KVPairCollection coll = new KVPairCollection();
                while (dr.Read())
                {
                    KVPair k = new KVPair(dr.GetInt32(0).ToString(), (string)dr.GetString(1));
                    coll.Add(k);
                }
                return(coll);
            }
        }
예제 #4
0
        public static KVPairCollection GetOrderMedia(string role)
        {
            Database  db = DatabaseFactory.CreateDatabase();
            DbCommand cw = db.GetStoredProcCommand("sp_NCIPLCC_getOrderMedia");

            db.AddInParameter(cw, "role", DbType.String, role);
            using (System.Data.IDataReader dr = db.ExecuteReader(cw))
            {
                KVPairCollection coll = new KVPairCollection();
                while (dr.Read())
                {
                    KVPair k = new KVPair(dr.GetInt32(0).ToString(), (string)dr.GetString(1));
                    coll.Add(k);
                }
                return(coll);
            }
        }
예제 #5
0
        //END HITT 8329 #############################################

        //BEGIN CR - 23 -- Canned Search
        public static KVPairCollection GetCannedSearchIdText(string procname, string param)
        {
            Database  db = DatabaseFactory.CreateDatabase();
            DbCommand cw = db.GetStoredProcCommand(procname);

            db.AddInParameter(cw, "recordid", DbType.String, param);
            using (System.Data.IDataReader dr = db.ExecuteReader(cw))
            {
                KVPairCollection coll = new KVPairCollection();
                while (dr.Read())
                {
                    KVPair k = new KVPair(
                        dr.GetInt32(0).ToString(),
                        (dr[1] == DBNull.Value) ? "" : dr[1].ToString()
                        );
                    coll.Add(k);
                }
                return(coll);
            }
        }
예제 #6
0
        //Get Key, Value, Selected information for the lists
        public static KVPairCollection GetKVPair(string procname, int mode, int cannid)
        {
            Database  db = DatabaseFactory.CreateDatabase();
            DbCommand cw = db.GetStoredProcCommand(procname);

            db.AddInParameter(cw, "mode", DbType.Int32, mode);
            db.AddInParameter(cw, "cannid", DbType.Int32, cannid);
            using (System.Data.IDataReader dr = db.ExecuteReader(cw))
            {
                KVPairCollection coll = new KVPairCollection();
                while (dr.Read())
                {
                    KVPair k = new KVPair(
                        dr.GetInt32(0).ToString(),
                        (dr[1] == DBNull.Value) ? "" : dr[1].ToString(),
                        dr.GetInt32(2).ToString()
                        );
                    coll.Add(k);
                }
                return(coll);
            }
        }
예제 #7
0
        public static KVPairCollection GetCities(int z)
        {
            Database  db        = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("sp_NCIPL_GetCities");

            db.AddInParameter(dbCommand, "zip", DbType.String, z.ToString().PadLeft(5, '0'));//***EAC HOTFIX for hitt8245...better to change here than in the calling procedures.


            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                // Processing code
                KVPairCollection c = new KVPairCollection();
                while (dr.Read())
                {
                    KVPair k = new KVPair(
                        dr["cityname"].ToString(),
                        dr["state"].ToString()
                        );
                    c.Add(k);
                }
                return(c);
            }
        }