Пример #1
0
        /// <summary>
        /// 1001.삼성웰스토리-평택/용인
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        private DataTable ExcelUpload1010(DataTable dt)
        {
            var query =
                from dr in dt.AsEnumerable()
                select new
            {
                compky = "A001",
                wareky = "10",
                rqshpd = dr.Field <DateTime>(21).ToString("yyyy-MM-dd"),
                dlwrky = View.Customer,
                dlwrnm = View.Customer.Equals("1010")? "삼성웰스토리-평택": "삼성웰스토리-용인",
                ruteky = dr.Field <string>(10).ToString().Trim(),
                rutenm = dr.Field <string>(10),
                wavecd = View.Wavecd,
                lbbrcd = dr.Field <string>(35).ToString().Trim(),
                dlvycd = dr.Field <string>(8).ToString().Trim(),
                dlvynm = dr.Field <string>(9),
                prodcd = Convert.ToString(dr.Field <object>(4)).Trim().Substring(0, 10),
                prodnm = dr.Field <string>(5),
                ordqty = dr.Field <object>(17),
                attrb1 = string.Empty,
                status = "N"
            };

            return(CustomLINQtoDataSetMethods.CopyToDataTable(query));
        }
Пример #2
0
        /// <summary>
        /// 신세계
        /// 배송군을  광주/왜관/밀양을 이천1물류센터로
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="customer"></param>
        /// <returns></returns>
        private DataTable ExcelUpload1020(DataTable dt)
        {
            var query =
                from dr in dt.AsEnumerable()
                select new
            {
                compky = "A001",
                wareky = "10",
                rqshpd = dr.Field <object>(2),
                dlwrky = View.Customer,
                dlwrnm = "신세계",
                ruteky = dr.Field <string>(28).ToString().Trim().StartsWith("광주") || dr.Field <string>(28).ToString().Trim().StartsWith("왜관") || dr.Field <string>(28).ToString().Trim().StartsWith("밀양") ? "이천1물류센터" : dr.Field <string>(28).ToString().Trim(),
                rutenm = dr.Field <string>(28).ToString().Trim().StartsWith("광주") || dr.Field <string>(28).ToString().Trim().StartsWith("왜관") || dr.Field <string>(28).ToString().Trim().StartsWith("밀양") ? "이천1물류센터" : dr.Field <string>(28).ToString().Trim(),
                wavecd = View.Wavecd,
                //lbbrcd = string.Format("{0}:{1}", dr.Field<string>(35).ToString().Trim(), Convert.ToString(dr.Field<object>(24)).ToString().Trim()),
                lbbrcd = dr.Field <string>(35).ToString().Trim(),
                dlvycd = Convert.ToString(dr.Field <object>(25)).ToString().Trim(),
                dlvynm = dr.Field <string>(26).ToString().Trim(),
                prodcd = dr.Field <string>(9).ToString().Trim(),
                prodnm = dr.Field <string>(10),
                ordqty = dr.Field <object>(24),            //숫자로?
                attrb1 = dr.Field <string>(28).ToString().Trim(),
                status = "N"
            };

            return(CustomLINQtoDataSetMethods.CopyToDataTable(query));
        }
Пример #3
0
        /// <summary>
        /// CJ프레시웨이
        /// 수원이라는 단어가 들어 간것은 수원물류센터 2620
        /// 나머지는 전부 이천물류센터 2600
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="customer"></param>
        /// <returns></returns>
        private DataTable ExcelUpload1030(DataTable dt)
        {
            var query =
                from dr in dt.AsEnumerable()
                select new
            {
                compky = "A001",
                wareky = "10",
                rqshpd = dr.Field <object>(12),
                dlwrky = View.Customer,
                dlwrnm = "CJ프레시웨이",
                //ruteky = dr.Field<string>(0).ToString().Trim().Substring(0, 4),
                //rutenm = dr.Field<string>(0).ToString().Trim().Substring(7),
                ruteky = dr.Field <string>(0).ToString().Trim().Substring(7).StartsWith("수원") ? "2620" : "2600",
                rutenm = dr.Field <string>(0).ToString().Trim().Substring(7).StartsWith("수원") ? "수원물류센터" : "이천물류센터",
                wavecd = View.Wavecd,
                lbbrcd = dr.Field <string>(13).ToString().Trim(),
                dlvycd = dr.Field <string>(3).ToString().Trim(),
                dlvynm = dr.Field <string>(3).ToString().Trim(),
                prodcd = dr.Field <string>(1).ToString().Trim(),
                prodnm = dr.Field <string>(2),
                ordqty = dr.Field <object>(6),            //숫자로?
                attrb1 = dr.Field <string>(0).ToString().Trim(),
                status = "N"
            };

            return(CustomLINQtoDataSetMethods.CopyToDataTable(query));
        }
        //
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for CopyToDataTable
        ///</summary>
        public void CopyToDataTableTest1Helper <T>()
        {
            IEnumerable <T> source   = null; // TODO: Initialize to an appropriate value
            DataTable       expected = null; // TODO: Initialize to an appropriate value
            DataTable       actual;

            actual = CustomLINQtoDataSetMethods.CopyToDataTable <T>(source);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Пример #5
0
        /// <summary>
        /// 1004.동원홈푸드
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        private DataTable ExcelUpload1040(DataTable dt)
        {
            var query =
                from dr in dt.AsEnumerable()
                select new
            {
                //compky = "A001",
                //wareky = "10",
                //rqshpd = string.Format("{0}-{1}-{2}", dr.Field<string>(21).Substring(0, 4), dr.Field<string>(21).Substring(4, 2), dr.Field<string>(21).Substring(6, 2)),   //"20190321" 이런형태
                //dlwrky = "1004",
                //dlwrnm = "동원홈푸드",
                //ruteky = dr.Field<string>(3) == "시화(FS)" ? "R10" : dr.Field<string>(3) == "시화(급식유통)" ? "R11" : " ",
                //rutenm = dr.Field<string>(3),
                //lbbrcd = dr.Field<string>(25).Substring(0, 31),
                //dlvycd = dr.Field<string>(24), //납품처
                //dlvynm = dr.Field<string>(4), //납품처명
                //prodcd = Convert.ToString(dr.Field<double>(0)).Substring(0, 6),
                //prodnm = dr.Field<string>(1),
                //ordqty = dr.Field<object>(6),
                //status = "N"

                compky = "A001",
                wareky = "10",
                rqshpd = string.Format("{0}-{1}-{2}", dr.Field <string>(22).Substring(0, 4), dr.Field <string>(22).Substring(4, 2), dr.Field <string>(22).Substring(6, 2)),            //"20190321" 이런형태
                dlwrky = View.Customer,
                dlwrnm = "동원홈푸드",
                //ruteky = dr.Field<string>(4) == "시화(FS)" ? "R10" : dr.Field<string>(4) == "시화(급식유통)" ? "R11" : " ",
                ruteky = dr.Field <string>(4).ToString().Trim(),
                rutenm = dr.Field <string>(4).ToString().Trim(),
                //lbbrcd = dr.Field<string>(26).Substring(0, 31),
                wavecd = View.Wavecd,
                lbbrcd = dr.Field <string>(26).ToString().Trim(),
                //dlvycd = dr.Field<string>(25), //납품처
                dlvycd = dr.Field <string>(5).ToString().Trim(),            //납품처
                dlvynm = dr.Field <string>(5).ToString().Trim(),            //납품처명
                //prodcd = Convert.ToString(dr.Field<double>(1)).Substring(0, 6),
                prodcd = dr.Field <string>(1),
                prodnm = dr.Field <string>(2),
                ordqty = dr.Field <object>(7),
                attrb1 = string.Empty,
                status = "N"
            };

            return(CustomLINQtoDataSetMethods.CopyToDataTable(query));
        }