Example #1
0
 /// <summary>
 /// Method to get MoBOMs via a specified model
 /// </summary>	
 /// <param name="model">a valid model code</param>
 /// <returns>Interface to Model Collection Generic of MoBOMInfo</returns>
 public IList<MoBOMInfo> GetMoBOMByModel(string model)
 {
     IList<MoBOMInfo> result = dal.GetMoBOMByModel(model);
     int rows = (int)result.LongCount();
     while (rows < MAX_SUB_COUNT)
     {
         MoBOMInfo info = new MoBOMInfo();
         result.Add(info);
         rows++;
     }
     return result;
 }
Example #2
0
        /// <summary>
        /// Method to get MoBOMs via a specified model
        /// </summary>	
        /// <param name="model">a valid model code</param>
        /// <returns>Interface to Model Collection Generic of MoBOMInfo</returns>
        public IList<MoBOMInfo> GetMoBOMByModel(string model)
        {
            IList<MoBOMInfo> result = new List<MoBOMInfo>();

            string strSql = "SELECT distinct(MO), Qty, PrintQty as StartQty, Udt FROM MO where Model='" + model + "'";

            using (SqlDataReader rdr = SQLHelper.ExecuteReader(SQLHelper.ConnectionStringLocalTransaction, CommandType.Text, strSql, null))
            {
                while (rdr.Read())
                {
                    MoBOMInfo mo = new MoBOMInfo();

                    mo.Mo = rdr.GetString(0).Trim();
                    mo.Qty = "" + rdr.GetInt16(1);
                    mo.StartQty = "" + rdr.GetInt16(2);
                    mo.UpdateDate = rdr.GetDateTime(3).ToString("yyyy-MM-dd");
                    result.Add(mo);
                }
            }

            return result;
        }