Ejemplo n.º 1
0
        public StockGRN Get(long StockID, long GRNNO)
        {
            GRN_DL   objGRNDL   = new GRN_DL(Connection);
            Stock_DL objStockDL = new Stock_DL(Connection);

            StockGRN objStockGRN = new StockGRN();

            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@Original_StockID", StockID),
                    new SqlParameter("@Original_StockGRNNO", GRNNO)
                };

                DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_StockGRNByID", paramList);

                objStockGRN.GRN          = objGRNDL.Get(Convert.ToInt64(dt.Rows[0]["StockGRNNO"]));
                objStockGRN.IssuedQty    = Convert.ToInt64(dt.Rows[0]["StockIssuedQty"]);
                objStockGRN.Stock        = objStockDL.Get(Convert.ToInt64(dt.Rows[0]["StockID"]));
                objStockGRN.StockGRNDate = Convert.ToDateTime(dt.Rows[0]["StockDate"]);

                return(objStockGRN);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Ejemplo n.º 2
0
        public MTNTransferList Get(long MTNNO, long StcokID, long GRNNO)
        {
            MTN_DL   objMTN_DL   = new MTN_DL(Connection);
            Stock_DL objStock_DL = new Stock_DL(Connection);
            GRN_DL   objGRN_DL   = new GRN_DL(Connection);

            MTNTransferList objMTNTransferList = new MTNTransferList();


            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@Original_MTNNO", MTNNO),
                    new SqlParameter("@Original_StockID", StcokID),
                    new SqlParameter("@Original_GRNNO", GRNNO)
                };

                DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_MTNTransferListByID", paramList);


                objMTNTransferList.GRN   = objGRN_DL.Get(Convert.ToInt64(dt.Rows[0]["GRNNO"]));
                objMTNTransferList.MTN   = objMTN_DL.Get(Convert.ToInt64(dt.Rows[0]["MTNNO"]));
                objMTNTransferList.Stock = objStock_DL.Get(Convert.ToInt64(dt.Rows[0]["StockID"]));
                objMTNTransferList.Qty   = Convert.ToDecimal(dt.Rows[0]["StockID"]);


                return(objMTNTransferList);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }