public static CustomList <StockTransactionDetail> GetAllStockTransactionDetail(Int64 StockTransID)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <StockTransactionDetail> StockTransactionDetailCollection = new CustomList <StockTransactionDetail>();
            IDataReader reader = null;
            String      sql    = "spGetStockTransDetail " + StockTransID;

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    StockTransactionDetail newStockTransactionDetail = new StockTransactionDetail();
                    newStockTransactionDetail.SetData(reader);
                    StockTransactionDetailCollection.Add(newStockTransactionDetail);
                }
                return(StockTransactionDetailCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
 public static CustomList<StockTransactionDetail> GetAllStockTransactionDetail(Int64 StockTransID)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<StockTransactionDetail> StockTransactionDetailCollection = new CustomList<StockTransactionDetail>();
     IDataReader reader = null;
     String sql = "spGetStockTransDetail " + StockTransID;
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             StockTransactionDetail newStockTransactionDetail = new StockTransactionDetail();
             newStockTransactionDetail.SetData(reader);
             StockTransactionDetailCollection.Add(newStockTransactionDetail);
         }
         return StockTransactionDetailCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Esempio n. 3
0
        private void GetRefDetail()
        {
            try
            {
                String test = String.Empty;
                Int64 stockID = Convert.ToInt64(HttpContext.Current.Request.QueryString["stockID"]);
                String stockTest = HttpContext.Current.Request.QueryString["stockTest"];
                String menuName = HttpContext.Current.Request.QueryString["menuName"];
                String transTypeID = HttpContext.Current.Request.QueryString["transTypeID"];
                String refTypeTest = HttpContext.Current.Request.QueryString["refTypeTest"];
                String refNo = HttpContext.Current.Request.QueryString["refNo"];

                CustomList<StockTransactionDetail> ExistingTransDetailList = (CustomList<StockTransactionDetail>)HttpContext.Current.Session[menuName + "_StockTransactionDetailList"];
                if (transTypeID == "3")
                {
                    POManager manager = new POManager();
                    CustomList<PODetail> PODetailList = manager.GetAllPODetail(stockID);
                    foreach (PODetail IR in PODetailList)
                    {
                        StockTransactionDetail obj = new StockTransactionDetail();
                        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 (transTypeID.IsNotNullOrEmpty())
                            obj.SourceReferenceTypeID = transTypeID.ToInt();
                        obj.SourceReferenceType = refTypeTest;
                        obj.SourceReference = stockTest;
                        obj.SourceReferenceID = stockID;
                        obj.SourceReferenceNo = refNo;
                        ExistingTransDetailList.Add(obj);
                    }
                }
                else
                {
                    StockTransactionManager manager = new StockTransactionManager();
                    CustomList<StockTransactionDetail> DetailList = manager.GetAllStockTransactionDetail(stockID);
                    foreach (StockTransactionDetail RD in DetailList)
                    {
                        if (transTypeID.IsNotNullOrEmpty())
                            RD.SourceReferenceTypeID = transTypeID.ToInt();
                        RD.SourceReferenceType = refTypeTest;
                        RD.SourceReference = stockTest;
                        RD.SourceReferenceID = stockID;
                        RD.SourceReferenceNo = refNo;
                        RD.SetAdded();
                        ExistingTransDetailList.Add(RD);
                    }
                }
                HttpContext.Current.Session[menuName + "_StockTransactionDetailList"] = ExistingTransDetailList;

                HttpContext.Current.Response.Clear();
                HttpContext.Current.Response.ContentType = "text/plain";
                HttpContext.Current.Response.Write(test);
                HttpContext.Current.Response.Flush();
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }