Ejemplo n.º 1
0
        public List <IndentDetail> Search()
        {
            List <IndentDetail> indentDetailList = new List <IndentDetail>();

            try
            {
                string  errorMessage = string.Empty;
                DataSet dSet         = GetSelectedRecords(Common.ToXml(this), SP_INDENT_DETAIL_SEARCH, ref errorMessage);
                //System.Data.DataTable dTable = GetSelectedRecords(Common.ToXml(this), SP_INDENT_DETAIL_SEARCH, ref errorMessage);

                if (dSet == null | dSet.Tables[0].Rows.Count <= 0)
                {
                    return(null);
                }

                foreach (System.Data.DataRow drow in dSet.Tables[0].Rows)
                {
                    IndentDetail indentDetail = new IndentDetail();
                    indentDetail.CreateIndentDetailObject(drow);
                    indentDetail.GetPONO(dSet.Tables[1]);
                    indentDetail.GetTONO(dSet.Tables[2]);
                    indentDetailList.Add(indentDetail);
                }
                return(indentDetailList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
 public List <IndentDetail> GetIndentDetail()
 {
     try
     {
         List <IndentDetail> _indentDetailList = new List <IndentDetail>();
         string          dbMessage             = string.Empty;
         DBParameterList dbParam = new DBParameterList();
         dbParam.Add(new DBParameter("@IndentNo", this.IndentNo, DbType.String));
         dbParam.Add(new DBParameter(Common.PARAM_OUTPUT, dbMessage, DbType.String, ParameterDirection.Output, Common.PARAM_OUTPUT_LENGTH));
         using (DataTaskManager dt = new DataTaskManager())
         {
             System.Data.DataSet dSet = new DataSet();
             dSet = dt.ExecuteDataSet(SP_GET_INDENT_DETAIL, dbParam);
             if (dbMessage.Trim().Equals(string.Empty) && dSet != null && dSet.Tables.Count > 0 && dSet.Tables[0].Rows.Count > 0)
             {
                 foreach (DataRow dr in dSet.Tables[0].Rows)
                 {
                     IndentDetail detail = new IndentDetail();
                     detail.CreateIndentDetailObject(dr);
                     detail.GetPONO(dSet.Tables[1]);
                     detail.GetTONO(dSet.Tables[2]);
                     _indentDetailList.Add(detail);
                 }
             }
         }
         return(_indentDetailList);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }