Ejemplo n.º 1
0
        public static commonReturn findByID(SqlConnection pCON, string id)
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            str = @"select a.* , (select ec_name from EOPCHE where a.balju_id = ec_id) as balju_name,
                                            (select ec_name from EOPCHE where a.jejak_id = ec_id) as jejak_name,
                                            (select ec_name from EOPCHE where a.yangsan_id = ec_id) as yangsan_name,
                                            (select ec_name from EOPCHE where a.wonsuju_id = ec_id) as wonsuju_name,
                                            (select ec_name from EOPCHE where a.buy_id = ec_id) as buy_name,
                                            (select ec_name from EOPCHE where a.where_id = ec_id) as where_name, c.MACHINE_NAME
                            from GEUMHYEONG a left outer join EOPCHE b on (a.balju_id = b.ec_id)
                                              left outer join SEOLBI c on (a.MACHINE_CODE = c.MACHINE_CODE) 
                            where gh_id = @id ";

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };

                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@id", id);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 2
0
        public static commonReturn findByWorkOrderID(SqlConnection pCON, string id) //작업지시 기준 조회
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            str = @"select a.*, b.*, c.MACHINE_NAME, d.sw_name, e.bs_name, f.gm_name, g.sj_name,
                                h.jp_name, h.jp_num, h.car, h.model, h.mtrl_num, h.cavity, h.cycle_t

                       from JAKEOP_SILJEOK a left outer join JAKEOP_JISI b on (a.jisi_id = b.jisi_id)
                                                left outer join SEOLBI c on (b.MACHINE_CODE = c.MACHINE_CODE)
                                                left outer join SAWON d on (a.sw_id = d.sw_id)
                                                left outer join BUSEO e on (a.bs_id = e.bs_id)
                                                left outer join GEUNMU f on (a.gm_id = f.gm_id)
                                                left outer join JEPUM h on (b.jp_id = h.jp_id)
                                                left outer join SUJI g on (h.sj_id = g.sj_id)

                       where a.jisi_id= @jisi_id ";
            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@jisi_id", id);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 3
0
        public static commonReturn read(SqlConnection pCON, string empid, string pw) //조회함수
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            str = @"select * from sawon where sw_id = @사원번호 and pw = @비밀번호";

//            @" select	a.사원번호, a.사원이름, a.영어이름, a.비밀번호, a.직위직책,
//					                            a.부서코드, a.사원등급, b.부서이름, a.시작주ID, a.시작부ID,  제품번호, a.사용여부
//					                   from 사원코드 a join 부서코드 b on(a.부서코드 = b.부서코드)
//					                   where a.사원번호 = @사용자ID
//                                       and   a.비밀번호 = @비밀번호 ";

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@사원번호", empid);
                pCMD.Parameters.AddWithValue("@비밀번호", pw);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 4
0
        public static commonReturn findByGbn(SqlConnection pCON, string gbn, string chk)
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            if (chk == "Y")
            {
                str = @"select * from EOPCHE where ec_gbn_name like '%' + @gbn + '%' and trade_chk = @chk";
            }
            else
            {
                str = @"select * from EOPCHE where ec_gbn like '%' + @gbn + '%' ";
            }

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@gbn", gbn);
                pCMD.Parameters.AddWithValue("@chk", chk);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 5
0
        public static commonReturn read_all(SqlConnection pCON, string chk) //조회함수
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            if (chk == "Y")
            {
                str = @"select a.*, b.sj_name
                            from JEPUM a
                                    left outer join SUJI b on (a.sj_id = b.sj_id)
                            where a.use_chk = 'Y' ";
            }
            else
            {
                str = @"select *, b.sj_name
                            from JEPUM a
                                    left outer join SUJI b on (a.sj_id = b.sj_id)";
            }

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 6
0
        public static commonReturn read_all(SqlConnection pCON, string chk) //조회함수
        {
            commonReturn return2 = new commonReturn();

            string str = "";

            if (chk == "Y")
            {
                str = @"select * from BUSEO where use_chk = 'Y' order by bs_id";
            }
            else
            {
                str = @"select * from BUSEO order by bs_id";
            }

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 7
0
        public static commonReturn findByName(SqlConnection pCON, string name, string chk)
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            if (chk == "Y")
            {
                str = @"select * from BUSEO where bs_name like '%' + @name + '%' and use_chk = @chk";
            }
            else
            {
                str = @"select * from BUSEO where bs_name like '%' + @name + '%' ";
            }

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@name", name);
                pCMD.Parameters.AddWithValue("@chk", chk);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 8
0
        public static commonReturn findBy2Param(SqlConnection pCON, string name, string dept)
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            str = @"select a.*, b.bs_name 
                        from SAWON a left outer join BUSEO b on (a.bs_id = b.bs_id) 
                        where a.use_chk = 'Y'
                        and a.sw_name like '%' + @name + '%'
                        and b.bs_name like '%' + @dept + '%'
                        order by b.bs_name, a.sw_id";

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@name", name);
                pCMD.Parameters.AddWithValue("@dept", dept);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 9
0
        public static commonReturn ReadWorkOrder(SqlConnection pCON, string id) //작업지시 조회
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            str = @"select a.*, b.jp_name, b.jp_num, b.car, b.model, b.mtrl_num, b.now_stock, b.cavity as original_cavity, b.cycle_t as original_cycle, b.sj_id,
                                b.sj_id, b.jp_stdpaper, c.MACHINE_NAME, d.sw_name, e.bs_name, f.ec_name, g.sj_name

                       from JAKEOP_JISI a left outer join JEPUM b on (a.jp_id = b.jp_id)
                                                left outer join SEOLBI c on (a.MACHINE_CODE = c.MACHINE_CODE)
                                                left outer join SAWON d on (a.wr_sw_id = d.sw_id)
                                                left outer join BUSEO e on (a.wr_bs_id = e.bs_id)
                                                left outer join EOPCHE f on (a.mnf_id = f.ec_id)
                                                left outer join SUJI g on (b.sj_id = g.sj_id)
                        where a.jisi_id = @jisi_id";
            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@jisi_id", id);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 10
0
        public static commonReturn findByID(SqlConnection pCON, string id)
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            str = @"select * from BUSEO where bs_id = @bs_id ";

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };

                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@bs_id", id);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 11
0
        public static commonReturn ReadErrorDetails(SqlConnection pCON, bool is_add, string id)
        {
            commonReturn return2 = new commonReturn();
            string       str     = string.Empty;

            if (is_add)
            {
                str = @"select a.*, 0 as qt_br 
                        from BULRYANG_WONIN a";
            }
            else
            {
                str = @"select a.*, b.qt_br 
                        from BULRYANG_WONIN a 
                                left outer join JAKEOP_SILJEOK_BR b on (a.br_id = b.br_id)
                        where siljeok_id like '%' + @siljeok_id + '%' ;";
            }

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@siljeok_id", id);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 12
0
        public static commonReturn findByID(SqlConnection pCON, string sw_id) //기존 권한 내역이 존재하는지 여부를 알아내기위해
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            str = @"select * from MENU_PERMISSION where sw_id = @sw_id";

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };

                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@sw_id", sw_id);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 13
0
        public static commonReturn ReadBreakTimeDetails(SqlConnection pCON, bool is_add, string id)
        {
            commonReturn return2 = new commonReturn();
            string       str     = string.Empty;

            if (is_add)
            {
                str = @"select a.*, '00:00' as start_time, '00:00' as end_time, '00:00' as bgd_time
                        from BIGADONG a;";
            }
            else
            {
                str = @"select a.*, b.start_time, b.end_time, b.bgd_time
                           from BIGADONG a 
                                 left outer join JAKEOP_SILJEOK_BGD b on (a.bgd_id = b.bgd_id)
                           where siljeok_id like '%' + @siljeok_id + '%' ";
            }

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@siljeok_id", id);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 14
0
        public static commonReturn delete(SqlConnection pCON, string id)
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            try
            {
                SqlCommand pCMD = new SqlCommand();
                str = @"BEGIN TRY
                                    BEGIN TRAN
                                    update SEOLBI set Maptype=null where MACHINE_CODE=@MACHINE_CODE
                                    delete from SEOLBI where MACHINE_CODE = @MACHINE_CODE

                                    update SEOLBI set MapType=null where MACHINE_CODE = @MACHINE_CODE
                                    delete from SEOLBI where MACHINE_CODE = @MACHINE_CODE
                                    COMMIT TRAN
                            END TRY

                            BEGIN CATCH
                                    ROLLBACK TRAN
                            END CATCH ";
                pCMD.CommandText = str;
                pCMD.Connection  = pCON;
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@MACHINE_CODE", id);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 15
0
        public static commonReturn findByRequirements(SqlConnection pCON, string MACHINE_CODE, string MACHINE_NAME, int MACHINE_NUMBER, string MACHINE_IP)
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            str = @"select *
                        from SEOLBI 
                        where MACHINE_CODE = @MACHINE_CODE
                                or MACHINE_NAME = @MACHINE_NAME
                                or MACHINE_NUMBER = @MACHINE_NUMBER
                                or MACHINE_IP = @MACHINE_IP ";

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };

                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@MACHINE_CODE", MACHINE_CODE);
                pCMD.Parameters.AddWithValue("@MACHINE_NAME", MACHINE_NAME);
                pCMD.Parameters.AddWithValue("@MACHINE_NUMBER", MACHINE_NUMBER);
                pCMD.Parameters.AddWithValue("@MACHINE_IP", MACHINE_IP);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 16
0
        public static commonReturn findByCondition(SqlConnection pCON, string gbn, string name)
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            str = @"select * from EOPCHE where ec_gbn_name like '%' + @gbn + '%' and ec_name like '%' + @name + '%' ";

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@gbn", gbn);
                pCMD.Parameters.AddWithValue("@name", name);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 17
0
        public static commonReturn findByID(SqlConnection pCON, string id)
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            str = @"select a.*, b.sj_name
                        from JEPUM  a
                               left outer join SUJI b on (a.sj_id = b.sj_id) where a.jp_id = @id ";

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };

                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@id", id);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 18
0
        public static commonReturn findByCondition(SqlConnection pCON, string balju, string gbn, string chk) //조회함수
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            if (chk == "Y")
            {
                str = @"select a.* , (select ec_name from EOPCHE where a.balju_id = ec_id) as balju_name,
                                            (select ec_name from EOPCHE where a.jejak_id = ec_id) as jejak_name,
                                            (select ec_name from EOPCHE where a.yangsan_id = ec_id) as yangsan_name,
                                            (select ec_name from EOPCHE where a.wonsuju_id = ec_id) as wonsuju_name,
                                            (select ec_name from EOPCHE where a.buy_id = ec_id) as buy_name,
                                            (select ec_name from EOPCHE where a.where_id = ec_id) as where_name, c.MACHINE_NAME
                            from GEUMHYEONG a left outer join EOPCHE b on (a.balju_id = b.ec_id)
                                              left outer join SEOLBI c on (a.MACHINE_CODE = c.MACHINE_CODE) 
                            where a.use_chk = 'Y' 
                                    and ec_name like '%' +  @balju_name + '%' 
                                    and jj_gbn like '%' + @jj_gbn + '%' ";
            }
            else
            {
                str = @"select a.* , (select ec_name from EOPCHE where a.balju_id = ec_id) as balju_name,
                                            (select ec_name from EOPCHE where a.jejak_id = ec_id) as jejak_name,
                                            (select ec_name from EOPCHE where a.yangsan_id = ec_id) as yangsan_name,
                                            (select ec_name from EOPCHE where a.wonsuju_id = ec_id) as wonsuju_name,
                                            (select ec_name from EOPCHE where a.buy_id = ec_id) as buy_name,
                                            (select ec_name from EOPCHE where a.where_id = ec_id) as where_name, c.MACHINE_NAME
                            from GEUMHYEONG a left outer join EOPCHE b on (a.balju_id = b.ec_id) 
                                              left outer join SEOLBI c on (a.MACHINE_CODE = c.MACHINE_CODE) 
                            where ec_name like '%' +  @balju_name + '%' 
                                    and jj_gbn like '%' + @jj_gbn + '%' ";
            }

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@balju_name", balju);
                pCMD.Parameters.AddWithValue("@jj_gbn", gbn);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
        public static commonReturn delete(SqlConnection pCON, string id)
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            try
            {
                SqlCommand pCMD = new SqlCommand();
                str = "delete from BULRYANG_WONIN where br_id = @br_id";
                pCMD.CommandText = str;
                pCMD.Connection  = pCON;
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@br_id", id);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 20
0
        public static commonReturn deletePerformance(SqlConnection pCON, string id)
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            try
            {
                SqlCommand pCMD = new SqlCommand();
                str = "delete from JAKEOP_SILJEOK where siljeok_id = @id";
                pCMD.CommandText = str;
                pCMD.Connection  = pCON;
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@id", id);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 21
0
        public static commonReturn read_menu(SqlConnection pCON, string sw_id)
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            //(case when y.child_id = 0 then '▶ ' + y.menu_name else '    ▷ ' + y.menu_name end) menu_name,
            str = @"select isnull(x.permission_id, -1) as pemission_id , isnull(x.sw_id, '-1x') as sw_id , y.parent_id, y.child_id,
                        y.menu_name,
                        cast(isnull(x.menu_access, 0) as bit) menu_access,
                        cast(isnull(x.menu_add, 0) as bit) menu_add,
                        cast(isnull(x.menu_upd, 0) as bit) menu_upd,
                        cast(isnull(x.menu_del, 0) as bit) menu_del,
                        cast(isnull(x.menu_search, 0) as bit) menu_search,
                        cast(isnull(x.menu_print, 0) as bit) menu_print,
                        cast(isnull(x.menu_convert, 0) as bit) menu_convert

                        from (select * from MENU_PERMISSION where sw_id = @sw_id) x
                        right outer join MENU_TYPE y on (x.parent_id = y.parent_id and x.child_id = y.child_id)

                        where y.use_chk = 'Y'
                        order by y.parent_id, y.child_id ";


            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@sw_id", sw_id);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 22
0
        public static commonReturn findByName(SqlConnection pCON, string model, string chk)
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            if (chk == "Y")
            {
                str = @"select a.*, b.sj_name
                            from JEPUM  a
                                    left outer join SUJI b on (a.sj_id = b.sj_id)
                            where a.model like '%' + @model + '%' 
                            and a.use_chk = @chk";
            }
            else
            {
                str = @"select a.*, b.sj_name
                            from JEPUM  a
                                    left outer join SUJI b on (a.sj_id = b.sj_id)
                            where a.model like '%' + @model + '%' ";
            }

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@model", model);
                pCMD.Parameters.AddWithValue("@chk", chk);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 23
0
        public static commonReturn readWorkPerformance(SqlConnection pCON, string start, string end, string product) //조회함수
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            str = @"select a.*, b.*, c.MACHINE_NAME, d.sw_name, e.bs_name, f.gm_name, g.sj_name,
                                h.jp_name, h.jp_num, h.car, h.model, h.mtrl_num, h.cavity, h.cycle_t

                       from JAKEOP_SILJEOK a left outer join JAKEOP_JISI b on (a.jisi_id = b.jisi_id)
                                                left outer join SEOLBI c on (b.MACHINE_CODE = c.MACHINE_CODE)
                                                left outer join SAWON d on (a.sw_id = d.sw_id)
                                                left outer join BUSEO e on (a.bs_id = e.bs_id)
                                                left outer join GEUNMU f on (a.gm_id = f.gm_id)
                                                left outer join SUJI g on (h.sj_id = g.sj_id)
                                                left outer join JEPUM h on (b.jp_id = h.jp_id)

                       where a.work_date >= @start 
                                and a.work_date <= @end
                                and b.jp_id like '%' + @product + '%' ";

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@start", start);
                pCMD.Parameters.AddWithValue("@end", end);
                pCMD.Parameters.AddWithValue("@product", product);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 24
0
        public static commonReturn delete_ec(SqlConnection pCON, string id)
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            try
            {
                SqlCommand pCMD = new SqlCommand();
                str = @"delete from EOPCHE_DAMDANG where ec_id = @ec_id;
                            delete from EOPCHE where ec_id=@ec_id; ";
                pCMD.CommandText = str;
                pCMD.Connection  = pCON;
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@ec_id", id);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
        public static commonReturn read_all(SqlConnection pCON) //조회함수
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            str = @"select * from BULRYANG_WONIN order by br_gbn, br_id";

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 26
0
        public static commonReturn readResinRecordsForRef(SqlConnection pCON) //조회함수
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";


            str = @"select * from SUJI where use_chk = 'Y' order by sj_id";
            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();

                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
        public static commonReturn findByDetail(SqlConnection pCON, string detail)
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            str = @"select * from BULRYANG_WONIN where br_detail like '%' + @br_detail + '%'  order by br_id";

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@br_detail", detail);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 28
0
        public static commonReturn findForRef(SqlConnection pCON, string grpName)
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            str = @"select * from GONGTONG where gt_grp like '%' + @grpName + '%' and use_chk ='Y' ";

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@grpName", grpName);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 29
0
        public static commonReturn findByName(SqlConnection pCON, string name)
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            str = @"select * from GEUNMU where gm_name like '%' + @gm_name + '%'  order by gm_id";

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@gm_name", name);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }
Ejemplo n.º 30
0
        public static commonReturn read_dd(SqlConnection pCON, string ec_id) //조회함수
        {
            commonReturn return2 = new commonReturn();
            string       str     = "";

            str = @"select * from EOPCHE_DAMDANG where ec_id = @ec_id order by dd_name";

            try
            {
                SqlCommand pCMD = new SqlCommand
                {
                    CommandText = str,
                    Connection  = pCON
                };
                pCMD.Parameters.Clear();
                pCMD.Parameters.AddWithValue("@ec_id", ec_id);
                return2 = DBsql.SQLExecuteDS(pCON, pCMD);
            }
            catch (Exception exception)
            {
                return2.Message = exception.ToString();
            }
            return(return2);
        }