Example #1
0
        public static PartMaskLink PopulatePartMaskLinkFromSqlDataReader(SqlDataReader dr)
        {
            PartMaskLink partMaskLink = new PartMaskLink();

            partMaskLink.LinkID = Convert.ToInt32(dr["LinkID"]);
            partMaskLink.PartNumber = Convert.ToString(dr["PartNumber"]);
            partMaskLink.PartID = Convert.ToInt32(dr["PartID"]);
            partMaskLink.MaskDescription = Convert.ToString(dr["MaskDescription"]);
            partMaskLink.MaskType = Convert.ToString(dr["MaskType"]);
            partMaskLink.MaskQty = Convert.ToInt32(dr["MaskQty"]);

            return partMaskLink;
        }
Example #2
0
        public void DeletePartMaskLink(PartMaskLink PartMaskLinkID)
        {
            // Initialize SPROC
            SqlConnection conn = new SqlConnection(ConnectionString);
            SqlCommand cmd = new SqlCommand("SPPartMaskLinkDelete", conn);
            cmd.CommandType = CommandType.StoredProcedure;

            // Delete Parameters
            cmd.Parameters.AddWithValue("@LINKID", PartMaskLinkID.LinkID);

            conn.Open();
            cmd.ExecuteNonQuery();
            conn.Close();
        }
Example #3
0
        public void AddPartMaskLink(PartMaskLink PartMaskLink)
        {
            // Initialize SPROC
            SqlConnection conn = new SqlConnection(ConnectionString);
            SqlCommand cmd = new SqlCommand("SPPartMaskLinkInsert", conn);
            cmd.CommandType = CommandType.StoredProcedure;

            // Add Parameters
            cmd.Parameters.AddWithValue("@PartNumber", PartMaskLink.PartNumber);
            cmd.Parameters.AddWithValue("@PartID", PartMaskLink.PartID);
            cmd.Parameters.AddWithValue("@MaskDescription", PartMaskLink.MaskDescription);
            cmd.Parameters.AddWithValue("@MaskType", PartMaskLink.MaskType);
            cmd.Parameters.AddWithValue("@MaskQty", PartMaskLink.MaskQty);
            conn.Open();
            cmd.ExecuteNonQuery();
            conn.Close();
        }
Example #4
0
 public PartMaskLink SearchPartMaskLink(String Desc, String Type)
 {
     foreach (PartMaskLink p in pList)
     {
         if ((p.MaskDescription == Desc)&&(p.MaskType == Type))
         {
             return p;
         }
     }
     PartMaskLink pml = new PartMaskLink();
     return (pml);
 }