Esempio n. 1
0
        public static string Generate(FGHeader objFGHeader)
        {
            string msg = string.Empty;

            try
            {
                FGDetail objFGDtl    = objFGHeader.FGDetails.FirstOrDefault();
                PrintTag objPrintTag = objFGDtl.PrintTag;
                string   fileName    = $@"\\{Conn.POLabelLocation}\{objFGHeader.Company}\{objFGHeader.PONum}_{objFGHeader.DONum}_{objFGDtl.POLine}_{objFGDtl.Id}.csv";

                using (StreamWriter sw = System.IO.File.CreateText(fileName))
                {
                    sw.WriteLine("Part Num,Part Desc,Lot Num,Qty,UOM,Copies");

                    //Response.ClearContent();
                    //Response.AddHeader("content-disposition", "attachment;filename=Carton-" + csvModel.PONum + "-" + csvModel.DONum + ".csv");
                    //Response.ContentType = "text/csv";


                    sw.WriteLine(string.Format("{0},{1},{2},{3},{4},{5}",
                                               objFGDtl.PartNum,
                                               objFGDtl.PartDesc,
                                               objFGDtl.LotNum,
                                               objPrintTag.QtyPerContainer,
                                               objFGDtl.UomCode,
                                               objPrintTag.NumberOfTags));
                    msg = $"\nLabel:{fileName} Generated Sucessfully!";
                }
            }
            catch (Exception ex)
            {
                msg = $"Label Generate Failed. \nError : {ex.Message.ToString()}";
            }
            return(msg);
        }
Esempio n. 2
0
        public FGHeader GetPOHeaderByDONum(string DONum, string Company)
        {
            FGHeader objPOHeader = new FGHeader();

            objPOHeader.PONum    = 1002;
            objPOHeader.DONum    = "Test1002";
            objPOHeader.SuppNum  = 1;
            objPOHeader.SuppId   = "Cust2";
            objPOHeader.SuppName = "Test Supplier2";
            //objPOHeader.PODetails = new List<PODetail>
            //{
            //    new PODetail { PONum = objPOHeader.PONum,POLine=1, PartNum="TestPart_3", PUM="KG" },
            //    new PODetail { PONum = objPOHeader.PONum,POLine=2, PartNum="TestPart_4", PUM="KG" }
            //};
            return(objPOHeader);
        }
Esempio n. 3
0
        public string InsertPOHeader(FGHeader objFGHeader)
        {
            string msg = string.Empty;

            try
            {
                DAL objDAL = new DAL();
                msg = objDAL.InsertPOData(objFGHeader);
            }
            catch (Exception ex)
            {
                msg = ex.Message.ToString();
            }

            return(msg);
        }
Esempio n. 4
0
        public FGHeader GetPOHeaderByPONum(int PONum, string Company)
        {
            POHeader objPOHeader = new FGHeader();
            DAL      objDAL      = new DAL();

            objPOHeader = objDAL.GetDataByPONum(PONum, Company);
            //objPOHeader.PONum = 1001;
            //objPOHeader.DONum = "Test1001";
            //objPOHeader.SuppNum = 1;
            //objPOHeader.SuppId = "Cust1";
            //objPOHeader.SuppName = "Test Supplier";
            //objPOHeader.PODetails = new List<PODetail>
            //{
            //    new PODetail { PONum = objPOHeader.PONum,POLine=1, PartNum="TestPart_1", PUM="KG",
            //        LotAttribute= new LotAttribute { PONum=objPOHeader.PONum,POLine=1,Batch="Tracked",MBatch="NotTracked"},
            //        PrintTag=new PrintTag{PONum=objPOHeader.PONum,POLine=1}
            //    },
            //    new PODetail { PONum = objPOHeader.PONum,POLine=2, PartNum="TestPart_2", PUM="KG",
            //        LotAttribute= new LotAttribute { PONum=objPOHeader.PONum,POLine=2,Batch="Tracked",MBatch="NotTracked"},
            //        PrintTag=new PrintTag{PONum=objPOHeader.PONum,POLine=2}
            //    }
            //};
            return(objPOHeader);
        }