public void IBD_RESULT_Header_LABDAO_UPDATE(IBD_RESULT_Header_LAB OBJ)
 {
     Sql.ExecuteNonQuery("SAP", "UPDATE [SYNC_NUTRICIEL].[dbo].[tbl_IBD_RESULT_Header_LAB] SET" +
                         "[FilePath]          = N'" + OBJ.FilePath + "'" +
                         ",[FileName]          = N'" + OBJ.FileName + "'" +
                         ",[Date]             = N'" + OBJ.Date + "'" +
                         ",[Time]              = N'" + OBJ.Time + "'" +
                         ",[Case]      = N'" + OBJ.Case + "'" +
                         ",[KHMau_GiaoMau]      = N'" + OBJ.KHMau_GiaoMau + "'" +
                         ",[Count] = " + OBJ.Count +
                         ",[GMean] = " + OBJ.GMean +
                         ",[Mean] = " + OBJ.Mean +
                         ",[SD] = " + OBJ.SD +
                         ",[CV] = " + OBJ.CV +
                         ",[Min] = " + OBJ.Min +
                         ",[Max] = " + OBJ.Max +
                         ",[Tech] = " + OBJ.Tech +
                         ",[HUYETTHANHHOC_STD_VALUE_ID] = " + OBJ.HUYETTHANHHOC_STD_VALUE_ID +
                         ",[CTXN_ID] = " + OBJ.CTXN_ID +
                         ",[CreatedDate] = Convert(datetime,'" + DateTime.Now + "',103)" +
                         ",[CreatedBy] = N'" + OBJ.CreatedBy + "' " +
                         ",[Note] = N'" + OBJ.Note + "' " +
                         ",[Locked] = '" + OBJ.Locked + "' " +
                         " WHERE [ID]='" + OBJ.ID + "'", CommandType.Text);
 }
 public int IBD_RESULT_Header_LABDAO_INSERT(IBD_RESULT_Header_LAB OBJ)
 {
     return(DAO.IBD_RESULT_Header_LABDAO_INSERT(OBJ));
 }
 public void IBD_RESULT_Header_LABDAO_UPDATE(IBD_RESULT_Header_LAB OBJ)
 {
     DAO.IBD_RESULT_Header_LABDAO_UPDATE(OBJ);
 }
        public int IBD_RESULT_Header_LABDAO_INSERT(IBD_RESULT_Header_LAB OBJ)
        {
            //if (Sql.ExecuteDataTable("SAP", "SELECT ID FROM [SYNC_NUTRICIEL].[dbo].[tbl_MYCOTOXIN_RESULT_Header_LAB] WHERE FilePath='" + OBJ.FilePath + "'", CommandType.Text).Rows[0]["ID"].ToString().Length == 0)
            //        return 0;
            //else
            //{
            Sql.ExecuteNonQuery("SAP", "INSERT INTO [SYNC_NUTRICIEL].[dbo].[tbl_IBD_RESULT_Header_LAB] " +
                                " ([FilePath] " +
                                " ,[FileName] " +
                                " ,[Date] " +
                                " ,[Time] " +
                                " ,[Case] " +
                                " ,[KHMau_GiaoMau] " +
                                " ,[Count] " +
                                " ,[GMean] " +
                                " ,[Mean] " +
                                " ,[SD] " +
                                " ,[CV] " +
                                " ,[Min] " +
                                " ,[Max] " +
                                " ,[Tech] " +
                                " ,[Neg] " +
                                " ,[Pos] " +
                                " ,[Sus] " +
                                " ,[HUYETTHANHHOC_STD_VALUE_ID] " +
                                " ,[CTXN_ID] " +
                                " ,[CreatedDate] " +
                                " ,[CreatedBy] " +
                                " ,[Note] " +
                                " ,[Locked]) " +
                                " VALUES " +
                                "(N'" + OBJ.FilePath +
                                "',N'" + OBJ.FileName +
                                "',Convert(datetime,N'" + OBJ.Date +
                                "',103),N'" + OBJ.Time +
                                "',N'" + OBJ.Case +
                                "',N'" + OBJ.KHMau_GiaoMau +
                                "'," + OBJ.Count +
                                "," + OBJ.GMean +
                                "," + OBJ.Mean +
                                "," + OBJ.SD +
                                "," + OBJ.CV +
                                "," + OBJ.Min +
                                "," + OBJ.Max +
                                ",'" + OBJ.Tech +
                                "'," + OBJ.Neg +
                                "," + OBJ.Pos +
                                "," + OBJ.Sus +
                                "," + OBJ.HUYETTHANHHOC_STD_VALUE_ID +
                                "," + OBJ.CTXN_ID +
                                ",Convert(datetime,N'" + DateTime.Now +
                                "',103),N'" + OBJ.CreatedBy +
                                "',N'" + OBJ.Note +
                                "','" + OBJ.Locked +
                                "')", CommandType.Text);

            DataTable dt = Sql.ExecuteDataTable("SAP", "SELECT ID FROM [SYNC_NUTRICIEL].[dbo].[tbl_IBD_RESULT_Header_LAB] " +
                                                "WHERE FileName='" + OBJ.FileName + "' and CTXN_ID=" + OBJ.CTXN_ID, CommandType.Text);

            return(int.Parse(dt.Rows[0]["ID"].ToString()));
            //}
        }