Beispiel #1
0
        public static CustomList <PODetail> GetAllPODetail()
        {
            ConnectionManager     conManager         = new ConnectionManager(ConnectionName.HR);
            CustomList <PODetail> PODetailCollection = new CustomList <PODetail>();
            IDataReader           reader             = null;
            const String          sql = "select *from PODetail";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    PODetail newPODetail = new PODetail();
                    newPODetail.SetData(reader);
                    PODetailCollection.Add(newPODetail);
                }
                return(PODetailCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Beispiel #2
0
        private void GetRefTransDetail()
        {
            try
            {
                String test = String.Empty;
                RequisitionManager manager = new RequisitionManager();
                Int64 RefID = Convert.ToInt64(HttpContext.Current.Request.QueryString["RefID"]);
                String POTest = HttpContext.Current.Request.QueryString["POTest"];
                String refTypeID = HttpContext.Current.Request.QueryString["refTypeID"];
                String refTypeTest = HttpContext.Current.Request.QueryString["refTypeTest"];
                String refNo = HttpContext.Current.Request.QueryString["refNo"];
                CustomList<ItemRequisitionDetail> ItemRequisitionDetailList = manager.GetAllItemRequisitionDetail(RefID);
                CustomList<PODetail> ExistingPODetailList = (CustomList<PODetail>)HttpContext.Current.Session["PO_PODetailList"];
                foreach (ItemRequisitionDetail IR in ItemRequisitionDetailList)
                {
                    PODetail obj = new PODetail();
                    obj.ItemGroupID = IR.ItemGroupID;
                    obj.ItemSubGroupID = IR.ItemSubGroupID;
                    obj.ItemCode = IR.ItemCode;
                    obj.UOMID = IR.UOMID;
                    obj.ItemQty = IR.ItemQty;
                    obj.UnitPrice = IR.UnitPrice;

                    if (refTypeID.IsNotNullOrEmpty())
                        obj.SourceReferenceTypeID = refTypeID.ToInt();
                    obj.SourceReferenceType = refTypeTest;
                    obj.SourceReference = POTest;
                    obj.SourceReferenceID = RefID;
                    obj.SourceReferenceNo = refNo;
                    ExistingPODetailList.Add(obj);
                }
                HttpContext.Current.Session["PO_PODetailList"] = ExistingPODetailList;

                HttpContext.Current.Response.Clear();
                HttpContext.Current.Response.ContentType = "text/plain";
                HttpContext.Current.Response.Write(test);
                HttpContext.Current.Response.Flush();
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
Beispiel #3
0
 public static CustomList<PODetail> GetAllPODetail()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<PODetail> PODetailCollection = new CustomList<PODetail>();
     IDataReader reader = null;
     const String sql = "select *from PODetail";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             PODetail newPODetail = new PODetail();
             newPODetail.SetData(reader);
             PODetailCollection.Add(newPODetail);
         }
         return PODetailCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }