Exemple #1
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);
            }
        }
Exemple #2
0
        public MTNMaterial Get(long MTNNO, String MaterialCode)
        {
            Material_DL objMaterial_DL = new Material_DL(Connection);
            MTN_DL      objMTN_DL      = new MTN_DL(Connection);

            MTNMaterial objMTNMaterial = new MTNMaterial();

            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@Original_MTNNO", MTNNO),
                    new SqlParameter("@Original_MTNMaterialCode", MaterialCode)
                };

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


                objMTNMaterial.Material    = objMaterial_DL.Get(Convert.ToString(dt.Rows[0]["MTNMaterialCode"]));
                objMTNMaterial.Batch       = "No";
                objMTNMaterial.Description = Convert.ToString(dt.Rows[0]["MTNDescription"]);
                objMTNMaterial.MTN         = objMTN_DL.Get(Convert.ToInt64(dt.Rows[0]["MTNNO"]));
                objMTNMaterial.TransferQty = Convert.ToDecimal(dt.Rows[0]["MTNTransferQty"]);
                objMTNMaterial.UnitRate    = Convert.ToDecimal(dt.Rows[0]["MTNUnitRate"]);
                objMTNMaterial.ReceivedQty = Convert.ToDecimal(dt.Rows[0]["ReceivedQty"]);

                return(objMTNMaterial);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
        public MTNFinishProduct Get(long MTNNO, String FinishProductCode)
        {
            FinishProduct_DL objFinishProduct_DL = new FinishProduct_DL(Connection);
            MTN_DL           objMTN_DL           = new MTN_DL(Connection);

            MTNFinishProduct objMTNFinishProduct = new MTNFinishProduct();

            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@MTNNO", MTNNO),
                    new SqlParameter("@FinishProductCode", FinishProductCode)
                };

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

                if (dt.Rows.Count > 0)
                {
                    objMTNFinishProduct.FinishProduct = objFinishProduct_DL.Get(Convert.ToString(dt.Rows[0]["MTNFinishProductID"]));
                    objMTNFinishProduct.Batch         = "No";
                    objMTNFinishProduct.Description   = "No";
                    objMTNFinishProduct.MTN           = objMTN_DL.Get(Convert.ToInt64(dt.Rows[0]["MTNNO"]));
                    objMTNFinishProduct.ReceivedQty   = Convert.ToDecimal(dt.Rows[0]["MTNRceivedQty"]);

                    if (dt.Rows[0]["MTNUnitRate"] != DBNull.Value)
                    {
                        objMTNFinishProduct.UnitRate = Convert.ToDecimal(dt.Rows[0]["MTNUnitRate"]);
                    }
                    else
                    {
                        objMTNFinishProduct.UnitRate = 0;
                    }
                    objMTNFinishProduct.TransferQty = Convert.ToDecimal(dt.Rows[0]["MTNTransferQty"]);
                }

                return(objMTNFinishProduct);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Exemple #4
0
        //-- New - -
        public System.Data.DataTable GetDataViewByMTNNO(long MTNNO)
        {
            MTNMaterialCollc objMTNMaterialCollc = new MTNMaterialCollc();
            Material_DL      objMaterial_DL      = new Material_DL(Connection);
            MTN_DL           objMTN_DL           = new MTN_DL(Connection);

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

                DataTable dt = Execute.RunSP_DataTable(Connection, "SPDELETE_MTNMaterial", paramList);
                return(dt);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }